Lineage

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.core" { graph [label="abjad.core"]; node [color=1]; "abjad.core.Lineage.Lineage" [URL="../api/abjad/core/Lineage.html#abjad.core.Lineage.Lineage", color=black, fontcolor=white, label=Lineage, target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/core/../system/AbjadObject.html#abjad.system.AbjadObject.AbjadObject", label="Abjad\nObject", target=_top]; } 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]; } subgraph "cluster_collections.abc" { graph [label="collections.abc"]; node [color=4]; "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.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.Sized" -> "collections.abc.Collection"; } "abjad.system.AbjadObject.AbjadObject" -> "abjad.core.Lineage.Lineage"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; "builtins.object" -> "collections.abc.Container"; "builtins.object" -> "collections.abc.Iterable"; "builtins.object" -> "collections.abc.Sized"; "collections.abc.Sequence" -> "abjad.core.Lineage.Lineage"; }

class abjad.core.Lineage.Lineage(component=None)

Lineage of a component.

>>> score = abjad.Score()
>>> staff = abjad.Staff(
...     r"""\new Voice = "Treble Voice" { c'4 }""",
...     name='Treble Staff',
...     )
>>> score.append(staff)
>>> bass = abjad.Staff(
...     r"""\new Voice = "Bass Voice" { b,4 }""",
...     name='Bass Staff',
...     )
>>> score.append(bass)
>>> for component in abjad.inspect(score).lineage():
...     component
...
<Score<<2>>>
<Staff-"Treble Staff"{1}>
Voice("c'4", name='Treble Voice')
Note("c'4")
<Staff-"Bass Staff"{1}>
Voice('b,4', name='Bass Voice')
Note('b,4')
>>> bass_voice = score['Bass Voice']
>>> for component in abjad.inspect(bass_voice).lineage():
...     component
...
<Score<<2>>>
<Staff-"Bass Staff"{1}>
Voice('b,4', name='Bass Voice')
Note('b,4')

Attributes Summary

__getitem__ Gets argument.
__len__ Gets length of lineage.
component The component from which the lineage was derived.
components Gets components.

Special methods

(Sequence).__contains__(value)
(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

__getitem__(argument)

Gets argument.

Returns component or tuple.

(Sequence).__iter__()
__len__()

Gets length of lineage.

Returns int.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.

(Sequence).__reversed__()

Methods

(Sequence).count(value) → integer -- return number of occurrences of value
(Sequence).index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.


Read-only properties

component

The component from which the lineage was derived.

components

Gets components.

Returns tuple.