From c2b40a41cb09a87c18f83381d8c3708dcf3509b5 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 19 Sep 2023 20:36:59 +0100 Subject: [PATCH 1/2] feat(write): include HDF5 writing --- pyneuroml/pynml.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyneuroml/pynml.py b/pyneuroml/pynml.py index cd64e68c..20234855 100644 --- a/pyneuroml/pynml.py +++ b/pyneuroml/pynml.py @@ -1088,6 +1088,7 @@ def write_neuroml2_file( nml2_file_name: str, validate: bool = True, verbose_validate: bool = False, + hdf5: bool = True, ) -> None: """Write a NeuroMLDocument object to a file using libNeuroML. @@ -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) From 38acbc10c9b09d5e06af7c33251914051aec8734 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Tue, 19 Sep 2023 20:48:21 +0100 Subject: [PATCH 2/2] chore: correct default --- pyneuroml/pynml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyneuroml/pynml.py b/pyneuroml/pynml.py index 20234855..a7360ce2 100644 --- a/pyneuroml/pynml.py +++ b/pyneuroml/pynml.py @@ -1088,7 +1088,7 @@ def write_neuroml2_file( nml2_file_name: str, validate: bool = True, verbose_validate: bool = False, - hdf5: bool = True, + hdf5: bool = False, ) -> None: """Write a NeuroMLDocument object to a file using libNeuroML.