IntervalClassSet

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.pitch" { graph [label="abjad.pitch"]; node [color=1]; "abjad.pitch.IntervalClassSet.IntervalClassSet" [URL="../api/abjad/pitch/IntervalClassSet.html#abjad.pitch.IntervalClassSet.IntervalClassSet", color=black, fontcolor=white, label="Interval\nClass\nSet", target=_top]; "abjad.pitch.Set.Set" [URL="../api/abjad/pitch/Set.html#abjad.pitch.Set.Set", label=Set, shape=oval, style=bold, target=_top]; "abjad.pitch.Set.Set" -> "abjad.pitch.IntervalClassSet.IntervalClassSet"; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/pitch/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; } subgraph "cluster_abjad.utilities" { graph [label="abjad.utilities"]; node [color=3]; "abjad.utilities.TypedCollection.TypedCollection" [URL="../api/abjad/pitch/../utilities/TypedCollection.html#abjad.utilities.TypedCollection.TypedCollection", label="Typed\nCollection", shape=oval, style=bold, target=_top]; "abjad.utilities.TypedFrozenset.TypedFrozenset" [URL="../api/abjad/pitch/../utilities/TypedFrozenset.html#abjad.utilities.TypedFrozenset.TypedFrozenset", label="Typed\nFrozenset", target=_top]; "abjad.utilities.TypedCollection.TypedCollection" -> "abjad.utilities.TypedFrozenset.TypedFrozenset"; } 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.Set" [URL="https://docs.python.org/3.6/library/collections.abc.html#collections.abc.Set", label=Set, 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.Set"; "collections.abc.Container" -> "collections.abc.Collection"; "collections.abc.Iterable" -> "collections.abc.Collection"; "collections.abc.Sized" -> "collections.abc.Collection"; } "abjad.system.AbjadObject.AbjadObject" -> "abjad.utilities.TypedCollection.TypedCollection"; "abjad.utilities.TypedFrozenset.TypedFrozenset" -> "abjad.pitch.Set.Set"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; "builtins.object" -> "collections.abc.Container"; "builtins.object" -> "collections.abc.Iterable"; "builtins.object" -> "collections.abc.Sized"; "collections.abc.Set" -> "abjad.utilities.TypedFrozenset.TypedFrozenset"; }

class abjad.pitch.IntervalClassSet.IntervalClassSet(items=None, item_class=None)

Interval-class set.


Attributes Summary

from_selection Initialize interval set from component selection:

Special methods

(TypedFrozenset).__and__(argument)

Logical AND of typed frozen set and argument.

Returns new typed frozen set.

(TypedCollection).__contains__(item)

Is true when typed collection contains item.

Returns true or false.

(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.

(TypedFrozenset).__ge__(argument)

Is true when typed frozen set is greater than or equal to argument.

Returns true or false.

(TypedFrozenset).__gt__(argument)

Is true when typed frozen set is greater than argument.

Returns true or false.

(TypedFrozenset).__hash__()

Hashes typed frozen set.

Returns integer.

(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedFrozenset).__le__(argument)

Is true when typed frozen set is less than or equal to argument.

Returns true or false.

(TypedCollection).__len__()

Gets length of typed collection.

Returns nonnegative integer.

(TypedFrozenset).__lt__(argument)

Is true when typed frozen set is less than argument.

Returns true or false.

(TypedFrozenset).__or__(argument)

Logical OR of typed frozen set and argument.

Returns new typed frozen set.

(Set).__rand__(other)
(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

(Set).__ror__(other)
(Set).__rsub__(other)
(Set).__rxor__(other)
(Set).__str__()

Gets string representation.

Returns string.

(TypedFrozenset).__sub__(argument)

Subtracts argument from typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).__xor__(argument)

Logical XOR of typed frozen set and argument.

Returns new typed frozen set.


Methods

(TypedFrozenset).copy()

Copies typed frozen set.

Returns new typed frozen set.

(TypedFrozenset).difference(argument)

Typed frozen set set-minus argument.

Returns new typed frozen set.

(TypedFrozenset).intersection(argument)

Set-theoretic intersection of typed frozen set and argument.

Returns new typed frozen set.

(TypedFrozenset).isdisjoint(argument)

Is true when typed frozen set shares no elements with argument.

Returns true or false.

(TypedFrozenset).issubset(argument)

Is true when typed frozen set is a subset of argument.

Returns true or false.

(TypedFrozenset).issuperset(argument)

Is true when typed frozen set is a superset of argument.

Returns true or false.

(TypedFrozenset).symmetric_difference(argument)

Symmetric difference of typed frozen set and argument.

Returns new typed frozen set.

(TypedFrozenset).union(argument)

Union of typed frozen set and argument.

Returns new typed frozen set.


Class & static methods

classmethod from_selection(selection, item_class=None)

Initialize interval set from component selection:

>>> staff_1 = abjad.Staff("c'4 <d' fs' a'>4 b2")
>>> staff_2 = abjad.Staff("c4. r8 g2")
>>> staff_group = abjad.StaffGroup([staff_1, staff_2])
>>> abjad.show(staff_group) 
>>> interval_classes = abjad.IntervalClassSet.from_selection(
...     staff_group)
>>> for interval_class in sorted(interval_classes):
...     interval_class
...
NamedIntervalClass('-M6')
NamedIntervalClass('-P5')
NamedIntervalClass('-A4')
NamedIntervalClass('-M3')
NamedIntervalClass('-m3')
NamedIntervalClass('-M2')
NamedIntervalClass('+m2')
NamedIntervalClass('+M2')
NamedIntervalClass('+m3')
NamedIntervalClass('+M3')
NamedIntervalClass('+P4')
NamedIntervalClass('+A4')
NamedIntervalClass('+P5')
NamedIntervalClass('+M6')
NamedIntervalClass('+m7')
NamedIntervalClass('+M7')
NamedIntervalClass('+P8')

Returns interval set.


Read-only properties

(Set).cardinality

Gets cardinality of set.

Defined equal to length of set.

Returns nonnegative integer.

(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.