Section

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.Section.Section" [URL="../api/abjad/segments/Section.html#abjad.segments.Section.Section", color=black, fontcolor=white, label=Section, 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.Section.Section"; "builtins.object" -> "abjad.system.AbjadObject.AbjadObject"; }

class abjad.segments.Section.Section(abbreviation=None, count=1, instrument=None, name=None)

Section.

>>> abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
Section(abbreviation='VN-1', count=18, instrument='Violin', name='FirstViolin')
>>> abjad.Section(
...     abbreviation='VN-2',
...     count=18,
...     instrument='Violin',
...     name='SecondViolin',
...     )
Section(abbreviation='VN-2', count=18, instrument='Violin', name='SecondViolin')
>>> abjad.Section(
...     abbreviation='VA',
...     count=18,
...     name='Viola',
...     )
Section(abbreviation='VA', count=18, instrument='Viola', name='Viola')
>>> abjad.Section(
...     abbreviation='VC',
...     count=14,
...     name='Cello',
...     )
Section(abbreviation='VC', count=14, instrument='Cello', name='Cello')
>>> abjad.Section(
...     abbreviation='CB',
...     count=6,
...     name='Contrabass',
...     )
Section(abbreviation='CB', count=6, instrument='Contrabass', name='Contrabass')

Attributes Summary

__eq__ Is true when argument is a section with the same name, abbreviation and count as this section.
__hash__ Hashes section.
abbreviation Gets abbreviation.
count Gets section count.
instrument Gets section instrument.
name Gets section name.
parts Gets parts.

Special methods

__eq__(argument)

Is true when argument is a section with the same name, abbreviation and count as this section.

>>> section_1 = abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
>>> section_2 = abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
>>> section_3 = abjad.Section(
...     abbreviation='VN-2',
...     count=18,
...     instrument='Violin',
...     name='SecondViolin',
...     )
>>> section_1 == section_1
True
>>> section_1 == section_2
True
>>> section_1 == section_3
False
>>> section_2 == section_1
True
>>> section_2 == section_2
True
>>> section_2 == section_3
False
>>> section_3 == section_1
False
>>> section_3 == section_2
False
>>> section_3 == section_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 section.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.


Read-only properties

abbreviation

Gets abbreviation.

>>> section = abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
>>> section.abbreviation
'VN-1'
Return type:Optional[str]
count

Gets section count.

>>> section = abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
>>> section.count
18
Return type:Optional[int]
instrument

Gets section instrument.

>>> section = abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
>>> section.instrument
'Violin'
Return type:Optional[str]
name

Gets section name.

>>> section = abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
>>> section.name
'FirstViolin'
Return type:Optional[str]
parts

Gets parts.

>>> section = abjad.Section(
...     abbreviation='VN-1',
...     count=18,
...     instrument='Violin',
...     name='FirstViolin',
...     )
>>> for part in section.parts:
...     part
...
Part(instrument='Violin', member=1, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=2, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=3, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=4, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=5, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=6, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=7, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=8, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=9, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=10, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=11, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=12, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=13, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=14, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=15, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=16, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=17, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Part(instrument='Violin', member=18, section='FirstViolin', section_abbreviation='VN-1', zfill=2)
Return type:List[Part]