Skip to content

Commit

Permalink
Fix substitution rule
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Mar 8, 2023
1 parent d6dcc09 commit 5488996
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/synthesis_workflow/synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ def apply_substitutions(original_morphs_df, substitution_rules=None):

new_morphs_df = original_morphs_df.copy()
for mtype_orig, mtypes in substitution_rules.items():
df = original_morphs_df[original_morphs_df.mtype.isin(mtypes)].copy()
df["mtype"] = mtype_orig
new_morphs_df = pd.concat([new_morphs_df, df])
for mtype in mtypes:
df = original_morphs_df[original_morphs_df.mtype == mtype_orig].copy()
df["mtype"] = mtype
new_morphs_df = pd.concat([new_morphs_df, df])
return new_morphs_df


Expand Down

0 comments on commit 5488996

Please sign in to comment.