Skip to content

Commit

Permalink
Fix bug when resolving instance names (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehennestad committed Jul 25, 2024
1 parent 1800955 commit 27f91ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pipeline/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _extract_template_variables(self):
display_label_method_expression = _get_display_label_method_expression(class_name)

# TODO: Specify base class. Implement template with configurable base class. Schema or ControlledTerm?
# Or; just remove this as its not needed when using separate templates.
# Or; just remove this as it's not needed when using separate templates.
if self._schema_model_name == "controlledTerms":
base_class = "openminds.abstract.ControlledTerm"
else:
Expand Down
6 changes: 4 additions & 2 deletions pipeline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_instance_collection(self, version:str, schema_name:str) -> List[str]:
# Make sure schema_name is correct casing (camel case) according to foldernames
if schema_name == schema_name.upper():
pass
elif schema_name == "UBERONParcellation":
elif schema_name in ["UBERONParcellation", "MRIPulseSequence"]:
# Todo: Need to find a general solution for these exceptions.
pass
else:
Expand Down Expand Up @@ -87,7 +87,9 @@ def camel_case(text_string: str):

def extract_filename_without_extension(path):
base_name = os.path.basename(path) # Get the base name from the path
return base_name.split('.')[0]
if '.' in base_name:
return base_name.rsplit('.', 1)[0]
return base_name

def save_resource_files(version, schema_path_list):
"""
Expand Down

0 comments on commit 27f91ad

Please sign in to comment.