Skip to content

MarkRegion

Base classes

Name Children Inherits
_Box
framesheet.models
Optional box ``x, y, w, h`` (all four or none), normalized 0-1 unless ``frame``.

⋔ Inheritance diagram

graph TD
  3915616951["models.MarkRegion"]
  263270598["models._Box"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  263270598 --> 3915616951
  3879467795 --> 263270598
  2751680898 --> 3879467795

🛈 DocStrings

Bases: _Box

A time range, optionally with a box: a target element, a zoom, a highlight.

Source code in src/framesheet/models.py
class MarkRegion(_Box):
    """A time range, optionally with a box: a target element, a zoom, a highlight."""

    model_config = ConfigDict(extra="forbid", strict=True)
    start: float = Field(ge=0)
    end: float = Field(ge=0)
    label: str | None = None
    kind: str | None = None
    """Free-form, e.g. ``zoom``. ``target`` boxes are checked against span boxes."""

    @model_validator(mode="after")
    def _ordered(self) -> Any:
        if self.end < self.start:
            msg = "end must be >= start"
            raise ValueError(msg)
        return self

kind class-attribute instance-attribute

kind: str | None = None

Free-form, e.g. zoom. target boxes are checked against span boxes.

:fa-brands-github: Show source on GitHub