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

Fix create_ontology using the wrong tag range for libraries #992

Merged
merged 1 commit into from
Jul 26, 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
6 changes: 4 additions & 2 deletions hed/schema/schema_io/ontology_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_library_name_and_id(schema):
"""

name = schema.library

library_data = get_library_data(name)
starting_id, _ = library_data.get("id_range", (UNKNOWN_LIBRARY_VALUE, UNKNOWN_LIBRARY_VALUE))
if not name:
Expand Down Expand Up @@ -117,6 +117,8 @@ def update_dataframes_from_schema(dataframes, schema, schema_name="", get_as_ids
These dataframes can potentially have extra columns
"""
hedid_errors = []
if not schema_name:
schema_name = schema.library
# 1. Verify existing hed ids don't conflict between schema/dataframes
for df_key, df in dataframes.items():
section_key = constants.section_mapping.get(df_key)
Expand Down Expand Up @@ -250,7 +252,7 @@ def _get_annotation_prop_ids(dataframes):
# Also add schema properties
annotation_props.update(
{key: value for key, value in zip(dataframes[constants.ATTRIBUTE_PROPERTY_KEY][constants.name],
dataframes[constants.ATTRIBUTE_PROPERTY_KEY][constants.hed_id])})
dataframes[constants.ATTRIBUTE_PROPERTY_KEY][constants.hed_id])})

return annotation_props

Expand Down