Skip to content

Commit

Permalink
Added workaround to container-example docstrings. (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorbaca committed Feb 24, 2023
1 parent 67b5eed commit 88ee265
Show file tree
Hide file tree
Showing 26 changed files with 310 additions and 398 deletions.
8 changes: 4 additions & 4 deletions abjad/bind.py
Expand Up @@ -130,9 +130,9 @@ def __copy__(self, *arguments) -> "Wrapper":
r"""
Copies wrapper.
.. container:: example
Preserves annotation flag:
Preserves annotation flag:
.. container:: example
>>> old_staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> abjad.annotate(old_staff[0], "bow_direction", abjad.DOWN)
Expand Down Expand Up @@ -639,9 +639,9 @@ def annotate(component, annotation, indicator) -> None:
r"""
Annotates ``component`` with ``indicator``.
.. container:: example
Annotates first note in staff:
Annotates first note in staff:
.. container:: example
>>> staff = abjad.Staff("c'4 d' e' f'")
>>> abjad.annotate(staff[0], "bow_direction", abjad.DOWN)
Expand Down
8 changes: 4 additions & 4 deletions abjad/cyclictuple.py
Expand Up @@ -68,18 +68,18 @@ def __getitem__(self, argument) -> typing.Any:
"""
Gets item or slice identified by ``argument``.
.. container:: example
Gets slice open at right:
Gets slice open at right:
.. container:: example
>>> items = [0, 1, 2, 3, 4, 5]
>>> tuple_ = abjad.CyclicTuple(items=items)
>>> tuple_[2:]
(2, 3, 4, 5)
.. container:: example
Gets slice closed at right:
Gets slice closed at right:
.. container:: example
>>> items = [0, 1, 2, 3, 4, 5]
>>> tuple_ = abjad.CyclicTuple(items=items)
Expand Down
32 changes: 14 additions & 18 deletions abjad/duration.py
Expand Up @@ -283,9 +283,9 @@ def __ne__(self, argument) -> bool:
See https://bugs.python.org/issue4395#msg89533.
.. container:: example
REGRESSION:
REGRESSION:
.. container:: example
>>> offset_1 = abjad.Offset(1)
>>> offset_2 = abjad.Offset(1, displacement=(-1, 16))
Expand Down Expand Up @@ -1024,8 +1024,6 @@ def from_lilypond_duration_string(
.. container:: example
Initializes duration from LilyPond duration string:
>>> abjad.Duration.from_lilypond_duration_string('8.')
Duration(3, 16)
Expand All @@ -1042,8 +1040,6 @@ def is_token(argument) -> bool:
.. container:: example
Is true when expression is a duration token:
>>> abjad.Duration.is_token('8.')
True
Expand All @@ -1070,9 +1066,9 @@ def to_clock_string(self) -> str:
r"""
Changes duration to clock string.
.. container:: example
Changes duration to clock string:
Changes duration to clock string:
.. container:: example
>>> note = abjad.Note("c'4")
>>> duration = abjad.Duration(117)
Expand Down Expand Up @@ -1296,9 +1292,9 @@ def __eq__(self, argument) -> bool:
"""
Is true when offset equals ``argument``.
.. container:: example
With equal numerators, denominators and displacement:
With equal numerators, denominators and displacement:
.. container:: example
>>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16))
>>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16))
Expand Down Expand Up @@ -1355,9 +1351,9 @@ def __ge__(self, argument) -> bool:
"""
Is true when offset is greater than or equal to ``argument``.
.. container:: example
With equal numerators, denominators and displacement:
With equal numerators, denominators and displacement:
.. container:: example
>>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16))
>>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16))
Expand Down Expand Up @@ -1414,9 +1410,9 @@ def __gt__(self, argument) -> bool:
"""
Is true when offset is greater than ``argument``.
.. container:: example
With equal numerators, denominators and displacement:
With equal numerators, denominators and displacement:
.. container:: example
>>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16))
>>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16))
Expand Down Expand Up @@ -1479,9 +1475,9 @@ def __le__(self, argument) -> bool:
"""
Is true when offset is less than or equal to ``argument``.
.. container:: example
With equal numerators, denominators and displacement:
With equal numerators, denominators and displacement:
.. container:: example
>>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16))
>>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16))
Expand Down Expand Up @@ -1538,9 +1534,9 @@ def __lt__(self, argument) -> bool:
"""
Is true when offset is less than ``argument``.
.. container:: example
With equal numerators, denominators and displacement:
With equal numerators, denominators and displacement:
.. container:: example
>>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16))
>>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16))
Expand Down
60 changes: 30 additions & 30 deletions abjad/get.py
Expand Up @@ -356,9 +356,9 @@ def contents(argument) -> list[_score.Component]:
r"""
Gets contents.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -550,9 +550,9 @@ def descendants(argument) -> list[_score.Component]:
r"""
Gets descendants.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -719,9 +719,9 @@ def duration(
r"""
Gets duration.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -925,9 +925,9 @@ def effective(
r"""
Gets effective indicator.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -1428,9 +1428,9 @@ def effective_staff(argument) -> typing.Optional["_score.Staff"]:
r"""
Gets effective staff.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -1679,9 +1679,9 @@ def grace(argument) -> bool:
Grace music defined equal to grace container, after-grace container and
contents of those containers.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -1779,9 +1779,9 @@ def has_effective_indicator(
r"""
Is true when ``argument`` has effective indicator.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -1932,9 +1932,9 @@ def has_indicator(
r"""
Is true when ``argument`` has one or more indicators.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -2130,9 +2130,9 @@ def indicator(
r"""
Gets indicator.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -2281,9 +2281,9 @@ def indicators(
r"""
Get indicators.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -2717,9 +2717,9 @@ def lineage(argument) -> "Lineage":
r"""
Gets lineage.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -2923,9 +2923,9 @@ def logical_tie(argument) -> "_select.LogicalTie":
r"""
Gets logical tie.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -3114,9 +3114,9 @@ def measure_number(argument) -> int:
r"""
Gets measure number.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -3503,9 +3503,9 @@ def pitches(argument) -> set[_pitch.NamedPitch]:
r"""
Gets pitches.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down Expand Up @@ -3763,9 +3763,9 @@ def timespan(argument, in_seconds: bool = False) -> _timespan.Timespan:
r"""
Gets timespan.
.. container:: example
REGRESSION. Works with grace notes (and containers):
REGRESSION. Works with grace notes (and containers):
.. container:: example
>>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice")
>>> container = abjad.BeforeGraceContainer("cs'16")
Expand Down
16 changes: 8 additions & 8 deletions abjad/indicators.py
Expand Up @@ -851,9 +851,9 @@ def to_pitch(self, staff_position) -> _pitch.NamedPitch:
"""
Changes ``staff_position`` to pitch.
.. container:: example
Treble clef:
Treble clef:
.. container:: example
>>> clef = abjad.Clef("treble")
>>> for n in range(-6, 6):
Expand Down Expand Up @@ -962,9 +962,9 @@ def to_staff_position(self, pitch) -> _pitch.StaffPosition:
r"""
Changes ``pitch`` to staff position.
.. container:: example
Changes C#5 to absolute staff position:
Changes C#5 to absolute staff position:
.. container:: example
>>> pitch = abjad.NamedPitch("C#5")
Expand Down Expand Up @@ -2772,9 +2772,9 @@ def duration_to_milliseconds(self, duration) -> _duration.Duration:
"""
Gets millisecond value of ``duration`` under a given metronome mark.
.. container:: example
Dotted sixteenth lasts 1500 msec at quarter equals 60:
Dotted sixteenth lasts 1500 msec at quarter equals 60:
.. container:: example
>>> mark = abjad.MetronomeMark((1, 4), 60)
>>> mark.duration_to_milliseconds((3, 8))
Expand All @@ -2797,9 +2797,9 @@ def make_tempo_equation_markup(
r"""
Makes tempo equation markup.
.. container:: example
Integer-valued metronome mark:
Integer-valued metronome mark:
.. container:: example
>>> markup = abjad.MetronomeMark.make_tempo_equation_markup((1, 4), 90)
>>> lilypond_file = abjad.LilyPondFile([r'\include "abjad.ily"', markup])
Expand Down

0 comments on commit 88ee265

Please sign in to comment.