writers Module#

class neuroml.writers.ArrayMorphWriter#

Bases: object

Write morphology to ArrayMorph format.

For now just testing a simple method which can write a morphology, not a NeuroMLDocument.

classmethod write(data: NeuroMLDocument | ArrayMorphology, filepath: str)#

Write morphology to file in ArrayMorph format.

Parameters:
  • data (ArrayMorphology or neuroml.NeuroMLDocument) – data to write

  • filepath (str) – path of file to write to

class neuroml.writers.NeuroMLHdf5Writer#

Bases: object

Exports NeuroML documents to HDF5 format.

classmethod write(nml_doc: NeuroMLDocument, h5_file_name: str, embed_xml: bool = True, compress: bool = True)#

Write a NeuroMLDocument to HDF5 file

Parameters:
  • nmldoc (neuroml.NeuroMLDocument) – NeuroML document object to write

  • h5_file_name (str) – file name to write to

  • embed_xml (bool) – toggle whether XML serialization should be embedded

  • compress (bool) – toggle compression

class neuroml.writers.NeuroMLWriter#

Bases: object

Writes from NeuroMLDocument to nml file.

In future can implement from other types via chain of responsibility pattern.

classmethod write(nmldoc: NeuroMLDocument, file: str, close: bool = True)#

Write a NeuroMLDocument to file.

Parameters:
  • nmldoc (neuroml.NeuroMLDocument) – NeuroML document object to write

  • file (str) – file name to write to

  • close (bool) – toggle whether file should be closed

Raises:

AttributeError – if export fails