Skip to content
Draft
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
8 changes: 5 additions & 3 deletions pyneuroml/archive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_model_file_list(
:returns: value of lems_def_dir so that the temporary directory can be
cleaned up. strings are immuatable in Python so the variable cannot be
modified in the function.
:raises ValueError: if a file that does not have ".xml" or ".nml" as extension is encountered
:raises ValueError: if a file that does not have ".xml", ".nml", or ".h5" as extension is encountered
"""
logger.debug(f"Processing {rootfile}")

Expand All @@ -148,7 +148,7 @@ def get_model_file_list(
logger.debug(f"Appending: {relrootfile}")
filelist.append(relrootfile)

if rootfile.endswith(".nml"):
if rootfile.endswith(".nml") or rootfile.endswith(".h5"):
if pathlib.Path(rootfile).is_absolute():
rootdoc = read_neuroml2_file(rootfile)
else:
Expand Down Expand Up @@ -183,7 +183,9 @@ def get_model_file_list(
lems_def_dir = get_model_file_list(inc, filelist, rootdir, lems_def_dir)

else:
raise ValueError(f"File must have a .xml or .nml extension. We got: {rootfile}")
raise ValueError(
f"File must have a .xml, .nml, or .h5 extension. We got: {rootfile}"
)

return lems_def_dir

Expand Down