Skip to content

Commit

Permalink
Fixes detected while preparing the run-through
Browse files Browse the repository at this point in the history
  • Loading branch information
atomprobe-tc committed Apr 24, 2024
1 parent 09562cb commit b19df3c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pynxtools_apm/concepts/mapping_functors.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ def add_specific_metadata(
if len(entry) == 2:
if not all(isinstance(elem, str) for elem in entry):
continue
if f"{prefix_src}{entry[1]}" not in orgmeta:
continue
if orgmeta[f"{prefix_src}{entry[1]}"] == "":
continue
trg = variadic_path_to_specific_path(
Expand Down
2 changes: 1 addition & 1 deletion pynxtools_apm/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def read(

if len(case.eln) == 1:
print("Parse (meta)data coming from an ELN...")
nx_apm_eln = NxApmNomadOasisElnSchemaParser(case.eln[0], entry_id, True)
nx_apm_eln = NxApmNomadOasisElnSchemaParser(case.eln[0], entry_id)
nx_apm_eln.parse(template)
else:
print("No input file defined for eln data !")
Expand Down
2 changes: 1 addition & 1 deletion pynxtools_apm/utils/oasis_config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, file_path: str, entry_id: int, verbose: bool = False):
)
if (
file_path.rsplit("/", 1)[-1].endswith(".oasis.specific.yaml")
or file_path.endswith(".oasis.specific.yml")
or file_path.rsplit("/", 1)[-1].endswith(".oasis.specific.yml")
) and entry_id > 0:
self.entry_id = entry_id
self.file_path = file_path
Expand Down
4 changes: 2 additions & 2 deletions pynxtools_apm/utils/oasis_eln_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class NxApmNomadOasisElnSchemaParser:
def __init__(self, file_path: str, entry_id: int, verbose: bool = False):
print(f"Extracting data from ELN file: {file_path}")
if (
file_path.rsplit("/", 1)[-1].startswith("eln_data")
or file_path.startswith("eln_data")
file_path.rsplit("/", 1)[-1].endswith("eln_data.yaml")
or file_path.rsplit("/", 1)[-1].endswith("eln_data.yml")
) and entry_id > 0:
self.entry_id = entry_id
self.file_path = file_path
Expand Down

0 comments on commit b19df3c

Please sign in to comment.