Skip to content

Commit

Permalink
Deprecated natural-language timespan inequalities.
Browse files Browse the repository at this point in the history
Tag #1491.
  • Loading branch information
trevorbaca committed Oct 30, 2022
1 parent f2fbb76 commit 40d2b3d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions abjad/timespan.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,10 @@ def __sub__(self, argument) -> "TimespanList":
stop_offset=new_stop_offset,
)
timespans.append(timespan)
elif argument.starts_when_timespan_starts(
self
) and argument.stops_before_timespan_stops(self):
elif (
argument.start_offset == self.start_offset
and argument.stop_offset < self.stop_offset
):
new_start_offset = argument.stop_offset
new_stop_offset = self.stop_offset
timespan = dataclasses.replace(
Expand All @@ -704,9 +705,10 @@ def __sub__(self, argument) -> "TimespanList":
stop_offset=new_stop_offset,
)
timespans.append(timespan)
elif argument.stops_when_timespan_stops(
self
) and argument.starts_after_timespan_starts(self):
elif (
argument.stop_offset == self.stop_offset
and self.start_offset < argument.start_offset
):
new_start_offset = self.start_offset
new_stop_offset = argument.start_offset
timespan = dataclasses.replace(
Expand Down Expand Up @@ -814,7 +816,7 @@ def _as_postscript(

def _can_fuse(self, argument):
if isinstance(argument, type(self)):
return bool(self & argument) or self.stops_when_timespan_starts(argument)
return bool(self & argument) or self.stop_offset == argument.start_offset
return False

@staticmethod
Expand Down

0 comments on commit 40d2b3d

Please sign in to comment.