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

refactor: use proper type checking instead of helper function #120

Merged
merged 2 commits into from
Jan 18, 2024
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
3 changes: 1 addition & 2 deletions altamisa/isatab/validate_assay_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from . import models
from ..constants import table_headers, table_restrictions, table_tokens
from ..exceptions import CriticalIsaValidationWarning, ModerateIsaValidationWarning
from .helpers import is_ontology_term_ref

__author__ = "Mathias Kuhring <[email protected]>"

Expand Down Expand Up @@ -87,7 +86,7 @@ def validate(self, material: models.Material):
def _validate_material_annotations(self, material: models.Material):
# Warn about unnamed materials/data files if there are annotations
def has_content(value):
if is_ontology_term_ref(value):
if isinstance(value, models.OntologyTermRef):
return value.name or value.accession or value.ontology_name
else:
return value
Expand Down