CompoundInequality

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]; } subgraph "cluster_abjad.timespans" { graph [label="abjad.timespans"]; node [color=2]; "abjad.timespans.CompoundInequality.CompoundInequality" [URL="../api/abjad/timespans/CompoundInequality.html#abjad.timespans.CompoundInequality.CompoundInequality", color=black, fontcolor=white, label="Compound\nInequality", target=_top]; } subgraph "cluster_abjad.utilities" { graph [label="abjad.utilities"]; node [color=3]; "abjad.utilities.TypedCollection.TypedCollection" [URL="../api/abjad/timespans/../utilities/TypedCollection.html#abjad.utilities.TypedCollection.TypedCollection", label="Typed\nCollection", shape=oval, style=bold, target=_top]; "abjad.utilities.TypedList.TypedList" [URL="../api/abjad/timespans/../utilities/TypedList.html#abjad.utilities.TypedList.TypedList", label="Typed\nList", target=_top]; "abjad.utilities.TypedCollection.TypedCollection" -> "abjad.utilities.TypedList.TypedList"; } subgraph cluster_builtins { graph [label=builtins]; node [color=4]; "builtins.object" [URL="https://docs.python.org/3.6/library/functions.html#object", label=object, target=_top]; } subgraph "cluster_collections.abc" { graph [label="collections.abc"]; node [color=5]; "collections.abc.Collection" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Collection", label=Collection, shape=oval, style=bold, target=_top]; "collections.abc.Container" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Container", label=Container, shape=oval, style=bold, target=_top]; "collections.abc.Iterable" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Iterable", label=Iterable, shape=oval, style=bold, target=_top]; "collections.abc.MutableSequence" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.MutableSequence", label="Mutable\nSequence", shape=oval, style=bold, target=_top]; "collections.abc.Reversible" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Reversible", label=Reversible, shape=oval, style=bold, target=_top]; "collections.abc.Sequence" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Sequence", label=Sequence, shape=oval, style=bold, target=_top]; "collections.abc.Sized" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Sized", label=Sized, shape=oval, style=bold, target=_top]; "collections.abc.Collection" -> "collections.abc.Sequence"; "collections.abc.Container" -> "collections.abc.Collection"; "collections.abc.Iterable" -> "collections.abc.Collection"; "collections.abc.Iterable" -> "collections.abc.Reversible"; "collections.abc.Reversible" -> "collections.abc.Sequence"; "collections.abc.Sequence" -> "collections.abc.MutableSequence"; "collections.abc.Sized" -> "collections.abc.Collection"; } "abjad.system.AbjadObject.AbjadObject" -> "abjad.utilities.TypedCollection.TypedCollection"; "abjad.utilities.TypedList.TypedList" -> "abjad.timespans.CompoundInequality.CompoundInequality"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; "builtins.object" -> "collections.abc.Container"; "builtins.object" -> "collections.abc.Iterable"; "builtins.object" -> "collections.abc.Sized"; "collections.abc.MutableSequence" -> "abjad.utilities.TypedList.TypedList"; }

class abjad.timespans.CompoundInequality.CompoundInequality(items=None, logical_operator='and')

Compound time-relation inequality.

>>> compound_inequality = abjad.timespans.CompoundInequality([
...    abjad.timespans.CompoundInequality([
...        'timespan_1.start_offset <= timespan_2.start_offset',
...        'timespan_2.start_offset < timespan_1.stop_offset'],
...         logical_operator='and'),
...    abjad.timespans.CompoundInequality([
...        'timespan_2.start_offset <= timespan_1.start_offset',
...        'timespan_1.start_offset < timespan_2.stop_offset'],
...        logical_operator='and')],
...    logical_operator='or',
...    )
>>> abjad.f(compound_inequality)
abjad.timespans.CompoundInequality(
    [
        abjad.timespans.CompoundInequality(
            [
                abjad.TimespanInequality('timespan_1.start_offset <= timespan_2.start_offset'),
                abjad.TimespanInequality('timespan_2.start_offset < timespan_1.stop_offset'),
                ],
            logical_operator='and',
            ),
        abjad.timespans.CompoundInequality(
            [
                abjad.TimespanInequality('timespan_2.start_offset <= timespan_1.start_offset'),
                abjad.TimespanInequality('timespan_1.start_offset < timespan_2.stop_offset'),
                ],
            logical_operator='and',
            ),
        ],
    logical_operator='or',
    )

Attributes Summary

evaluate Evalutes compound inequality.
evaluate_offset_inequality Evalutes offset inequality.
get_offset_indices Gets offset indices of compound inequality.
logical_operator Compound inequality logical operator.
logical_operator_dictionary

Special methods

(TypedCollection).__contains__(item)

Is true when typed collection contains item.

Returns true or false.

(TypedList).__delitem__(i)

Aliases list.__delitem__().

Returns none.

(TypedCollection).__eq__(argument)

Is true when argument is a typed collection with items that compare equal to those of this typed collection.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to '' or 'storage'. Interprets '' equal to 'storage'.

Returns string.

(TypedList).__getitem__(argument)

Gets item or slice identified by argument.

Returns item or slice.

(TypedCollection).__hash__()

Hashes typed collection.

Redefined in tandem with __eq__.

(TypedList).__iadd__(argument)

Adds argument in place to typed list.

>>> dynamic_list = abjad.TypedList(item_class=abjad.Dynamic)
>>> dynamic_list.append('ppp')
>>> dynamic_list += ['p', 'mp', 'mf', 'fff']
>>> abjad.f(dynamic_list)
abjad.TypedList(
    [
        abjad.Dynamic('ppp'),
        abjad.Dynamic('p'),
        abjad.Dynamic('mp'),
        abjad.Dynamic('mf'),
        abjad.Dynamic('fff'),
        ],
    item_class=abjad.Dynamic,
    )

Returns typed list.

(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedCollection).__len__()

Gets length of typed collection.

Returns nonnegative integer.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

(TypedList).__reversed__()

Aliases list.__reversed__().

Returns generator.

(TypedList).__setitem__(i, argument)

Sets item i equal to argument.

Sets item:

>>> pitch_list = abjad.TypedList(
...     item_class=abjad.NamedPitch,
...     )
>>> pitch_list.append(0)
>>> pitch_list.append("d'")
>>> pitch_list.append(('e', 4))
>>> pitch_list.append(abjad.NamedPitch("f'"))
>>> pitch_list[-1] = 'gqs,'
>>> abjad.f(pitch_list)
abjad.TypedList(
    [
        abjad.NamedPitch("c'"),
        abjad.NamedPitch("d'"),
        abjad.NamedPitch("e'"),
        abjad.NamedPitch('gqs,'),
        ],
    item_class=abjad.NamedPitch,
    )

Sets slice:

>>> pitch_list[-1:] = ["f'", "g'", "a'", "b'", "c''"]
>>> abjad.f(pitch_list)
abjad.TypedList(
    [
        abjad.NamedPitch("c'"),
        abjad.NamedPitch("d'"),
        abjad.NamedPitch("e'"),
        abjad.NamedPitch("f'"),
        abjad.NamedPitch("g'"),
        abjad.NamedPitch("a'"),
        abjad.NamedPitch("b'"),
        abjad.NamedPitch("c''"),
        ],
    item_class=abjad.NamedPitch,
    )

Returns none.


Methods

(TypedList).append(item)

Appends item to typed list.

>>> integer_list = abjad.TypedList(item_class=int)
>>> integer_list.append('1')
>>> integer_list.append(2)
>>> integer_list.append(3.4)
>>> integer_list[:]
[1, 2, 3]

Returns none.

(MutableSequence).clear() → None -- remove all items from S
(TypedList).count(item)

Gets count of item in typed list.

>>> integer_list = abjad.TypedList(item_class=int)
>>> integer_list.extend([0, 0., '0', 99])
>>> integer_list.count(0)
3
>>> integer_list.count(1)
0
>>> integer_list.count(99)
1

Returns nonnegative integer.

evaluate(timespan_1_start_offset, timespan_1_stop_offset, timespan_2_start_offset, timespan_2_stop_offset)

Evalutes compound inequality.

Returns true or false.

evaluate_offset_inequality(timespan_start, timespan_stop, offset)

Evalutes offset inequality.

Returns true or false.

(TypedList).extend(items)

Extends typed list with items.

>>> integer_list = abjad.TypedList(item_class=int)
>>> integer_list.extend(['0', 1.0, 2, 3.14159])
>>> integer_list
TypedList([0, 1, 2, 3], item_class=int)

Returns none.

get_offset_indices(timespan_1, timespan_2_start_offsets, timespan_2_stop_offsets)

Gets offset indices of compound inequality.

(TypedList).index(item)

Gets index of item in typed list.

>>> pitch_list = abjad.TypedList(
...     item_class=abjad.NamedPitch,
...     )
>>> pitch_list.extend(['cqf', "as'", 'b,', 'dss'])
>>> pitch_list.index(abjad.NamedPitch('cqf'))
0
>>> pitch_list.index(abjad.NamedPitch("as'"))
1
>>> pitch_list.index('b,')
2
>>> pitch_list.index('dss')
3

Returns nonnegative integer.

(TypedList).insert(i, item)

Insert item into typed list.

Inserts into typed list.

>>> integer_list = abjad.TypedList(item_class=int)
>>> integer_list.extend(['1', 2, 4.3])
>>> integer_list
TypedList([1, 2, 4], item_class=int)
>>> integer_list.insert(0, '0')
>>> integer_list
TypedList([0, 1, 2, 4], item_class=int)
>>> integer_list.insert(1, '9')
>>> integer_list
TypedList([0, 9, 1, 2, 4], item_class=int)

Returns none.

(TypedList).pop(i=-1)

Pops item i from typed list.

Returns item.

(TypedList).remove(item)

Removes item from typed list.

>>> integer_list = abjad.TypedList(item_class=int)
>>> integer_list.extend(('0', 1.0, 2, 3.14159))
>>> integer_list[:]
[0, 1, 2, 3]
>>> integer_list.remove('1')
>>> integer_list[:]
[0, 2, 3]

Returns none.

(TypedList).reverse()

Reverses items in typed list.

(TypedList).sort(cmp=None, key=None, reverse=False)

Sorts items in typed list.


Read/write properties

(TypedList).keep_sorted

Is true when typed list keeps items sorted.

Defaults to none.

Set to true, false or none.

Returns true, false or none.


Read-only properties

(TypedCollection).item_class

Gets item class of collection.

Collection coerces items according to item_class.

Returns class.

(TypedCollection).items

Gets items in collection.

Returns list.

logical_operator

Compound inequality logical operator.