diff --git a/abjad/contextmanagers.py b/abjad/contextmanagers.py index d9b5d2e92c..6618d62755 100644 --- a/abjad/contextmanagers.py +++ b/abjad/contextmanagers.py @@ -183,11 +183,11 @@ def __enter__(self) -> "ForbidUpdate": r""" Enters context manager. - REGRESSION. Indicators need to be updated after swap; context manager - updates indicators before forbidding further updates: - .. container:: example + REGRESSION. Indicators need to be updated after swap; context + manager updates indicators before forbidding further updates: + >>> staff = abjad.Staff(r"\times 1/1 { c'4 d' }") >>> abjad.attach(abjad.Clef("alto"), staff[0][0]) >>> container = abjad.Container() diff --git a/abjad/cyclictuple.py b/abjad/cyclictuple.py index a121e9d64f..1e1e942e0b 100644 --- a/abjad/cyclictuple.py +++ b/abjad/cyclictuple.py @@ -68,19 +68,19 @@ def __getitem__(self, argument) -> typing.Any: """ Gets item or slice identified by ``argument``. - Gets slice open at right: - .. container:: example + Gets slice open at right: + >>> items = [0, 1, 2, 3, 4, 5] >>> tuple_ = abjad.CyclicTuple(items=items) >>> tuple_[2:] (2, 3, 4, 5) - Gets slice closed at right: - .. container:: example + Gets slice closed at right: + >>> items = [0, 1, 2, 3, 4, 5] >>> tuple_ = abjad.CyclicTuple(items=items) >>> tuple_[:15] diff --git a/abjad/duration.py b/abjad/duration.py index b7207dfe6a..82c607c454 100644 --- a/abjad/duration.py +++ b/abjad/duration.py @@ -283,10 +283,10 @@ def __ne__(self, argument) -> bool: See https://bugs.python.org/issue4395#msg89533. - REGRESSION: - .. container:: example + REGRESSION: + >>> offset_1 = abjad.Offset(1) >>> offset_2 = abjad.Offset(1, displacement=(-1, 16)) @@ -1066,10 +1066,10 @@ def to_clock_string(self) -> str: r""" Changes duration to clock string. - Changes duration to clock string: - .. container:: example + Changes duration to clock string: + >>> note = abjad.Note("c'4") >>> duration = abjad.Duration(117) >>> clock_string = duration.to_clock_string() @@ -1292,10 +1292,10 @@ def __eq__(self, argument) -> bool: """ Is true when offset equals ``argument``. - With equal numerators, denominators and displacement: - .. container:: example + With equal numerators, denominators and displacement: + >>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16)) >>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16)) @@ -1351,10 +1351,10 @@ def __ge__(self, argument) -> bool: """ Is true when offset is greater than or equal to ``argument``. - With equal numerators, denominators and displacement: - .. container:: example + With equal numerators, denominators and displacement: + >>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16)) >>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16)) @@ -1410,10 +1410,10 @@ def __gt__(self, argument) -> bool: """ Is true when offset is greater than ``argument``. - With equal numerators, denominators and displacement: - .. container:: example + With equal numerators, denominators and displacement: + >>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16)) >>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16)) @@ -1475,10 +1475,10 @@ def __le__(self, argument) -> bool: """ Is true when offset is less than or equal to ``argument``. - With equal numerators, denominators and displacement: - .. container:: example + With equal numerators, denominators and displacement: + >>> offset_1 = abjad.Offset((1, 4), displacement=(-1, 16)) >>> offset_2 = abjad.Offset((1, 4), displacement=(-1, 16)) diff --git a/abjad/get.py b/abjad/get.py index c5b8d9dd66..eae5835876 100644 --- a/abjad/get.py +++ b/abjad/get.py @@ -1757,10 +1757,10 @@ def grace(argument) -> bool: Grace music defined equal to grace container, after-grace container and contents of those containers. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, music_voice[1]) @@ -1902,10 +1902,10 @@ def has_effective_indicator( r""" Is true when ``argument`` has effective indicator. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> staff = abjad.Staff([music_voice]) >>> container = abjad.BeforeGraceContainer("cs'16") @@ -2100,10 +2100,10 @@ def has_indicator( r""" Is true when ``argument`` has one or more indicators. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> staff = abjad.Staff([music_voice]) >>> container = abjad.BeforeGraceContainer("cs'16") @@ -2343,10 +2343,10 @@ def indicator( r""" Gets indicator. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> staff = abjad.Staff([music_voice]) >>> container = abjad.BeforeGraceContainer("cs'16") @@ -2494,10 +2494,10 @@ def indicators( r""" Get indicators. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> staff = abjad.Staff([music_voice]) >>> container = abjad.BeforeGraceContainer("cs'16") @@ -2987,10 +2987,10 @@ def lineage(argument) -> "Lineage": r""" Gets lineage. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, music_voice[1]) @@ -3191,10 +3191,10 @@ def logical_tie(argument) -> "_select.LogicalTie": r""" Gets logical tie. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, music_voice[1]) @@ -3383,10 +3383,10 @@ def measure_number(argument) -> int: r""" Gets measure number. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, music_voice[1]) @@ -3880,10 +3880,10 @@ def pitches(argument) -> set[_pitch.NamedPitch]: r""" Gets pitches. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, music_voice[1]) @@ -4138,10 +4138,10 @@ def timespan(argument, in_seconds: bool = False) -> _timespan.Timespan: r""" Gets timespan. - REGRESSION. Works with grace notes (and containers): - .. container:: example + REGRESSION. Works with grace notes (and containers): + >>> music_voice = abjad.Voice("c'4 d' e' f'", name="MusicVoice") >>> container = abjad.BeforeGraceContainer("cs'16") >>> abjad.attach(container, music_voice[1]) diff --git a/abjad/indicators.py b/abjad/indicators.py index 0db0a73b8c..7c5850a9ba 100644 --- a/abjad/indicators.py +++ b/abjad/indicators.py @@ -952,10 +952,10 @@ def to_staff_position(self, pitch) -> _pitch.StaffPosition: r""" Changes ``pitch`` to staff position. - Changes C#5 to absolute staff position: - .. container:: example + Changes C#5 to absolute staff position: + >>> pitch = abjad.NamedPitch("C#5") >>> abjad.Clef("alto").to_staff_position(pitch) diff --git a/abjad/iterate.py b/abjad/iterate.py index 3cb69caf73..85d2de4e5f 100644 --- a/abjad/iterate.py +++ b/abjad/iterate.py @@ -245,10 +245,10 @@ def leaves( r""" Iterates leaves in ``argument``. - Set ``exclude=`` to exclude leaves with annotation: - .. container:: example + Set ``exclude=`` to exclude leaves with annotation: + >>> staff = abjad.Staff() >>> score = abjad.Score([staff], name="Score") >>> staff.extend("8 8") @@ -488,10 +488,10 @@ def logical_ties( r""" Iterates logical ties in ``argument``. - Iterates logical ties: - .. container:: example + Iterates logical ties: + >>> string = r"c'4 ~ \times 2/3 { c'16 d'8 } e'8 f'4 ~ f'16" >>> staff = abjad.Staff(string) >>> abjad.show(staff) # doctest: +SKIP @@ -840,10 +840,10 @@ def pitches(argument) -> typing.Iterator[_pitch.NamedPitch]: r""" Iterates pitches in ``argument``. - Iterates pitches in container: - .. container:: example + Iterates pitches in container: + >>> staff = abjad.Staff("c'8 d'8 e'8 f'8") >>> abjad.show(staff) # doctest: +SKIP @@ -937,10 +937,10 @@ def timeline( r""" Iterates leaves in ``argument`` in timeline order. - Timeline-iterates leaves: - .. container:: example + Timeline-iterates leaves: + >>> score = abjad.Score() >>> score.append(abjad.Staff("c'4 d'4 e'4 f'4")) >>> score.append(abjad.Staff("g'8 a'8 b'8 c''8")) diff --git a/abjad/makers.py b/abjad/makers.py index 08ee27a7e8..d1bdff9d02 100644 --- a/abjad/makers.py +++ b/abjad/makers.py @@ -706,11 +706,11 @@ def make_notes( Set ``durations`` to a single duration or a list of durations. - Cycles through ``pitches`` when the length of ``pitches`` is less than the length - of ``durations``: - .. container:: example + Cycles through ``pitches`` when the length of ``pitches`` is less than + the length of ``durations``: + >>> pitches = [0] >>> durations = [(1, 16), (1, 8), (1, 8)] >>> notes = abjad.makers.make_notes(pitches, durations) @@ -930,10 +930,10 @@ def tuplet_from_duration_and_ratio( r""" Makes tuplet from ``duration`` and ``ratio``. - Makes tupletted leaves strictly without dots when all ``ratio`` equal ``1``: - .. container:: example + Makes tupletted leaves strictly without dots when all ``ratio`` equal ``1``: + >>> tuplet = abjad.makers.tuplet_from_duration_and_ratio( ... abjad.Duration(3, 16), ... (1, 1, 1, -1, -1), diff --git a/abjad/math.py b/abjad/math.py index 5f493dce22..b3f87413a8 100644 --- a/abjad/math.py +++ b/abjad/math.py @@ -583,10 +583,10 @@ def integer_equivalent_number_to_integer(number) -> int | float: """ Changes integer-equivalent ``number`` to integer. - Returns integer-equivalent number as integer: - .. container:: example + Returns integer-equivalent number as integer: + >>> abjad.math.integer_equivalent_number_to_integer(17.0) 17 @@ -608,10 +608,10 @@ def integer_to_base_k_tuple(n, k) -> tuple[int, ...]: """ Changes nonnegative integer ``n`` to base-`k` tuple. - Gets base-10 digits of 1066: - .. container:: example + Gets base-10 digits of 1066: + >>> abjad.math.integer_to_base_k_tuple(1066, 10) (1, 0, 6, 6) @@ -1148,10 +1148,10 @@ def sign(n) -> int: """ Gets sign of ``n``. - Returns -1 on negative ``n``: - .. container:: example + Returns -1 on negative ``n``: + >>> abjad.math.sign(-96.2) -1 diff --git a/abjad/mutate.py b/abjad/mutate.py index f1de4c51d5..99c6398efe 100644 --- a/abjad/mutate.py +++ b/abjad/mutate.py @@ -732,10 +732,10 @@ def copy(argument, n=1) -> list[_score.Component]: r""" Copies argument. - Copies explicit clefs: - .. container:: example + Copies explicit clefs: + >>> staff = abjad.Staff("c'8 cs'8 d'8 ef'8 e'8 f'8 fs'8 g'8") >>> clef = abjad.Clef('treble') >>> abjad.attach(clef, staff[0]) @@ -867,10 +867,10 @@ def eject_contents(container: _score.Container) -> list[_score.Component]: r""" Ejects ``container`` contents. - Ejects leaves from container: - .. container:: example + Ejects leaves from container: + >>> container = abjad.Container("c'4 ~ c'4 d'4 ~ d'4") >>> abjad.show(container) # doctest: +SKIP @@ -1104,10 +1104,10 @@ def fuse(argument) -> _score.Tuplet | list[_score.Leaf]: r""" Fuses ``argument``. - Fuses in-score leaves: - .. container:: example + Fuses in-score leaves: + >>> staff = abjad.Staff("c'8 d'8 e'8 f'8") >>> abjad.show(staff) # doctest: +SKIP @@ -1394,11 +1394,11 @@ def replace(argument, recipients, *, wrappers: bool = False) -> None: r""" Replaces ``argument`` (and contents of ``argument``) with ``recipients``. - Replaces in-score tuplet (and children of tuplet) with notes. Functions - exactly the same as container setitem: - .. container:: example + Replaces in-score tuplet (and children of tuplet) with notes. Functions + exactly the same as container setitem: + >>> tuplet_1 = abjad.Tuplet((2, 3), "c'4 d'4 e'4") >>> tuplet_2 = abjad.Tuplet((2, 3), "d'4 e'4 f'4") >>> voice = abjad.Voice([tuplet_1, tuplet_2]) @@ -1639,10 +1639,10 @@ def scale(argument, multiplier) -> None: r""" Scales ``argument`` by ``multiplier``. - Scales note duration by dot-generating multiplier: - .. container:: example + Scales note duration by dot-generating multiplier: + >>> staff = abjad.Staff("c'8 ( d'8 e'8 f'8 )") >>> abjad.show(staff) # doctest: +SKIP diff --git a/abjad/parentage.py b/abjad/parentage.py index 995f849b26..29e86e7ce9 100644 --- a/abjad/parentage.py +++ b/abjad/parentage.py @@ -766,10 +766,10 @@ def count(self, prototype=None) -> int: r""" Gets number of ``prototype`` in parentage. - Gets tuplet count: - .. container:: example + Gets tuplet count: + >>> staff = abjad.Staff( ... r"\times 2/3 { c'2 \times 2/3 { d'8 e' f' } } \times 2/3 { c'4 d' e' }" ... ) @@ -1254,10 +1254,10 @@ def logical_voice(self) -> dict: r""" Gets logical voice. - Gets logical voice of note: - .. container:: example + Gets logical voice of note: + >>> voice = abjad.Voice("c'4 d'4 e'4 f'4", name="MusicVoice") >>> staff = abjad.Staff([voice], name="Music_Staff") >>> score = abjad.Score([staff], name="Score") diff --git a/abjad/pcollections.py b/abjad/pcollections.py index d7216ea868..cdd9529565 100644 --- a/abjad/pcollections.py +++ b/abjad/pcollections.py @@ -330,10 +330,10 @@ def get_normal_order(self) -> "PitchClassSegment": """ Gets normal order. - Gets normal order of empty pitch-class set: - .. container:: example + Gets normal order of empty pitch-class set: + >>> pc_set = abjad.PitchClassSet() >>> pc_set.get_normal_order() PitchClassSegment([]) @@ -388,10 +388,10 @@ def get_prime_form(self, transposition_only=False) -> "PitchClassSet": """ Gets prime form. - Gets prime form of empty pitch-class set: - .. container:: example + Gets prime form of empty pitch-class set: + >>> pc_set = abjad.PitchClassSet() >>> pc_set.get_prime_form() PitchClassSet([]) @@ -670,10 +670,10 @@ def __contains__(self, argument) -> bool: """ Is true when pitch range contains ``argument``. - Closed / closed range: - .. container:: example + Closed / closed range: + >>> range_ = abjad.PitchRange("[A0, C8]") >>> "C0" in range_ @@ -2373,10 +2373,10 @@ def __mul__(self, argument) -> "PitchClassSegment": r""" Multiplies row by ``argument``. - Multiplies row: - .. container:: example + Multiplies row: + >>> row = abjad.TwelveToneRow() >>> lilypond_file = abjad.illustrate(row) >>> abjad.show(lilypond_file) # doctest: +SKIP @@ -2476,10 +2476,10 @@ def __rmul__(self, argument) -> "PitchClassSegment": r""" Multiplies ``argument`` by row. - Multiplies integer by row: - .. container:: example + Multiplies integer by row: + >>> row = abjad.TwelveToneRow() >>> lilypond_file = abjad.illustrate(row) >>> abjad.show(lilypond_file) # doctest: +SKIP @@ -2590,10 +2590,10 @@ def invert(self, axis=None) -> "TwelveToneRow": r""" Inverts row about optional ``axis``. - Example row: - .. container:: example + Example row: + >>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0] >>> row = abjad.TwelveToneRow(numbers) >>> lilypond_file = abjad.illustrate(row) @@ -2740,10 +2740,10 @@ def multiply(self, n=1) -> "TwelveToneRow": r""" Multiplies pitch-classes in row by ``n``. - Example row: - .. container:: example + Example row: + >>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0] >>> row = abjad.TwelveToneRow(numbers) >>> lilypond_file = abjad.illustrate(row) @@ -2849,10 +2849,10 @@ def retrograde(self) -> "TwelveToneRow": r""" Gets retrograde of row. - Example row: - .. container:: example + Example row: + >>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0] >>> row = abjad.TwelveToneRow(numbers) >>> lilypond_file = abjad.illustrate(row) @@ -2930,10 +2930,10 @@ def rotate(self, n=0) -> "TwelveToneRow": r""" Rotates row by index ``n``. - Example row: - .. container:: example + Example row: + >>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0] >>> row = abjad.TwelveToneRow(numbers) >>> lilypond_file = abjad.illustrate(row) @@ -3042,10 +3042,10 @@ def transpose(self, n=0) -> "TwelveToneRow": r""" Transposes row by index ``n``. - Example row: - .. container:: example + Example row: + >>> numbers = [1, 11, 9, 3, 6, 7, 5, 4, 10, 2, 8, 0] >>> row = abjad.TwelveToneRow(numbers) >>> lilypond_file = abjad.illustrate(row) diff --git a/abjad/pitch.py b/abjad/pitch.py index 6d33cf923b..563d53eb11 100644 --- a/abjad/pitch.py +++ b/abjad/pitch.py @@ -620,7 +620,6 @@ class Accidental: >>> abjad.Accidental("ss").semitones 2 - .. container:: example >>> abjad.Accidental("ff").name @@ -5190,10 +5189,10 @@ def transpose(self, n=0) -> "NamedPitch": """ Transposes named pitch by index ``n``. - Transposes C4 up a minor second: - .. container:: example + Transposes C4 up a minor second: + >>> abjad.NamedPitch("c'").transpose(n="m2") NamedPitch("df'") @@ -5615,10 +5614,10 @@ def interpolate(self, stop_pitch, fraction) -> "NumberedPitch": """ Interpolates between numbered pitch and ``stop_pitch`` by ``fraction``. - Interpolates from C4 to C5: - .. container:: example + Interpolates from C4 to C5: + >>> start_pitch = abjad.NumberedPitch(0) >>> stop_pitch = abjad.NumberedPitch(12) @@ -5677,10 +5676,10 @@ def invert(self, axis=None) -> "NumberedPitch": """ Inverts numbered pitch around ``axis``. - Inverts pitch-class about pitch-class 0 explicitly: - .. container:: example + Inverts pitch-class about pitch-class 0 explicitly: + >>> abjad.NumberedPitch(2).invert(0) NumberedPitch(-2) diff --git a/abjad/rhythmtrees.py b/abjad/rhythmtrees.py index fbbf7ad100..c11527e374 100644 --- a/abjad/rhythmtrees.py +++ b/abjad/rhythmtrees.py @@ -139,12 +139,13 @@ def parentage_ratios(self): A sequence describing the relative durations of the nodes in a node's improper parentage. - The first item in the sequence is the preprolated_duration of the root node, and - subsequent items are pairs of the preprolated duration of the next node in the - parentage and the total preprolated_duration of that node and its siblings: - .. container:: example + The first item in the sequence is the preprolated_duration of the + root node, and subsequent items are pairs of the preprolated + duration of the next node in the parentage and the total + preprolated_duration of that node and its siblings: + >>> a = abjad.rhythmtrees.RhythmTreeContainer(preprolated_duration=abjad.Duration(1)) >>> b = abjad.rhythmtrees.RhythmTreeContainer(preprolated_duration=abjad.Duration(2)) >>> c = abjad.rhythmtrees.RhythmTreeLeaf(preprolated_duration=abjad.Duration(3)) @@ -488,7 +489,7 @@ def __add__(self, argument) -> "RhythmTreeContainer": RhythmTreeContainer c with the content of both a and b, and a preprolated_duration equal to the sum of the durations of a and b. The operation is non-commutative: the content of the first operand will be placed before the - content of the second operand: + content of the second operand. .. container:: example @@ -901,10 +902,10 @@ def parse_rtm_syntax(string: str) -> _score.Container | _score.Leaf | _score.Tup Creates rhythm tree from RTM ``string``; then calls rhythm tree on quarter-note pulse duration. - A single quarter note: - .. container:: example + A single quarter note: + >>> result = abjad.rhythmtrees.parse_rtm_syntax("1") >>> result Note("c'4") diff --git a/abjad/score.py b/abjad/score.py index a8de5a34c6..9a3591e001 100644 --- a/abjad/score.py +++ b/abjad/score.py @@ -875,10 +875,10 @@ def __delitem__(self, i) -> None: r""" Deletes components(s) at index ``i`` in container. - Deletes first tuplet in voice: - .. container:: example + Deletes first tuplet in voice: + >>> voice = abjad.Voice() >>> voice.append(abjad.Tuplet((4, 6), "c'4 d'4 e'4")) >>> voice.append(abjad.Tuplet((2, 3), "e'4 d'4 c'4")) @@ -1554,10 +1554,10 @@ def append(self, component: Component, *, language: str = "english") -> None: r""" Appends ``component`` to container. - Appends note to container: - .. container:: example + Appends note to container: + >>> container = abjad.Container("c'4 ( d'4 f'4 )") >>> abjad.show(container) # doctest: +SKIP @@ -1601,10 +1601,10 @@ def extend(self, argument, *, language: str = "english") -> None: r""" Extends container with ``argument``. - Extends container with three notes: - .. container:: example + Extends container with three notes: + >>> container = abjad.Container("c'4 ( d'4 f'4 )") >>> abjad.show(container) # doctest: +SKIP @@ -1651,10 +1651,10 @@ def index(self, component) -> int: r""" Returns index of ``component`` in container. - Gets index of last element in container: - .. container:: example + Gets index of last element in container: + >>> container = abjad.Container("c'4 d'4 f'4 e'4") >>> abjad.show(container) # doctest: +SKIP @@ -1689,10 +1689,10 @@ def insert( r""" Inserts ``component`` at index ``i`` in container. - Inserts note. - .. container:: example + Inserts note: + >>> container = abjad.Container([]) >>> container.extend("fs16 cs' e' a'") >>> container.extend("cs''16 e'' cs'' a'") @@ -1755,10 +1755,10 @@ def pop(self, i: int = -1) -> Component: r""" Pops component from container at index ``i``. - Pops last element from container: - .. container:: example + Pops last element from container: + >>> container = abjad.Container("c'4 ( d'4 f'4 ) e'4") >>> abjad.show(container) # doctest: +SKIP @@ -1801,10 +1801,10 @@ def remove(self, component: Component) -> None: r""" Removes ``component`` from container. - Removes note from container: - .. container:: example + Removes note from container: + >>> container = abjad.Container("c'4 d'4 f'4 e'4") >>> abjad.show(container) # doctest: +SKIP @@ -4058,10 +4058,10 @@ def get(self, pitch) -> NoteHead: r""" Gets note-head by ``pitch``. - Gets note-head by pitch name: - .. container:: example + Gets note-head by pitch name: + >>> chord = abjad.Chord("4") >>> abjad.show(chord) # doctest: +SKIP @@ -5932,10 +5932,10 @@ def append( r""" Appends ``component`` to tuplet. - Appends note to tuplet: - .. container:: example + Appends note to tuplet: + >>> tuplet = abjad.Tuplet((2, 3), "c'4 ( d'4 f'4 )") >>> abjad.show(tuplet) # doctest: +SKIP @@ -6021,10 +6021,10 @@ def augmentation(self) -> bool: r""" Is true when tuplet multiplier is greater than ``1``. - Augmented tuplet: - .. container:: example + Augmented tuplet: + >>> tuplet = abjad.Tuplet((4, 3), "c'8 d'8 e'8") >>> abjad.show(tuplet) # doctest: +SKIP @@ -6061,10 +6061,10 @@ def diminution(self) -> bool: r""" Is true when tuplet multiplier is less than ``1``. - Augmented tuplet: - .. container:: example + Augmented tuplet: + >>> tuplet = abjad.Tuplet((4, 3), "c'8 d'8 e'8") >>> abjad.show(tuplet) # doctest: +SKIP @@ -6103,10 +6103,10 @@ def extend( r""" Extends tuplet with ``argument``. - Extends tuplet with three notes: - .. container:: example + Extends tuplet with three notes: + >>> tuplet = abjad.Tuplet((2, 3), "c'4 ( d'4 f'4 )") >>> abjad.show(tuplet) # doctest: +SKIP @@ -6201,10 +6201,10 @@ def from_duration( r""" Makes tuplet from ``duration`` and ``components``. - Makes diminution: - .. container:: example + Makes diminution: + >>> tuplet = abjad.Tuplet.from_duration((2, 8), "c'8 d' e'") >>> abjad.show(tuplet) # doctest: +SKIP @@ -6394,10 +6394,10 @@ def rewrite_dots(self) -> None: r""" Rewrites dots. - Rewrites single dots as 3:2 prolation: - .. container:: example + Rewrites single dots as 3:2 prolation: + >>> tuplet = abjad.Tuplet((1, 1), "c'8. c'8.") >>> abjad.show(tuplet) # doctest: +SKIP @@ -6551,10 +6551,10 @@ def set_minimum_denominator(self, denominator) -> None: r""" Sets preferred denominator of tuplet to at least ``denominator``. - Sets preferred denominator of tuplet to ``8`` at least: - .. container:: example + Sets preferred denominator of tuplet to ``8`` at least: + >>> tuplet = abjad.Tuplet((3, 5), "c'4 d'8 e'8 f'4 g'2") >>> abjad.show(tuplet) # doctest: +SKIP @@ -6604,10 +6604,10 @@ def toggle_prolation(self) -> None: r""" Changes augmented tuplets to diminished; changes diminished tuplets to augmented. - Changes augmented tuplet to diminished: - .. container:: example + Changes augmented tuplet to diminished: + >>> tuplet = abjad.Tuplet((4, 3), "c'8 d'8 e'8") >>> abjad.show(tuplet) # doctest: +SKIP diff --git a/abjad/select.py b/abjad/select.py index 027bb31268..700db90429 100644 --- a/abjad/select.py +++ b/abjad/select.py @@ -254,10 +254,10 @@ def chord( r""" Selects chord ``n`` in ``argument``. - Selects chord -1: - .. container:: example + Selects chord -1: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -344,10 +344,10 @@ def chords( r""" Selects chords in ``argument``. - Selects chords: - .. container:: example + Selects chords: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -462,10 +462,10 @@ def components( r""" Selects components. - Selects notes: - .. container:: example + Selects notes: + >>> staff = abjad.Staff("c'4 d'8 ~ d'16 e'16 ~ e'8 r4 g'8") >>> abjad.setting(staff).autoBeaming = False @@ -840,10 +840,10 @@ def exclude(argument, indices: typing.Sequence[int], period: int | None = None) r""" Excludes items at ``indices`` by ``period``. - Excludes every other leaf: - .. container:: example + Excludes every other leaf: + >>> string = r"c'8 d'8 ~ d'8 e'8 ~ e'8 ~ e'8 r8 f'8" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -995,10 +995,10 @@ def filter(argument, predicate=None) -> list: r""" Filters ``argument`` by ``predicate``. - Selects runs with duration equal to 2/8: - .. container:: example + Selects runs with duration equal to 2/8: + >>> staff = abjad.Staff("c'8 r8 d'8 e'8 r8 f'8 g'8 a'8") >>> abjad.setting(staff).autoBeaming = False @@ -1048,10 +1048,10 @@ def flatten(argument, depth: int = 1) -> list: r""" Flattens ``argument``. - Selects first two leaves of each tuplet: - .. container:: example + Selects first two leaves of each tuplet: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -1245,10 +1245,10 @@ def get( r""" Gets items in ``argument`` at ``indices`` according to ``period``. - Gets every other leaf: - .. container:: example + Gets every other leaf: + >>> string = r"c'8 d'8 ~ d'8 e'8 ~ e'8 ~ e'8 r8 f'8" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -1472,10 +1472,10 @@ def group_by(argument, predicate=None) -> list[list]: r''' Groups items in ``argument`` by ``predicate``. - Wraps selection in selection when ``predicate`` is none: - .. container:: example + Wraps selection in selection when ``predicate`` is none: + >>> staff = abjad.Staff(r""" ... c'8 ~ c'16 c'16 r8 c'16 c'16 ... d'8 ~ d'16 d'16 r8 d'16 d'16 @@ -1546,10 +1546,10 @@ def group_by_contiguity(argument) -> list[list]: r''' Groups items in ``argument`` by contiguity. - Groups pitched leaves by contiguity: - .. container:: example + Groups pitched leaves by contiguity: + >>> string = r"c'8 d' r \times 2/3 { e' r f' } g' a' r" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -1853,10 +1853,10 @@ def group_by_duration(argument) -> list[list]: r""" Groups items in ``argument`` by duration. - Groups logical ties by duration: - .. container:: example + Groups logical ties by duration: + >>> string = "c'4 ~ c'16 d' ~ d' d' e'4 ~ e'16 f' ~ f' f'" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -1925,10 +1925,10 @@ def group_by_length(argument) -> list[list]: r""" Groups items in ``argument`` by length. - Groups logical ties by length: - .. container:: example + Groups logical ties by length: + >>> string = "c'4 ~ c'16 d' ~ d' d' e'4 ~ e'16 f' ~ f' f'" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -1997,10 +1997,10 @@ def group_by_measure(argument) -> list[list]: r""" Groups items in ``argument`` by measure. - Groups leaves by measure: - .. container:: example + Groups leaves by measure: + >>> staff = abjad.Staff("c'8 d' e' f' g' a' b' c''") >>> score = abjad.Score([staff], name="Score") >>> abjad.setting(staff).autoBeaming = False @@ -2364,10 +2364,10 @@ def group_by_pitch(argument) -> list[list]: r""" Groups items in ``argument`` by pitch. - Groups logical ties by pitches: - .. container:: example + Groups logical ties by pitches: + >>> string = "c'4 ~ c'16 d' ~ d' d' e'4 ~ e'16 f' ~ f' f'" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -2447,10 +2447,10 @@ def leaf( r""" Selects leaf ``n` in ``argument``. - Selects leaf -1: - .. container:: example + Selects leaf -1: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -3679,10 +3679,10 @@ def logical_ties( r''' Selects logical ties in ``argument``. - Selects logical ties: - .. container:: example + Selects logical ties: + >>> staff = abjad.Staff("c'8 d' ~ { d' e' r f'~ } f' r") >>> abjad.setting(staff).autoBeaming = False @@ -4301,10 +4301,10 @@ def nontrivial(argument) -> list: r""" Selects nontrivial items in ``argument``. - Selects nontrivial runs: - .. container:: example + Selects nontrivial runs: + >>> staff = abjad.Staff("c'8 r8 d'8 e'8 r8 f'8 g'8 a'8") >>> abjad.setting(staff).autoBeaming = False @@ -4360,10 +4360,10 @@ def note( r""" Selects note ``n`` in ``argument``. - Selects note -1: - .. container:: example + Selects note -1: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -4450,10 +4450,10 @@ def notes( r""" Selects notes in ``argument``. - Selects notes: - .. container:: example + Selects notes: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -4563,10 +4563,10 @@ def partition_by_counts( r""" Partitions items in ``argument`` by ``counts``. - Partitions leaves into a single part of length 3; truncates overhang: - .. container:: example + Partitions leaves into a single part of length 3; truncates overhang: + >>> staff = abjad.Staff("c'8 r8 d'8 e'8 r8 f'8 g'8 a'8") >>> abjad.setting(staff).autoBeaming = False @@ -5044,11 +5044,11 @@ def partition_by_durations( r""" Partitions items in ``argument`` by ``durations``. - Cyclically partitions leaves into parts equal to exactly 3/8; returns - overhang at end: - .. container:: example + Cyclically partitions leaves into parts equal to exactly 3/8; returns + overhang at end: + >>> staff = abjad.Staff([ ... abjad.Container("c'8 d'"), ... abjad.Container("e'8 f'"), @@ -5910,10 +5910,10 @@ def partition_by_ratio(argument, ratio: tuple[int, ...]) -> list[list]: r""" Partitions items in ``argument`` by ``ratio``. - Partitions leaves by a ratio of 1:1: - .. container:: example + Partitions leaves by a ratio of 1:1: + >>> string = r"c'8 d' r \times 2/3 { e' r f' } g' a' r" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -6035,10 +6035,10 @@ def rest( r""" Selects rest ``n`` in ``argument``. - Selects rest -1: - .. container:: example + Selects rest -1: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -6125,10 +6125,10 @@ def rests( r""" Selects rests in ``argument``. - Selects rests: - .. container:: example + Selects rests: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -6226,10 +6226,10 @@ def run( r""" Selects run ``n`` in ``argument``. - Selects run -1: - .. container:: example + Selects run -1: + >>> tuplets = [ ... "r16 c'16 c'16 c'16 4 ~ 16", ... "r16 d'16 d'16 d'16 4 ~ 16", @@ -6320,10 +6320,10 @@ def runs( r""" Selects runs in ``argument``. - Selects runs: - .. container:: example + Selects runs: + >>> tuplets = [ ... "r16 c'16 c'16 c'16 4 ~ 16", ... "r16 d'16 d'16 d'16 4 ~ 16", @@ -6520,10 +6520,10 @@ def top(argument, *, exclude: _typings.Exclude | None = None) -> list[_score.Com r""" Selects top components in ``argument``. - Selects top components (up from leaves): - .. container:: example + Selects top components (up from leaves): + >>> string = r"c'8 d' r \times 2/3 { e' r f' } g' a' r" >>> staff = abjad.Staff(string) >>> abjad.setting(staff).autoBeaming = False @@ -6600,10 +6600,10 @@ def tuplet( r""" Selects tuplet ``n`` in ``argument``. - Selects tuplet -1: - .. container:: example + Selects tuplet -1: + >>> tuplets = [ ... "r16 bf'16 16 c'16 4 ~ 16", ... "r16 bf'16 16 d'16 4 ~ 16", @@ -6695,10 +6695,10 @@ def tuplets( r""" Selects tuplets in ``argument``. - Selects tuplets at every level: - .. container:: example + Selects tuplets at every level: + >>> staff = abjad.Staff( ... r"\times 2/3 { c'2 \times 2/3 { d'8 e' f' } } \times 2/3 { c'4 d' e' }" ... ) @@ -6882,10 +6882,10 @@ def with_next_leaf(argument, *, grace: bool | None = None) -> list[_score.Leaf]: r""" Extends ``argument`` with next leaf. - Selects runs (each with next leaf): - .. container:: example + Selects runs (each with next leaf): + >>> staff = abjad.Staff("c'8 r8 d'8 e'8 r8 f'8 g'8 a'8") >>> abjad.setting(staff).autoBeaming = False @@ -7250,10 +7250,10 @@ def with_previous_leaf(argument) -> list[_score.Leaf]: r""" Extends ``argument`` with previous leaf. - Selects runs (each with previous leaf): - .. container:: example + Selects runs (each with previous leaf): + >>> staff = abjad.Staff("c'8 r8 d'8 e'8 r8 f'8 g'8 a'8") >>> abjad.setting(staff).autoBeaming = False diff --git a/abjad/sequence.py b/abjad/sequence.py index fdfc5ee122..23ad95bea4 100644 --- a/abjad/sequence.py +++ b/abjad/sequence.py @@ -1105,10 +1105,10 @@ def split( r""" Splits ``sequence`` by ``weights``. - Splits sequence cyclically by weights with overhang: - .. container:: example + Splits sequence cyclically by weights with overhang: + >>> sequence = list([10, -10, 10, -10]) >>> for part in abjad.sequence.split( diff --git a/abjad/setclass.py b/abjad/setclass.py index 3447cd59c3..422ff9d2f3 100644 --- a/abjad/setclass.py +++ b/abjad/setclass.py @@ -1037,10 +1037,10 @@ def __str__(self) -> str: """ Gets string representation. - Gets string of SG2 set-class with Forte rank: - .. container:: example + Gets string of SG2 set-class with Forte rank: + >>> set_class = abjad.SetClass(4, 29) >>> print(set_class) SC(4-29){0, 1, 3, 7} diff --git a/abjad/spanners.py b/abjad/spanners.py index e0cbba1014..4949108b41 100644 --- a/abjad/spanners.py +++ b/abjad/spanners.py @@ -1218,10 +1218,10 @@ def hairpin( r""" Attaches hairpin indicators. - With three-part string descriptor: - .. container:: example + With three-part string descriptor: + >>> voice = abjad.Voice("c'4 d' e' f'") >>> abjad.hairpin("p < f", voice[:], direction=abjad.UP) >>> abjad.override(voice[0]).DynamicLineSpanner.staff_padding = 4 @@ -1661,10 +1661,10 @@ def text_spanner( r""" Attaches text span indicators. - Single spanner: - .. container:: example + Single spanner: + >>> voice = abjad.Voice("c'4 d' e' f'") >>> start_text_span = abjad.StartTextSpan( ... left_text=abjad.Markup(r"\upright pont."), diff --git a/abjad/string.py b/abjad/string.py index f441cd27a3..b69d42940f 100644 --- a/abjad/string.py +++ b/abjad/string.py @@ -9,10 +9,10 @@ def capitalize_start(string: str) -> str: """ Capitalizes start of string. - Capitalizes only ``string[0]``; leaves noninitial characters unchanged: - .. container:: example + Capitalizes only ``string[0]``; leaves noninitial characters unchanged: + >>> abjad.string.capitalize_start("violin I") 'Violin I' diff --git a/abjad/tag.py b/abjad/tag.py index 4cd2c32e96..be63148b35 100644 --- a/abjad/tag.py +++ b/abjad/tag.py @@ -248,10 +248,10 @@ def activate(text: str, tag: Tag | typing.Callable) -> tuple[str, int, int]: r""" Activates ``tag`` in ``text``. - Writes (deactivated) tag with ``"%@%"`` prefix into LilyPond input: - .. container:: example + Writes (deactivated) tag with ``"%@%"`` prefix into LilyPond input: + >>> staff = abjad.Staff("c'4 d' e' f'") >>> markup = abjad.Markup(r"\markup { \with-color #red Allegro }") >>> abjad.attach( @@ -399,10 +399,10 @@ def deactivate( r""" Deactivates ``tag`` in ``text``. - Writes (active) tag into LilyPond input: - .. container:: example + Writes (active) tag into LilyPond input: + >>> staff = abjad.Staff("c'4 d' e' f'") >>> string = r"\markup { \with-color #red Allegro }" >>> markup = abjad.Markup(string) diff --git a/abjad/timespan.py b/abjad/timespan.py index 7f4f9d13b7..f33e955b85 100644 --- a/abjad/timespan.py +++ b/abjad/timespan.py @@ -309,10 +309,10 @@ def __contains__(self, argument) -> bool: """ Is true when timespan contains ``argument``. - Works with offsets: - .. container:: example + Works with offsets: + >>> timespan = abjad.Timespan(0, (1, 4)) >>> -1 in timespan @@ -1011,10 +1011,10 @@ def reflect(self, axis=None) -> "Timespan": """ Reflects timespan about ``axis``. - Reverse timespan about timespan axis: - .. container:: example + Reverse timespan about timespan axis: + >>> abjad.Timespan(3, 6).reflect() Timespan(Offset((3, 1)), Offset((6, 1))) @@ -1081,6 +1081,8 @@ def scale(self, multiplier, anchor=_enums.LEFT) -> "Timespan": """ Scales timespan by ``multiplier``. + .. container:: example + >>> timespan = abjad.Timespan(3, 6) .. container:: example @@ -1176,7 +1178,7 @@ def set_offsets(self, start_offset=None, stop_offset=None) -> "Timespan": def split_at_offset(self, offset) -> "TimespanList": """ - Split into two parts when ``offset`` happens during timespan: + Split into two parts when ``offset`` happens during timespan. .. container:: example @@ -1213,7 +1215,7 @@ def split_at_offset(self, offset) -> "TimespanList": def split_at_offsets(self, offsets) -> "TimespanList": """ - Split into one or more parts when ``offsets`` happens during timespan: + Split into one or more parts when ``offsets`` happens during timespan. .. container:: example @@ -1252,10 +1254,10 @@ def stretch(self, multiplier, anchor=None) -> "Timespan": """ Stretches timespan by ``multiplier`` relative to ``anchor``. - Stretch relative to timespan start offset: - .. container:: example + Stretch relative to timespan start offset: + >>> abjad.Timespan(3, 10).stretch(abjad.Fraction(2)) Timespan(Offset((3, 1)), Offset((17, 1))) @@ -1448,10 +1450,10 @@ def __and__(self, timespan) -> "TimespanList": """ Keeps material that intersects ``timespan``. - Keeps material that intersects timespan: - .. container:: example + Keeps material that intersects timespan: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 16), ... abjad.Timespan(5, 12), @@ -1811,10 +1813,10 @@ def __invert__(self) -> "TimespanList": """ Inverts timespans. - Inverts timespans: - .. container:: example + Inverts timespans: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(-2, 8), ... abjad.Timespan(15, 20), @@ -1828,7 +1830,6 @@ def __invert__(self) -> "TimespanList": Timespan(Offset((8, 1)), Offset((15, 1))) Timespan(Offset((20, 1)), Offset((24, 1))) - .. container:: example Inverts contiguous timespans: @@ -1854,10 +1855,10 @@ def __sub__(self, timespan) -> "TimespanList": """ Deletes material that intersects ``timespan``. - Deletes material that intersects timespan: - .. container:: example + Deletes material that intersects timespan: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 16), ... abjad.Timespan(5, 12), @@ -2367,10 +2368,10 @@ def clip_timespan_durations( """ Clips timespan durations. - Clips timespan durations: - .. container:: example + Clips timespan durations: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 1), ... abjad.Timespan(0, 10), @@ -2384,7 +2385,6 @@ def clip_timespan_durations( Timespan(Offset((0, 1)), Offset((5, 1))) Timespan(Offset((0, 1)), Offset((10, 1))) - .. container:: example Clips timespan durations: @@ -2402,7 +2402,6 @@ def clip_timespan_durations( Timespan(Offset((0, 1)), Offset((1, 1))) Timespan(Offset((0, 1)), Offset((5, 1))) - .. container:: example Clips timespan durations: @@ -2423,7 +2422,6 @@ def clip_timespan_durations( Timespan(Offset((0, 1)), Offset((3, 1))) Timespan(Offset((0, 1)), Offset((7, 1))) - .. container:: example Clips timespan durations: @@ -2485,10 +2483,10 @@ def compute_logical_and(self) -> "TimespanList": """ Computes logical AND of timespans. - Computes logical AND: - .. container:: example + Computes logical AND: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 10), ... ]) @@ -2500,7 +2498,6 @@ def compute_logical_and(self) -> "TimespanList": >>> for _ in timespans: _ Timespan(Offset((0, 1)), Offset((10, 1))) - .. container:: example Computes logical AND: @@ -2517,7 +2514,6 @@ def compute_logical_and(self) -> "TimespanList": >>> for _ in timespans: _ Timespan(Offset((5, 1)), Offset((10, 1))) - .. container:: example Computes logical AND: @@ -2760,10 +2756,10 @@ def compute_overlap_factor(self, timespan=None) -> fractions.Fraction: """ Computes overlap factor of timespans. - Example timespan list: - .. container:: example + Example timespan list: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 10), ... abjad.Timespan(5, 15), @@ -2983,10 +2979,10 @@ def explode(self, inventory_count=None) -> tuple["TimespanList", ...]: Explodes timespans into timespan lists, avoiding overlap, and distributing density as evenly as possible. - Example timespan list: - .. container:: example + Example timespan list: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 3), ... abjad.Timespan(5, 13), @@ -3317,10 +3313,10 @@ def reflect(self, axis=None) -> "TimespanList": """ Reflects timespans. - Reflects timespans about timespan list axis: - .. container:: example + Reflects timespans about timespan list axis: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 3), ... abjad.Timespan(3, 6), @@ -3437,10 +3433,10 @@ def rotate(self, count) -> "TimespanList": """ Rotates by ``count`` contiguous timespans. - Rotates by one timespan to the left: - .. container:: example + Rotates by one timespan to the left: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 3), ... abjad.Timespan(3, 4), @@ -3601,10 +3597,10 @@ def scale(self, multiplier, anchor=_enums.LEFT) -> "TimespanList": """ Scales timespan by ``multiplier`` relative to ``anchor``. - Scales timespans relative to timespan list start offset: - .. container:: example + Scales timespans relative to timespan list start offset: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 3), ... abjad.Timespan(3, 6), @@ -3833,10 +3829,10 @@ def translate(self, translation=None) -> "TimespanList": """ Translates timespans by ``translation``. - Translates timespan by offset ``50``: - .. container:: example + Translates timespan by offset ``50``: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 3), ... abjad.Timespan(3, 6), @@ -3863,10 +3859,10 @@ def translate_offsets( Translates timespans by ``start_offset_translation`` and ``stop_offset_translation``. - Translates timespan start- and stop-offsets equally: - .. container:: example + Translates timespan start- and stop-offsets equally: + >>> timespans = abjad.TimespanList([ ... abjad.Timespan(0, 3), ... abjad.Timespan(3, 6), diff --git a/abjad/tweaks.py b/abjad/tweaks.py index bb2719332c..8bba6366dd 100644 --- a/abjad/tweaks.py +++ b/abjad/tweaks.py @@ -181,10 +181,10 @@ def bundle( r""" Bundles ``indicator`` with ``tweaks``. - Bundles indicator: - .. container:: example + Bundles indicator: + >>> staff = abjad.Staff("c'4 d' e' f'") >>> bundle = abjad.bundle( ... abjad.Articulation("."), diff --git a/abjad/wf.py b/abjad/wf.py index db8ce7a26c..e5fa44e26d 100644 --- a/abjad/wf.py +++ b/abjad/wf.py @@ -32,10 +32,10 @@ def check_beamed_lone_notes(argument) -> tuple[list, int]: r""" Checks beamed lone notes. - Beamed single notes are not wellformed: - .. container:: example + Beamed single notes are not wellformed: + >>> voice = abjad.Voice("c'8 d' e' f'") >>> abjad.attach(abjad.StartBeam(), voice[0]) >>> abjad.attach(abjad.StopBeam(), voice[0]) @@ -74,10 +74,10 @@ def check_beamed_long_notes(argument) -> tuple[list, int]: r""" Checks beamed long notes. - Beamed quarter notes are not wellformed: - .. container:: example + Beamed quarter notes are not wellformed: + >>> voice = abjad.Voice("c'4 d'4 e'4 f'4") >>> abjad.attach(abjad.StartBeam(), voice[0]) >>> abjad.attach(abjad.StopBeam(), voice[1]) @@ -348,10 +348,10 @@ def check_out_of_range_pitches( r""" Checks out-of-range notes. - Out of range: - .. container:: example + Out of range: + >>> staff = abjad.Staff("c'8 r8 8 r8") >>> violin = abjad.Violin() >>> abjad.attach(violin, staff[0]) @@ -657,10 +657,10 @@ def check_unmatched_stop_text_spans(argument) -> tuple[list, int]: r""" Checks unmatched stop text spans. - Unmatched stop text span is not wellformed: - .. container:: example + Unmatched stop text span is not wellformed: + >>> voice = abjad.Voice("c'4 c'4 c'4 c'4") >>> stop_text_span = abjad.StopTextSpan() >>> abjad.attach(stop_text_span, voice[-1]) @@ -734,10 +734,10 @@ def check_unterminated_hairpins(argument) -> tuple[list, int]: r""" Checks unterminated hairpins. - Unterminated crescendo is not wellformed: - .. container:: example + Unterminated crescendo is not wellformed: + >>> voice = abjad.Voice("c'4 c'4 c'4 c'4") >>> start_hairpin = abjad.StartHairpin('<') >>> abjad.attach(start_hairpin, voice[0]) @@ -859,10 +859,10 @@ def check_unterminated_text_spanners(argument) -> tuple[list, int]: r""" Checks unterminated text spanners. - Unterminated text spanner is not wellformed: - .. container:: example + Unterminated text spanner is not wellformed: + >>> voice = abjad.Voice("c'4 c'4 c'4 c'4") >>> start_text_span = abjad.StartTextSpan() >>> abjad.attach(start_text_span, voice[0])