IntervalSet

class pitchtools.IntervalSet(items=None, item_class=None)

Interval set.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_datastructuretools { graph [label=datastructuretools]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" [color=3, group=2, label=TypedCollection, shape=oval, style=bold]; "abjad.tools.datastructuretools.TypedFrozenset.TypedFrozenset" [color=3, group=2, label=TypedFrozenset, shape=box]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" -> "abjad.tools.datastructuretools.TypedFrozenset.TypedFrozenset"; } subgraph cluster_pitchtools { graph [label=pitchtools]; "abjad.tools.pitchtools.IntervalSet.IntervalSet" [color=black, fontcolor=white, group=3, label=<<B>IntervalSet</B>>, shape=box, style="filled, rounded"]; "abjad.tools.pitchtools.Set.Set" [color=4, group=3, label=Set, shape=oval, style=bold]; "abjad.tools.pitchtools.Set.Set" -> "abjad.tools.pitchtools.IntervalSet.IntervalSet"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.datastructuretools.TypedCollection.TypedCollection"; "abjad.tools.datastructuretools.TypedFrozenset.TypedFrozenset" -> "abjad.tools.pitchtools.Set.Set"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

copy() Copies typed frozen set.
difference(expr) Typed frozen set set-minus expr.
from_selection(class_, selection[, item_class]) Initialize interval set from component selection:
intersection(expr) Set-theoretic intersection of typed frozen set and expr.
isdisjoint(expr) Is true when typed frozen set shares no elements with expr.
issubset(expr) Is true when typed frozen set is a subset of expr.
issuperset(expr) Is true when typed frozen set is a superset of expr.
item_class Item class to coerce items into.
items Gets collection items.
symmetric_difference(expr) Symmetric difference of typed frozen set and expr.
union(expr) Union of typed frozen set and expr.
__and__(expr) Logical AND of typed frozen set and expr.
__contains__(item) Is true when typed collection container item.
__eq__(expr) Is true when expr is a typed collection with items that compare equal to those of this typed collection.
__format__([format_specification]) Formats Abjad object.
__ge__(expr) Is true when typed frozen set is greater than or equal to expr.
__gt__(expr) Is true when typed frozen set is greater than expr.
__hash__() Hashes typed frozen set.
__iter__() Iterates typed collection.
__le__(expr) Is true when typed frozen set is less than or equal to expr.
__len__() Length of typed collection.
__lt__(expr) Is true when typed frozen set is less than expr.
__ne__(expr) Is true when typed frozen set is not equal to expr.
__or__(expr) Logical OR of typed frozen set and expr.
__repr__() Gets interpreter representation of Abjad object.
__str__() String representation of set.
__sub__(expr) Subtracts expr from typed frozen set.
__xor__(expr) Logical XOR of typed frozen set and expr.

Read-only properties

(TypedCollection).item_class

Item class to coerce items into.

(TypedCollection).items

Gets collection items.

Methods

(TypedFrozenset).copy()

Copies typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).difference(expr)

Typed frozen set set-minus expr.

Returns new typed frozen set.

(TypedFrozenset).intersection(expr)

Set-theoretic intersection of typed frozen set and expr.

Returns new typed frozen set.

(TypedFrozenset).isdisjoint(expr)

Is true when typed frozen set shares no elements with expr. Otherwise false.

Returns true or false.

(TypedFrozenset).issubset(expr)

Is true when typed frozen set is a subset of expr. Otherwise false.

Returns true or false.

(TypedFrozenset).issuperset(expr)

Is true when typed frozen set is a superset of expr. Otherwise false.

Returns true or false.

(TypedFrozenset).symmetric_difference(expr)

Symmetric difference of typed frozen set and expr.

Returns new typed frozen set.

(TypedFrozenset).union(expr)

Union of typed frozen set and expr.

Returns new typed frozen set.

Class & static methods

classmethod IntervalSet.from_selection(class_, selection, item_class=None)

Initialize interval set from component selection:

>>> staff_1 = Staff("c'4 <d' fs' a'>4 b2")
>>> staff_2 = Staff("c4. r8 g2")
>>> selection = select((staff_1, staff_2))
>>> intervals = pitchtools.IntervalSet.from_selection(
...     selection)
>>> for interval in sorted(intervals):
...     interval
...
NamedInterval('-M6')
NamedInterval('-P5')
NamedInterval('-aug4')
NamedInterval('-M3')
NamedInterval('-m3')
NamedInterval('-M2')
NamedInterval('+m2')
NamedInterval('+m3')
NamedInterval('+M3')
NamedInterval('+P4')
NamedInterval('+P5')
NamedInterval('+m7')
NamedInterval('+M7')
NamedInterval('+P8')
NamedInterval('+M9')
NamedInterval('+aug11')
NamedInterval('+M13')

Returns interval set.

Special methods

(TypedFrozenset).__and__(expr)

Logical AND of typed frozen set and expr.

Returns new typed frozen set.

(TypedCollection).__contains__(item)

Is true when typed collection container item. Otherwise false.

Returns true or false.

(TypedCollection).__eq__(expr)

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

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(TypedFrozenset).__ge__(expr)

Is true when typed frozen set is greater than or equal to expr. Otherwise false.

Returns true or false.

(TypedFrozenset).__gt__(expr)

Is true when typed frozen set is greater than expr. Otherwise false.

Returns true or false.

(TypedFrozenset).__hash__()

Hashes typed frozen set.

Returns integer.

(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedFrozenset).__le__(expr)

Is true when typed frozen set is less than or equal to expr. Otherwise false.

Returns true or false.

(TypedCollection).__len__()

Length of typed collection.

Returns nonnegative integer.

(TypedFrozenset).__lt__(expr)

Is true when typed frozen set is less than expr. Otherwise false.

Returns true or false.

(TypedFrozenset).__ne__(expr)

Is true when typed frozen set is not equal to expr. Otherwise false.

Returns true or false.

(TypedFrozenset).__or__(expr)

Logical OR of typed frozen set and expr.

Returns new typed frozen set.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

(Set).__str__()

String representation of set.

Returns string.

(TypedFrozenset).__sub__(expr)

Subtracts expr from typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).__xor__(expr)

Logical XOR of typed frozen set and expr.

Returns new typed frozen set.