Skip to content

Commit

Permalink
makes the rests facet evaluate to None if no rests are present in the…
Browse files Browse the repository at this point in the history
… score.

This prevents the creation of frictionless schemas with wild column names for empty dataframes
  • Loading branch information
johentsch committed Sep 2, 2023
1 parent b9f255a commit 12b8b07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ms3/bs4_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,6 +2382,8 @@ def rests(
DataFrame representing the :ref:`rests` of the MuseScore file.
"""
rests = self.rl()
if len(rests) == 0:
return None
if unfold:
rests = self.unfold_facet_df(rests, "rests")
if rests is None:
Expand Down Expand Up @@ -2815,7 +2817,7 @@ def perform_checks(self):
metronome_mark_missing = False
# here we could insert logic for treating incipit measure groups differently
if metronome_mark_missing:
msg = "No metronome mark found in the very first measure"
msg = "No metronome mark found in the first measure"
tempo_selector = (events.event == "Tempo").fillna(False)
if tempo_selector.sum() == 0:
msg += " nor anywhere else in the score."
Expand Down

0 comments on commit 12b8b07

Please sign in to comment.