utils Module

Utilities for checking generated code

neuroml.utils.add_all_to_document(nml_doc_src, nml_doc_tgt, verbose=False)

Add all members of the source NeuroML document to the target NeuroML document.

Parameters
  • nml_doc_src (NeuroMLDocument) – source NeuroML document to copy from

  • nml_doc_tgt (NeuroMLDocument) – target NeuroML document to copy to

  • verbose (bool) – control verbosity of working

Raises

Exception – if a member could not be copied.

neuroml.utils.append_to_element(parent, child)

Append a child element to a parent Component

Parameters
  • parent (Object) – parent NeuroML component to add element to

  • child (Object) – child NeuroML component to be added to parent

Raises

Exception – when the child could not be added to the parent

neuroml.utils.get_summary(nml_file_name)

Get a summary of the given NeuroML file.

Parameters

nml_file_name (str) – name of NeuroML file to get summary of

Returns

summary of provided file

Return type

str

neuroml.utils.has_segment_fraction_info(connections)

Check if connections include fraction information

Parameters

connections (list) – list of connection objects

Returns

True if connections include fragment information, otherwise False

Return type

Boolean

neuroml.utils.is_valid_neuroml2(file_name)

Check if a file is valid NeuroML2.

Parameters

file_name (str) – name of NeuroML file to check

Returns

True if file is valid, False if not.

Return type

Boolean

neuroml.utils.main()
neuroml.utils.print_summary(nml_file_name)

Print a summary of the NeuroML model in the given file.

Parameters

nml_file_name (str) – name of NeuroML file to print summary of

neuroml.utils.validate_neuroml2(file_name)

Validate a NeuroML document against the NeuroML schema specification.

Parameters

file_name (str) – name of NeuroML file to validate.