Skip to content

Commit

Permalink
Removed selector=None keyword from abjad.spanners.* functions.
Browse files Browse the repository at this point in the history
Closes #1589.
  • Loading branch information
trevorbaca committed Oct 8, 2024
1 parent 0737478 commit 7c95102
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions abjad/spanners.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def beam(
beam_rests: bool | None = True,
direction: _enums.Vertical | None = None,
durations: typing.Sequence[_duration.Duration] | None = None,
selector: typing.Callable = lambda _: _select.leaves(_),
span_beam_count: int | None = None,
start_beam: _indicators.StartBeam | None = None,
stemlet_length: int | float | None = None,
Expand Down Expand Up @@ -141,8 +140,6 @@ def beam(
}
"""
assert callable(selector)
argument = selector(argument)
original_leaves = list(_iterate.leaves(argument))
silent_prototype = (_score.MultimeasureRest, _score.Rest, _score.Skip)

Expand Down Expand Up @@ -320,7 +317,6 @@ def glissando(
allow_ties: bool = False,
hide_middle_note_heads: bool = False,
hide_middle_stems: bool = False,
hide_stem_selector: typing.Callable | None = None,
left_broken: bool = False,
parenthesize_repeats: bool = False,
right_broken: bool = False,
Expand Down Expand Up @@ -1073,10 +1069,6 @@ def _previous_leaf_changes_current_pitch(leaf):
return False
return True

should_hide_stem = []
if hide_stem_selector is not None:
should_hide_stem = hide_stem_selector(argument)

leaves = _select.leaves(argument)
total = len(leaves) - 1
for i, leaf in enumerate(leaves):
Expand Down Expand Up @@ -1105,13 +1097,6 @@ def _previous_leaf_changes_current_pitch(leaf):
if _next_leaf_changes_current_pitch(leaf):
if _is_last_in_tie_chain(leaf):
should_attach_glissando = True
if leaf in should_hide_stem:
strings = [
r"\once \override Dots.transparent = ##t",
r"\once \override Stem.transparent = ##t",
]
literal = _indicators.LilyPondLiteral(strings, site="before")
_bind.attach(literal, leaf, tag=tag.append(_tag.Tag("abjad.glissando(-1)")))
if hide_middle_note_heads and 3 <= len(leaves):
if leaf is not leaves[0]:
should_attach_glissando = False
Expand Down Expand Up @@ -1228,7 +1213,6 @@ def hairpin(
argument: _score.Component | typing.Sequence[_score.Component],
*,
direction: _enums.Vertical | None = None,
selector: typing.Callable = lambda _: _select.leaves(_),
tag: _tag.Tag | None = None,
) -> None:
r"""
Expand Down Expand Up @@ -1367,8 +1351,6 @@ def hairpin(
if start_dynamic is not None:
assert isinstance(start_dynamic, _indicators.Dynamic), repr(start_dynamic)

assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand All @@ -1384,7 +1366,6 @@ def hairpin(
def horizontal_bracket(
argument: _score.Component | typing.Sequence[_score.Component],
*,
selector: typing.Callable = lambda _: _select.leaves(_),
start_group: _indicators.StartGroup | None = None,
stop_group: _indicators.StopGroup | None = None,
tag: _tag.Tag | None = None,
Expand Down Expand Up @@ -1415,8 +1396,6 @@ def horizontal_bracket(
"""
start_group = start_group or _indicators.StartGroup()
stop_group = stop_group or _indicators.StopGroup()
assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand All @@ -1427,7 +1406,6 @@ def horizontal_bracket(
def ottava(
argument: _score.Component | typing.Sequence[_score.Component],
*,
selector: typing.Callable = lambda _: _select.leaves(_),
start_ottava: _indicators.Ottava = _indicators.Ottava(n=1),
stop_ottava: _indicators.Ottava = _indicators.Ottava(n=0, site="after"),
tag: _tag.Tag | None = None,
Expand Down Expand Up @@ -1458,8 +1436,6 @@ def ottava(
"""
assert isinstance(start_ottava, _indicators.Ottava), repr(start_ottava)
assert isinstance(stop_ottava, _indicators.Ottava), repr(stop_ottava)
assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand All @@ -1471,7 +1447,6 @@ def phrasing_slur(
argument: _score.Component | typing.Sequence[_score.Component],
*,
direction: _enums.Vertical | None = None,
selector: typing.Callable = lambda _: _select.leaves(_),
start_phrasing_slur: _indicators.StartPhrasingSlur | None = None,
stop_phrasing_slur: _indicators.StopPhrasingSlur | None = None,
tag: _tag.Tag | None = None,
Expand Down Expand Up @@ -1503,8 +1478,6 @@ def phrasing_slur(
"""
start_phrasing_slur = _indicators.StartPhrasingSlur()
stop_phrasing_slur = _indicators.StopPhrasingSlur()
assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand All @@ -1518,7 +1491,6 @@ def piano_pedal(
argument: _score.Component | typing.Sequence[_score.Component],
*,
context: str | None = None,
selector: typing.Callable = lambda _: _select.leaves(_),
start_piano_pedal: _indicators.StartPianoPedal | None = None,
stop_piano_pedal: _indicators.StopPianoPedal | None = None,
tag: _tag.Tag | None = None,
Expand Down Expand Up @@ -1556,8 +1528,6 @@ def piano_pedal(
"""
start_piano_pedal = start_piano_pedal or _indicators.StartPianoPedal()
stop_piano_pedal = stop_piano_pedal or _indicators.StopPianoPedal()
assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand All @@ -1569,7 +1539,6 @@ def slur(
argument: _score.Component | typing.Sequence[_score.Component],
*,
direction: _enums.Vertical | None = None,
selector: typing.Callable = lambda _: _select.leaves(_),
start_slur: _indicators.StartSlur | None = None,
stop_slur: _indicators.StopSlur | None = None,
tag: _tag.Tag | None = None,
Expand Down Expand Up @@ -1601,8 +1570,6 @@ def slur(
"""
start_slur = start_slur or _indicators.StartSlur()
stop_slur = stop_slur or _indicators.StopSlur()
assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand All @@ -1614,7 +1581,6 @@ def text_spanner(
argument: _score.Component | typing.Sequence[_score.Component],
*,
direction: _enums.Vertical | None = None,
selector: typing.Callable = lambda _: _select.leaves(_),
start_text_span: _indicators.StartTextSpan | None = None,
stop_text_span: _indicators.StopTextSpan | None = None,
tag: _tag.Tag | None = None,
Expand Down Expand Up @@ -1746,8 +1712,6 @@ def text_spanner(
"""
start_text_span = start_text_span or _indicators.StartTextSpan()
stop_text_span = stop_text_span or _indicators.StopTextSpan()
assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand All @@ -1760,7 +1724,6 @@ def tie(
*,
direction: _enums.Vertical | None = None,
repeat: bool | tuple[int, int] | typing.Callable = False,
selector: typing.Callable = lambda _: _select.leaves(_),
tag: _tag.Tag | None = None,
) -> None:
r"""
Expand Down Expand Up @@ -1964,8 +1927,6 @@ def inequality(item):
def inequality(item):
return item >= _duration.Duration(repeat)

assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
if len(leaves) < 2:
raise Exception(f"must be two or more notes (not {leaves!r}).")
Expand All @@ -1989,7 +1950,6 @@ def inequality(item):
def trill_spanner(
argument: _score.Component | typing.Sequence[_score.Component],
*,
selector: typing.Callable = lambda _: _select.leaves(_),
start_trill_span: _indicators.StartTrillSpan | None = None,
stop_trill_span: _indicators.StopTrillSpan | None = None,
tag: _tag.Tag | None = None,
Expand Down Expand Up @@ -2020,8 +1980,6 @@ def trill_spanner(
"""
start_trill_span = start_trill_span or _indicators.StartTrillSpan()
stop_trill_span = stop_trill_span or _indicators.StopTrillSpan()
assert callable(selector)
argument = selector(argument)
leaves = _select.leaves(argument)
start_leaf = leaves[0]
stop_leaf = leaves[-1]
Expand Down

0 comments on commit 7c95102

Please sign in to comment.