loaders Module#

class neuroml.loaders.ArrayMorphLoader#

Bases: object

classmethod load(filepath)#

Right now this load method isn’t done in a very nice way. TODO: Complete refactoring.

class neuroml.loaders.NeuroMLHdf5Loader#

Bases: object

Class for loading a NeuroML HDF5 file.

classmethod load(src: str, optimized: bool = False) NeuroMLDocument#

Load a NeuroML HDF5 file.

Parameters:
  • src (str) – file

  • optimized (bool) – load optimized numpy representation In the optimized representation, instead of the complete Python object tree being constructed, the various tables in the HDF5 file are loaded as numpy arrays. This is transparent to the user, who can continue using the standard methods to access the data.

Returns:

NeuroMLDocument object

Return type:

neuroml.NeuromlDocument

class neuroml.loaders.NeuroMLLoader#

Bases: object

Class for loading NeuroML.

classmethod load(src: str) NeuroMLDocument#

Load a NeuroML file.

Parameters:

src (str) – file

Returns:

NeuroMLDocument object

Return type:

neuroml.NeuromlDocument

Raises:

TypeError – if the file is not a valid NeuroML document

class neuroml.loaders.SWCLoader#

Bases: object

This class is deprecated and will be removed in a future release. Please refer to https://docs.neuroml.org/Userdocs/ImportingMorphologyFiles.html for information on importing/converting morphology files to NeuroML2.

classmethod load_swc_single(src, name=None)#
neuroml.loaders.read_neuroml2_file(nml2_file_name: str, include_includes: bool = False, verbose: bool = False, already_included: list = None, print_method: ~typing.Callable = <function print_>, optimized: bool = False) NeuroMLDocument#

Read a NeuroML2 file into a NeuroMLDocument object

Parameters:
  • nml2_file_name (str) – name of NeuroML file to read

  • include_includes (bool) – toggle whether Included files should also be loaded

  • verbose (bool) – toggle verbose output

  • already_included (list) – list of already included files

  • print_method (Callable) – print function to use

  • optimized (bool) – for optimized HDF5 NeuroML files

Returns:

NeuroMLDoc object containing the read file

neuroml.loaders.read_neuroml2_string(nml2_string: str, include_includes: bool = False, verbose: bool = False, already_included: list = [], print_method: ~typing.Callable = <function print_>, optimized: bool = False, base_path: str | None = None) NeuroMLDocument#

Read a NeuroML2 string into a NeuroMLDocument object

Parameters:
  • nml2_string (str) – NeuroML string to load

  • include_includes (bool) – toggle whether Included files should also be loaded

  • verbose (bool) – toggle verbose output

  • already_included (list) – list of already included files

  • print_method (Callable) – print function to use

  • optimized (bool) – for optimized HDF5 NeuroML files

  • base_path (str)

Returns:

NeuroMLDoc object containing the model