Skip to content

Commit 5c727dd

Browse files
author
Johannes Hentschel
committed
fix: enables ignoring the COMPETING_MEASURE_INFO_WARNING
1 parent 2f03b79 commit 5c727dd

File tree

2 files changed

+57
-15
lines changed

2 files changed

+57
-15
lines changed

src/ms3/bs4_measures.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,15 @@ def squash_staves(df):
152152
if pd.isnull(val) and fillna:
153153
keep_row[col_name] = new_val
154154
msg = (
155-
f"{compress_col} {which}: The missing value in '{col_name}' was replaced by '{new_val}', "
155+
f"{compress_col} {which}: The missing value in '{col_name}' was filled with '{new_val}', "
156156
f"present in '{differentiating_col}' "
157-
f"{remaining.loc[remaining[col_name] == new_val, differentiating_col].to_list()}."
157+
f"{remaining.loc[remaining[col_name] == new_val, differentiating_col].to_list()}. "
158+
f"In rare cases, this may lead to incorrect values in the measures table because it ambiguous "
159+
f"which staff contains the relevant information."
160+
) # ToDo: Currently there is nothing the user can do to influence this behavior!
161+
log_this(
162+
msg, extra={"message_id": (9, compress_col, which, col_name)}
158163
)
159-
log_this(msg)
160164
continue
161165
msg = (
162166
f"{compress_col} {which}: The value '{new_val}' in '{col_name}' of '{differentiating_col}' "

tests/test_metarepo_files/debugging.py

+50-12
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
the moment something is considered, it is considered obsolete.
88
"""
99
import os.path
10+
from argparse import Namespace
1011

1112
from ms3 import Parse, Score
13+
from ms3.cli import review_cmd
1214
from ms3.logger import get_logger
1315
from ms3.operations import transform_to_resources
1416

15-
CORPUS_PATH = "~/unittest_metacorpus/wagner_overtures"
17+
CORPUS_PATH = "~/git/389_chorale_settings/original_complete/"
1618

1719

1820
def ignoring_warning():
@@ -33,7 +35,7 @@ def parse_object() -> Parse:
3335
only_metadata_pieces=True,
3436
include_convertible=False,
3537
exclude_review=True,
36-
file_re=None,
38+
file_re="B378",
3739
folder_re=None,
3840
exclude_re=None,
3941
file_paths=None,
@@ -65,18 +67,54 @@ def transform_cmd():
6567

6668

6769
def single_score():
68-
path = "~/distant_listening_corpus/ABC/MS3/n13op130_06.mscx"
70+
path = "/home/laser/git/389_chorale_settings/original_complete/MS3/B378.mscx"
6971
return Score(path)
7072

7173

7274
if __name__ == "__main__":
73-
score = single_score()
74-
score.mscx.store_excerpt(
75-
start_mc=62,
76-
start_mc_onset=0,
77-
end_mc=102,
78-
end_mc_onset=0,
79-
exclude_end=True,
80-
directory="/home/laser/Documents/phd/phrase_excerpts/231220_distant_listening_corpus",
81-
suffix="_phrase776",
75+
args = Namespace(
76+
action="review",
77+
ignore_scores=False,
78+
ignore_labels=False,
79+
fail=True,
80+
ignore_metronome=False,
81+
ask=False,
82+
use="expanded",
83+
flip=False,
84+
safe=True,
85+
force=False,
86+
measures="../measures",
87+
notes="../notes",
88+
rests=None,
89+
labels=None,
90+
expanded="../harmonies",
91+
form_labels="../form_labels",
92+
events=None,
93+
chords="../chords",
94+
joined_chords=None,
95+
metadata="",
96+
positioning=False,
97+
raw=True,
98+
unfold=False,
99+
interval_index=False,
100+
corpuswise=False,
101+
dir="/home/laser/git/389_chorale_settings",
102+
out=None,
103+
nonrecursive=False,
104+
all=False,
105+
include=None,
106+
exclude=None,
107+
folders=None,
108+
musescore=None,
109+
reviewed=False,
110+
files=["/home/laser/git/389_chorale_settings/original_complete/MS3/B378.mscx"],
111+
iterative=False,
112+
level="i",
113+
log=None,
114+
test=False,
115+
verbose=False,
116+
compare="LATEST_VERSION",
117+
threshold=0.6,
118+
# func=review_cmd
82119
)
120+
review_cmd(args)

0 commit comments

Comments
 (0)