Skip to content

Commit

Permalink
Avoid exception if tier is unknown but new_tiers is undefined (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgautheron authored Feb 28, 2022
1 parent 3f67d29 commit 4c704cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ChildProject/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ class EafConverter(AnnotationConverter):
FORMAT = "eaf"

@staticmethod
def convert(filename: str, filter=None, **kwargs) -> pd.DataFrame:
def convert(filename: str, filter: str=None, new_tiers: list=None, **kwargs) -> pd.DataFrame:
import pympi

eaf = pympi.Elan.Eaf(filename)
Expand Down Expand Up @@ -523,7 +523,7 @@ def convert(filename: str, filter=None, **kwargs) -> pd.DataFrame:
segment["vcm_type"] = value
elif label == "msc":
segment["msc_type"] = value
elif label in kwargs["new_tiers"]:
elif new_tiers is not None and label in new_tiers:
controlled_values = \
[value[0][0][0] for value in eaf.controlled_vocabularies[label][1].values()]
if value not in controlled_values:
Expand Down

0 comments on commit 4c704cc

Please sign in to comment.