Skip to content

Commit

Permalink
Merge pull request #255 from NeuroML/feat/hdf-writer
Browse files Browse the repository at this point in the history
feat(write): include HDF5 writing
  • Loading branch information
pgleeson authored Sep 20, 2023
2 parents 3bccb5c + 38acbc1 commit 0899741
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyneuroml/pynml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ def write_neuroml2_file(
nml2_file_name: str,
validate: bool = True,
verbose_validate: bool = False,
hdf5: bool = False,
) -> None:
"""Write a NeuroMLDocument object to a file using libNeuroML.
Expand All @@ -1099,8 +1100,13 @@ def write_neuroml2_file(
:type validate: bool
:param verbose_validate: toggle whether the validation should be verbose
:type verbose_validate: bool
:param hdf5: write to HDF5 file
:type hdf5: bool
"""
writers.NeuroMLWriter.write(nml2_doc, nml2_file_name)
if hdf5 is True:
writers.NeuroMLHdf5Writer.write(nml2_doc, nml2_file_name)
else:
writers.NeuroMLWriter.write(nml2_doc, nml2_file_name)

if validate:
return validate_neuroml2(nml2_file_name, verbose_validate)
Expand Down

0 comments on commit 0899741

Please sign in to comment.