Skip to content

Commit

Permalink
Merge pull request #183 from NeuralEnsemble/fix/182
Browse files Browse the repository at this point in the history
fix(loader): test for absolute paths in includes
  • Loading branch information
pgleeson authored Dec 13, 2023
2 parents d22ea2f + c5ab31a commit b4c3e4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion neuroml/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,12 @@ def _read_neuroml2(
)

for include in nml2_doc.includes:
incl_loc = os.path.abspath(os.path.join(base_path_to_use, include.href))
# if given path exists, use it, otherwise assume its relative to
# current directory and try that
if os.path.exists(include.href):
incl_loc = os.path.abspath(include.href)
else:
incl_loc = os.path.abspath(os.path.join(base_path_to_use, include.href))
if incl_loc not in already_included:
print_method(
"Loading included NeuroML2 file: %s (base: %s, resolved: %s)"
Expand Down

0 comments on commit b4c3e4d

Please sign in to comment.