Vector

abstract class pitchtools.Vector(items=None, item_class=None)

Vector base class.

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.TypedCounter.TypedCounter" [color=3, group=2, label=TypedCounter, shape=box]; "abjad.tools.datastructuretools.TypedCollection.TypedCollection" -> "abjad.tools.datastructuretools.TypedCounter.TypedCounter"; } subgraph cluster_pitchtools { graph [label=pitchtools]; "abjad.tools.pitchtools.IntervalClassVector.IntervalClassVector" [color=4, group=3, label=IntervalClassVector, shape=box]; "abjad.tools.pitchtools.IntervalVector.IntervalVector" [color=4, group=3, label=IntervalVector, shape=box]; "abjad.tools.pitchtools.PitchClassVector.PitchClassVector" [color=4, group=3, label=PitchClassVector, shape=box]; "abjad.tools.pitchtools.PitchVector.PitchVector" [color=4, group=3, label=PitchVector, shape=box]; "abjad.tools.pitchtools.Vector.Vector" [color=black, fontcolor=white, group=3, label=<<B>Vector</B>>, shape=oval, style="filled, rounded"]; "abjad.tools.pitchtools.Vector.Vector" -> "abjad.tools.pitchtools.IntervalClassVector.IntervalClassVector"; "abjad.tools.pitchtools.Vector.Vector" -> "abjad.tools.pitchtools.IntervalVector.IntervalVector"; "abjad.tools.pitchtools.Vector.Vector" -> "abjad.tools.pitchtools.PitchClassVector.PitchClassVector"; "abjad.tools.pitchtools.Vector.Vector" -> "abjad.tools.pitchtools.PitchVector.PitchVector"; } 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.TypedCounter.TypedCounter" -> "abjad.tools.pitchtools.Vector.Vector"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

clear() Clears typed counter.
copy() Copies typed counter.
elements() Elements in typed counter.
from_selection(class_, selection[, item_class]) Makes vector from selection.
item_class Item class to coerce items into.
items() Items in typed counter.
keys() Iterates keys in typed counter.
most_common([n]) Please document.
subtract([iterable]) Stracts iterable from typed counter.
update([iterable]) Updates typed counter with iterable.
values() Iterates values in typed counter.
viewitems() Please document.
viewkeys() Please document.
viewvalues() Please document.
__add__(expr) Adds typed counter to expr.
__and__(expr) Logical AND of typed counter and expr.
__contains__(item) Is true when typed collection container item.
__delitem__(item) Deletes item from typed counter.
__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.
__getitem__(item) Gets item from typed counter.
__hash__() Hashes typed collection.
__iter__() Iterates typed collection.
__len__() Length of typed collection.
__missing__(item) Returns zero.
__ne__(expr) Is true when expr is not a typed collection with items equal to this typed collection.
__or__(expr) Logical OR of typed counter and expr.
__repr__() Gets interpreter representation of Abjad object.
__setitem__(item, value) Sets typed counter item to value.
__str__() String representation of vector.
__sub__(expr) Subtracts expr from typed counter.

Read-only properties

(TypedCollection).item_class

Item class to coerce items into.

Methods

(TypedCounter).clear()

Clears typed counter.

Returns none.

(TypedCounter).copy()

Copies typed counter.

Returns new typed counter.

(TypedCounter).elements()

Elements in typed counter.

abstract Vector.from_selection(class_, selection, item_class=None)

Makes vector from selection.

Returns vector.

(TypedCounter).items()

Items in typed counter.

Returns tuple.

(TypedCounter).keys()

Iterates keys in typed counter.

(TypedCounter).most_common(n=None)

Please document.

(TypedCounter).subtract(iterable=None, **kwargs)

Stracts iterable from typed counter.

(TypedCounter).update(iterable=None, **kwargs)

Updates typed counter with iterable.

(TypedCounter).values()

Iterates values in typed counter.

(TypedCounter).viewitems()

Please document.

(TypedCounter).viewkeys()

Please document.

(TypedCounter).viewvalues()

Please document.

Special methods

(TypedCounter).__add__(expr)

Adds typed counter to expr.

Returns new typed counter.

(TypedCounter).__and__(expr)

Logical AND of typed counter and expr.

Returns new typed counter.

(TypedCollection).__contains__(item)

Is true when typed collection container item. Otherwise false.

Returns true or false.

(TypedCounter).__delitem__(item)

Deletes item from typed counter.

Returns none.

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

(TypedCounter).__getitem__(item)

Gets item from typed counter.

Returns item.

(TypedCollection).__hash__()

Hashes typed collection.

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

Returns integer.

(TypedCollection).__iter__()

Iterates typed collection.

Returns generator.

(TypedCollection).__len__()

Length of typed collection.

Returns nonnegative integer.

(TypedCounter).__missing__(item)

Returns zero.

Returns zero.

(TypedCollection).__ne__(expr)

Is true when expr is not a typed collection with items equal to this typed collection. Otherwise false.

Returns true or false.

(TypedCounter).__or__(expr)

Logical OR of typed counter and expr.

Returns new typed counter.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

(TypedCounter).__setitem__(item, value)

Sets typed counter item to value.

Returns none.

Vector.__str__()

String representation of vector.

Returns string.

(TypedCounter).__sub__(expr)

Subtracts expr from typed counter.

Returns new typed counter.