Skip to content

Commit

Permalink
fix: enables ignoring the COMPETING_MEASURE_INFO_WARNING
Browse files Browse the repository at this point in the history
  • Loading branch information
johentsch committed May 23, 2024
1 parent 2f03b79 commit 5c727dd
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 15 deletions.
10 changes: 7 additions & 3 deletions src/ms3/bs4_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,15 @@ def squash_staves(df):
if pd.isnull(val) and fillna:
keep_row[col_name] = new_val
msg = (
f"{compress_col} {which}: The missing value in '{col_name}' was replaced by '{new_val}', "
f"{compress_col} {which}: The missing value in '{col_name}' was filled with '{new_val}', "
f"present in '{differentiating_col}' "
f"{remaining.loc[remaining[col_name] == new_val, differentiating_col].to_list()}."
f"{remaining.loc[remaining[col_name] == new_val, differentiating_col].to_list()}. "
f"In rare cases, this may lead to incorrect values in the measures table because it ambiguous "
f"which staff contains the relevant information."
) # ToDo: Currently there is nothing the user can do to influence this behavior!
log_this(
msg, extra={"message_id": (9, compress_col, which, col_name)}
)
log_this(msg)
continue
msg = (
f"{compress_col} {which}: The value '{new_val}' in '{col_name}' of '{differentiating_col}' "
Expand Down
62 changes: 50 additions & 12 deletions tests/test_metarepo_files/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
the moment something is considered, it is considered obsolete.
"""
import os.path
from argparse import Namespace

from ms3 import Parse, Score
from ms3.cli import review_cmd
from ms3.logger import get_logger
from ms3.operations import transform_to_resources

CORPUS_PATH = "~/unittest_metacorpus/wagner_overtures"
CORPUS_PATH = "~/git/389_chorale_settings/original_complete/"


def ignoring_warning():
Expand All @@ -33,7 +35,7 @@ def parse_object() -> Parse:
only_metadata_pieces=True,
include_convertible=False,
exclude_review=True,
file_re=None,
file_re="B378",
folder_re=None,
exclude_re=None,
file_paths=None,
Expand Down Expand Up @@ -65,18 +67,54 @@ def transform_cmd():


def single_score():
path = "~/distant_listening_corpus/ABC/MS3/n13op130_06.mscx"
path = "/home/laser/git/389_chorale_settings/original_complete/MS3/B378.mscx"
return Score(path)


if __name__ == "__main__":
score = single_score()
score.mscx.store_excerpt(
start_mc=62,
start_mc_onset=0,
end_mc=102,
end_mc_onset=0,
exclude_end=True,
directory="/home/laser/Documents/phd/phrase_excerpts/231220_distant_listening_corpus",
suffix="_phrase776",
args = Namespace(
action="review",
ignore_scores=False,
ignore_labels=False,
fail=True,
ignore_metronome=False,
ask=False,
use="expanded",
flip=False,
safe=True,
force=False,
measures="../measures",
notes="../notes",
rests=None,
labels=None,
expanded="../harmonies",
form_labels="../form_labels",
events=None,
chords="../chords",
joined_chords=None,
metadata="",
positioning=False,
raw=True,
unfold=False,
interval_index=False,
corpuswise=False,
dir="/home/laser/git/389_chorale_settings",
out=None,
nonrecursive=False,
all=False,
include=None,
exclude=None,
folders=None,
musescore=None,
reviewed=False,
files=["/home/laser/git/389_chorale_settings/original_complete/MS3/B378.mscx"],
iterative=False,
level="i",
log=None,
test=False,
verbose=False,
compare="LATEST_VERSION",
threshold=0.6,
# func=review_cmd
)
review_cmd(args)

0 comments on commit 5c727dd

Please sign in to comment.