Part

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.segments" { graph [label="abjad.segments"]; node [color=1]; "abjad.segments.Part.Part" [URL="../api/abjad/segments/Part.html#abjad.segments.Part.Part", color=black, fontcolor=white, label=Part, target=_top]; } subgraph "cluster_abjad.system" { graph [label="abjad.system"]; node [color=2]; "abjad.system.AbjadObject.AbjadObject" [URL="../api/abjad/segments/../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]; } "abjad.system.AbjadObject.AbjadObject" -> "abjad.segments.Part.Part"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.segments.Part.Part(instrument=None, member=None, number=None, section=None, section_abbreviation=None, zfill=None)

Part.

>>> part = abjad.Part(
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> abjad.f(part)
abjad.Part(
    instrument='FirstViolin',
    member=18,
    section='FirstViolin',
    section_abbreviation='VN-1',
    )

Attributes Summary

__eq__ Is true when argument is a part with the same section and member as this part.
__hash__ Hashes part.
identifier Gets identifier.
instrument Gets instrument.
member Gets member.
name Gets name.
number Gets number.
section Gets section.
section_abbreviation Gets section_abbreviation.
zfill Gets zfill.

Special methods

__eq__(argument)

Is true when argument is a part with the same section and member as this part.

>>> part_1 = abjad.Part(
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part_2 = abjad.Part(
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part_3 = abjad.Part(
...     member=18,
...     section='SecondViolin',
...     section_abbreviation='VN-2',
...     )
>>> part_1 == part_1
True
>>> part_1 == part_2
True
>>> part_1 == part_3
False
>>> part_2 == part_1
True
>>> part_2 == part_2
True
>>> part_2 == part_3
False
>>> part_3 == part_1
False
>>> part_3 == part_2
False
>>> part_3 == part_3
True
Return type:bool
(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

__hash__()

Hashes part.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Read-only properties

identifier

Gets identifier.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.identifier
'VN-1-18'
Return type:str
instrument

Gets instrument.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.instrument
'Violin'
Return type:Optional[str]
member

Gets member.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.member
18
Return type:Optional[int]
name

Gets name.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=1,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.name
'FirstViolin1'
>>> part = abjad.Part(
...     instrument='Violin',
...     member=1,
...     zfill=2,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.name
'FirstViolin01'
Return type:Optional[str]
number

Gets number.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=18,
...     number=107,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.number
107
Return type:Optional[int]
section

Gets section.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.section
'FirstViolin'
Return type:Optional[str]
section_abbreviation

Gets section_abbreviation.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=18,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     )
>>> part.section_abbreviation
'VN-1'
Return type:Optional[str]
zfill

Gets zfill.

>>> part = abjad.Part(
...     instrument='Violin',
...     member=9,
...     number=99,
...     section='FirstViolin',
...     section_abbreviation='VN-1',
...     zfill=2,
...     )
>>> part.zfill
2
>>> str(part.member).zfill(part.zfill)
'09'
Return type:Optional[int]