Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid exception if tier is unknown but new_tiers is undefined #364

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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