OffsetTimespanTimeRelation

digraph InheritanceGraph { graph [bgcolor=transparent, color=lightsteelblue2, fontname=Arial, fontsize=10, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, splines=spline, style="dashed, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=10, height=0, penwidth=2, shape=box, style="filled, rounded", width=0]; edge [color=lightslategrey, penwidth=1]; subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=1]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/timespans/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; "abjad.system.AbjadValueObject.AbjadValueObject" [URL="../api/abjad/timespans/../system/AbjadValueObject.html#abjad.system.AbjadValueObject.AbjadValueObject", label="Abjad\nValue\nObject", target=_top]; "abjad.system.AbjadObject.AbjadObject" -> "abjad.system.AbjadValueObject.AbjadValueObject"; } subgraph "cluster_abjad.timespans" { graph [label="abjad.timespans"]; node [color=2]; "abjad.timespans.OffsetTimespanTimeRelation.OffsetTimespanTimeRelation" [URL="../api/abjad/timespans/OffsetTimespanTimeRelation.html#abjad.timespans.OffsetTimespanTimeRelation.OffsetTimespanTimeRelation", color=black, fontcolor=white, label="Offset\nTimespan\nTime\nRelation", target=_top]; "abjad.timespans.TimeRelation.TimeRelation" [URL="../api/abjad/timespans/TimeRelation.html#abjad.timespans.TimeRelation.TimeRelation", label="Time\nRelation", shape=oval, style=bold, target=_top]; "abjad.timespans.TimeRelation.TimeRelation" -> "abjad.timespans.OffsetTimespanTimeRelation.OffsetTimespanTimeRelation"; } subgraph cluster_builtins { graph [label=builtins]; node [color=3]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } "abjad.system.AbjadValueObject.AbjadValueObject" -> "abjad.timespans.TimeRelation.TimeRelation"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.timespans.OffsetTimespanTimeRelation.OffsetTimespanTimeRelation(inequality=None, timespan=None, offset=None)

Offfset vs. timespan time relation.

>>> offset = abjad.Offset(5)
>>> timespan = abjad.Timespan(0, 10)
>>> time_relation = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     timespan=timespan,
...     hold=True,
...     )
>>> abjad.f(time_relation)
abjad.timespans.OffsetTimespanTimeRelation(
    inequality=abjad.timespans.CompoundInequality(
        [
            abjad.TimespanInequality('timespan.start <= offset'),
            abjad.TimespanInequality('offset < timespan.stop'),
            ],
        logical_operator='and',
        ),
    timespan=abjad.Timespan(
        start_offset=abjad.Offset(0, 1),
        stop_offset=abjad.Offset(10, 1),
        ),
    offset=abjad.Offset(5, 1),
    )

Offset / timespan time relations are immutable.


Attributes Summary

__call__ Evaluates time relation:
__eq__ Is true when argument equals time relation.
__format__ Formats time relation.
__hash__ Hashes time relation.
is_fully_loaded Is true when timespan and offset are both not none.
is_fully_unloaded Is true when timespan and offset are both none.
offset Time relation offset:
timespan Time relation timepsan:

Special methods

__call__(timespan=None, offset=None)

Evaluates time relation:

>>> offset = abjad.Offset(5)
>>> timespan = abjad.Timespan(0, 10)
>>> time_relation = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     timespan=timespan,
...     hold=True,
...     )
>>> time_relation()
True

Raises value error is either offset or timespan is none.

Otherwise returns boolean.

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

__eq__(argument)

Is true when argument equals time relation.

>>> offset = abjad.Offset(5)
>>> time_relation_1 = abjad.timespans.offset_happens_during_timespan()
>>> time_relation_2 = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     )
>>> time_relation_1 == time_relation_1
True
>>> time_relation_1 == time_relation_2
False
>>> time_relation_2 == time_relation_2
True

Returns true or false.

__format__(format_specification='')

Formats time relation.

>>> offset = abjad.Offset(5)
>>> timespan = abjad.Timespan(0, 10)
>>> time_relation = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     timespan=timespan,
...     hold=True,
...     )
>>> abjad.f(time_relation)
abjad.timespans.OffsetTimespanTimeRelation(
    inequality=abjad.timespans.CompoundInequality(
        [
            abjad.TimespanInequality('timespan.start <= offset'),
            abjad.TimespanInequality('offset < timespan.stop'),
            ],
        logical_operator='and',
        ),
    timespan=abjad.Timespan(
        start_offset=abjad.Offset(0, 1),
        stop_offset=abjad.Offset(10, 1),
        ),
    offset=abjad.Offset(5, 1),
    )

Returns string.

__hash__()

Hashes time relation.

Required to be explicitly redefined on Python 3 if __eq__ changes.

Returns integer.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Read-only properties

(TimeRelation).inequality

Time relation inequality.

Return ineqality.

is_fully_loaded

Is true when timespan and offset are both not none.

>>> offset = abjad.Offset(5)
>>> timespan = abjad.Timespan(0, 10)
>>> time_relation = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     timespan=timespan,
...     hold=True,
...     )
>>> time_relation.is_fully_loaded
True

Returns true or false.

is_fully_unloaded

Is true when timespan and offset are both none.

>>> offset = abjad.Offset(5)
>>> timespan = abjad.Timespan(0, 10)
>>> time_relation = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     timespan=timespan,
...     hold=True,
...     )
>>> time_relation.is_fully_unloaded
False

Returns true or false.

offset

Time relation offset:

>>> offset = abjad.Offset(5)
>>> timespan = abjad.Timespan(0, 10)
>>> time_relation = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     timespan=timespan,
...     hold=True,
...     )
>>> time_relation.offset
Offset(5, 1)

Returns offset or none.

timespan

Time relation timepsan:

>>> offset = abjad.Offset(5)
>>> timespan = abjad.Timespan(0, 10)
>>> time_relation = abjad.timespans.offset_happens_during_timespan(
...     offset=offset,
...     timespan=timespan,
...     hold=True,
...     )
>>> time_relation.timespan
Timespan(start_offset=Offset(0, 1), stop_offset=Offset(10, 1))

Returns timespan or none.