Skip to content

Commit d380a92

Browse files
committed
replace custom func with a function from dev_tools
1 parent bca55dd commit d380a92

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/pynxtools/dataconverter/helpers.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
from pynxtools import get_nexus_version, get_nexus_version_hash
3636
from pynxtools.definitions.dev_tools.utils.nxdl_utils import (
37+
find_definition_file,
3738
get_enums,
3839
get_inherited_nodes,
3940
get_nexus_definitions_path,
@@ -405,16 +406,10 @@ def get_nxdl_root_and_path(nxdl: str):
405406
"NXtest_extended": os.path.join(data_path, "NXtest_extended.nxdl.xml"),
406407
}
407408

408-
probable_file_paths = [
409-
os.path.join(definitions_path, "contributed_definitions", f"{nxdl}.nxdl.xml"),
410-
os.path.join(definitions_path, "applications", f"{nxdl}.nxdl.xml"),
411-
os.path.join(definitions_path, "base_classes", f"{nxdl}.nxdl.xml"),
412-
]
413409
if nxdl in special_names:
414410
nxdl_f_path = special_names[nxdl]
415411
else:
416-
nxdl_f_path = next((x for x in probable_file_paths if os.path.exists(x)), None)
417-
412+
nxdl_f_path = find_definition_file(nxdl)
418413
if nxdl_f_path is None:
419414
raise FileNotFoundError(f"The nxdl file, {nxdl}, was not found.")
420415

0 commit comments

Comments
 (0)