Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:DIDONEproject/musiF into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
martianbug committed Nov 7, 2023
2 parents b147803 + 7f1a2fc commit 21a25a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion musif/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
JSYMBOLIC_CONFIG_FILE = "jsymbolic_config_file"
JSYMBOLIC_MAX_RAM = "jsymbolic_max_ram"
JSYMBOLIC_TRY_WITHOUT_REPEATS = "jsymbolic_try_without_repeats"
# Didone specific?
SPLIT_KEYWORDS = "split_keywords"

DELETE_FILES = "delete_failed_files"
DELETE_HARMONY = "delete_files_without_harmony"

UNBUNDLE_INSTRUMENTATION = "separate_intrumentation_column"
INSTRUMENTS_TO_KEEP = "instruments_to_keep"
INSTRUMENTS_TO_DELETE = "instruments_to_delete"
Expand Down
12 changes: 7 additions & 5 deletions musif/process/processor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from pathlib import PurePath
from typing import Union
import numpy as np

import pandas as pd
from pandas import DataFrame
Expand Down Expand Up @@ -84,7 +85,7 @@ def _process_info(self, info: Union[str, DataFrame]) -> DataFrame:

try:
if isinstance(info, str) or isinstance(info, PurePath):
pinfo("\nReading csv file...")
pinfo(f"\nReading csv file {info}...")
if not os.path.exists(info):
raise FileNotFoundError("A .csv file could not be found")
if isinstance(info, PurePath):
Expand All @@ -99,7 +100,6 @@ def _process_info(self, info: Union[str, DataFrame]) -> DataFrame:
return df

elif isinstance(info, DataFrame):
# pinfo("\nProcessing DataFrame...")
return info
else:
perr(
Expand Down Expand Up @@ -178,9 +178,11 @@ def separate_instrumentation_column(self) -> None:
0 if it is not for every row (aria).
"""
for i, row in enumerate(self.data[INSTRUMENTATION]):
for element in row.split(","):
self.data.at[i, PRESENCE + "_" + element] = 1

if str(row) != 'nan':
for element in row.split(","):
self.data.at[i, PRESENCE + "_" + element] = 1
else:
pass
self.data[[i for i in self.data if PRESENCE + "_" in i]] = (
self.data[[i for i in self.data if PRESENCE + "_" in i]]
.fillna(0)
Expand Down

0 comments on commit 21a25a3

Please sign in to comment.