Channels#

This documentation is auto-generated from the NeuroML schema.

ClosedState#

class neuroml.nml.nml.ClosedState(id: a NmlId (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

ClosedState – A KSState with relativeConductance of 0

Parameters:

relativeConductance (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

ForwardTransition#

class neuroml.nml.nml.ForwardTransition(id: a NmlId (required) = None, from_: a NmlId (required) = None, to: a NmlId (required) = None, anytypeobjs_=None, gds_collector_=None, **kwargs_)#

Bases: Base

ForwardTransition – A forward only KSTransition for a gateKS which specifies a rate ( type baseHHRate ) which follows one of the standard Hodgkin Huxley forms ( e. g. HHExpRate , HHSigmoidRate , HHExpLinearRate

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateFractional#

class neuroml.nml.nml.GateFractional(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, sub_gates: list of GateFractionalSubgate(s) (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateFractional – Gate composed of subgates contributing with fractional conductance

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateFractionalSubgate#

class neuroml.nml.nml.GateFractionalSubgate(id: a NmlId (required) = None, fractional_conductance: a Nml2Quantity_none (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, steady_state: a HHVariable (required) = None, time_course: a HHTime (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateHHInstantaneous#

class neuroml.nml.nml.GateHHInstantaneous(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, steady_state: a HHVariable (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateHHInstantaneous – Gate which follows the general Hodgkin Huxley formalism but is instantaneous, so tau = 0 and gate follows exactly inf value

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateHHRates#

class neuroml.nml.nml.GateHHRates(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, forward_rate: a HHRate (required) = None, reverse_rate: a HHRate (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateHHRates – Gate which follows the general Hodgkin Huxley formalism

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateHHRatesInf#

class neuroml.nml.nml.GateHHRatesInf(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, forward_rate: a HHRate (required) = None, reverse_rate: a HHRate (required) = None, steady_state: a HHVariable (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateHHRatesInf – Gate which follows the general Hodgkin Huxley formalism

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateHHRatesTau#

class neuroml.nml.nml.GateHHRatesTau(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, forward_rate: a HHRate (required) = None, reverse_rate: a HHRate (required) = None, time_course: a HHTime (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateHHRatesTau – Gate which follows the general Hodgkin Huxley formalism

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateHHRatesTauInf#

class neuroml.nml.nml.GateHHRatesTauInf(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, forward_rate: a HHRate (required) = None, reverse_rate: a HHRate (required) = None, time_course: a HHTime (required) = None, steady_state: a HHVariable (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateHHRatesTauInf – Gate which follows the general Hodgkin Huxley formalism

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateHHTauInf#

class neuroml.nml.nml.GateHHTauInf(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, time_course: a HHTime (required) = None, steady_state: a HHVariable (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateHHTauInf – Gate which follows the general Hodgkin Huxley formalism

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateHHUndetermined#

class neuroml.nml.nml.GateHHUndetermined(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, type: a gateTypes (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, forward_rate: a HHRate (optional) = None, reverse_rate: a HHRate (optional) = None, time_course: a HHTime (optional) = None, steady_state: a HHVariable (optional) = None, sub_gates: list of GateFractionalSubgate(s) (optional) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateHHUndetermined – Note all sub elements for gateHHrates, gateHHratesTau, gateFractional etc. allowed here. Which are valid should be constrained by what type is set

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

GateKS#

class neuroml.nml.nml.GateKS(id: a NmlId (required) = None, instances: a PositiveInteger (required) = None, notes: a string (optional) = None, q10_settings: a Q10Settings (optional) = None, closed_states: list of ClosedState(s) (required) = None, open_states: list of OpenState(s) (required) = None, forward_transition: list of ForwardTransition(s) (required) = None, reverse_transition: list of ReverseTransition(s) (required) = None, tau_inf_transition: list of TauInfTransition(s) (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

GateKS – A gate which consists of multiple KSState s and KSTransition s giving the rates of transition between them

Parameters:

instances (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

HHRate#

class neuroml.nml.nml.HHRate(type: a NmlId (required) = None, rate: a Nml2Quantity_pertime (optional) = None, midpoint: a Nml2Quantity_voltage (optional) = None, scale: a Nml2Quantity_voltage (optional) = None, gds_collector_=None, **kwargs_)#

Bases: BaseWithoutId

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

HHTime#

class neuroml.nml.nml.HHTime(type: a NmlId (required) = None, rate: a Nml2Quantity_time (optional) = None, midpoint: a Nml2Quantity_voltage (optional) = None, scale: a Nml2Quantity_voltage (optional) = None, tau: a Nml2Quantity_time (optional) = None, gds_collector_=None, **kwargs_)#

Bases: BaseWithoutId

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

HHVariable#

class neuroml.nml.nml.HHVariable(type: a NmlId (required) = None, rate: a float (optional) = None, midpoint: a Nml2Quantity_voltage (optional) = None, scale: a Nml2Quantity_voltage (optional) = None, gds_collector_=None, **kwargs_)#

Bases: BaseWithoutId

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

IonChannel#

class neuroml.nml.nml.IonChannel(id: a NmlId (required) = None, metaid: a MetaId (optional) = None, notes: a string (optional) = None, properties: list of Property(s) (optional) = None, annotation: a Annotation (optional) = None, neuro_lex_id: a NeuroLexId (optional) = None, q10_conductance_scalings: list of Q10ConductanceScaling(s) (optional) = None, species: a NmlId (optional) = None, type: a channelTypes (optional) = None, conductance: a Nml2Quantity_conductance (optional) = None, gates: list of GateHHUndetermined(s) (optional) = None, gate_hh_rates: list of GateHHRates(s) (optional) = None, gate_h_hrates_taus: list of GateHHRatesTau(s) (optional) = None, gate_hh_tau_infs: list of GateHHTauInf(s) (optional) = None, gate_h_hrates_infs: list of GateHHRatesInf(s) (optional) = None, gate_h_hrates_tau_infs: list of GateHHRatesTauInf(s) (optional) = None, gate_hh_instantaneouses: list of GateHHInstantaneous(s) (optional) = None, gate_fractionals: list of GateFractional(s) (optional) = None, extensiontype_=None, gds_collector_=None, **kwargs_)#

Bases: IonChannelScalable

IonChannel – Note ionChannel and ionChannelHH are currently functionally identical. This is needed since many existing examples use ionChannel, some use ionChannelHH. NeuroML v2beta4 should remove one of these, probably ionChannelHH.

Parameters:

conductance (conductance)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

IonChannelHH#

class neuroml.nml.nml.IonChannelHH(id: a NmlId (required) = None, metaid: a MetaId (optional) = None, notes: a string (optional) = None, properties: list of Property(s) (optional) = None, annotation: a Annotation (optional) = None, neuro_lex_id: a NeuroLexId (optional) = None, q10_conductance_scalings: list of Q10ConductanceScaling(s) (optional) = None, species: a NmlId (optional) = None, type: a channelTypes (optional) = None, conductance: a Nml2Quantity_conductance (optional) = None, gates: list of GateHHUndetermined(s) (optional) = None, gate_hh_rates: list of GateHHRates(s) (optional) = None, gate_h_hrates_taus: list of GateHHRatesTau(s) (optional) = None, gate_hh_tau_infs: list of GateHHTauInf(s) (optional) = None, gate_h_hrates_infs: list of GateHHRatesInf(s) (optional) = None, gate_h_hrates_tau_infs: list of GateHHRatesTauInf(s) (optional) = None, gate_hh_instantaneouses: list of GateHHInstantaneous(s) (optional) = None, gate_fractionals: list of GateFractional(s) (optional) = None, gds_collector_=None, **kwargs_)#

Bases: IonChannel

IonChannelHH – Note ionChannel and ionChannelHH are currently functionally identical. This is needed since many existing examples use ionChannel, some use ionChannelHH. NeuroML v2beta4 should remove one of these, probably ionChannelHH.

Parameters:

conductance (conductance)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

IonChannelKS#

class neuroml.nml.nml.IonChannelKS(id: a NmlId (required) = None, metaid: a MetaId (optional) = None, notes: a string (optional) = None, properties: list of Property(s) (optional) = None, annotation: a Annotation (optional) = None, species: a NmlId (optional) = None, conductance: a Nml2Quantity_conductance (optional) = None, neuro_lex_id: a NeuroLexId (optional) = None, gate_kses: list of GateKS(s) (optional) = None, gds_collector_=None, **kwargs_)#

Bases: Standalone

A kinetic scheme based ion channel with multiple gateKS s, each of which consists of multiple KSState s and KSTransition s giving the rates of transition between them IonChannelKS – A kinetic scheme based ion channel with multiple gateKS s, each of which consists of multiple KSState s and KSTransition s giving the rates of transition between them

Parameters:

conductance (conductance)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

IonChannelScalable#

class neuroml.nml.nml.IonChannelScalable(id: a NmlId (required) = None, metaid: a MetaId (optional) = None, notes: a string (optional) = None, properties: list of Property(s) (optional) = None, annotation: a Annotation (optional) = None, neuro_lex_id: a NeuroLexId (optional) = None, q10_conductance_scalings: list of Q10ConductanceScaling(s) (optional) = None, extensiontype_=None, gds_collector_=None, **kwargs_)#

Bases: Standalone

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

IonChannelVShift#

class neuroml.nml.nml.IonChannelVShift(id: a NmlId (required) = None, metaid: a MetaId (optional) = None, notes: a string (optional) = None, properties: list of Property(s) (optional) = None, annotation: a Annotation (optional) = None, neuro_lex_id: a NeuroLexId (optional) = None, q10_conductance_scalings: list of Q10ConductanceScaling(s) (optional) = None, species: a NmlId (optional) = None, type: a channelTypes (optional) = None, conductance: a Nml2Quantity_conductance (optional) = None, gates: list of GateHHUndetermined(s) (optional) = None, gate_hh_rates: list of GateHHRates(s) (optional) = None, gate_h_hrates_taus: list of GateHHRatesTau(s) (optional) = None, gate_hh_tau_infs: list of GateHHTauInf(s) (optional) = None, gate_h_hrates_infs: list of GateHHRatesInf(s) (optional) = None, gate_h_hrates_tau_infs: list of GateHHRatesTauInf(s) (optional) = None, gate_hh_instantaneouses: list of GateHHInstantaneous(s) (optional) = None, gate_fractionals: list of GateFractional(s) (optional) = None, v_shift: a Nml2Quantity_voltage (required) = None, gds_collector_=None, **kwargs_)#

Bases: IonChannel

IonChannelVShift – Same as ionChannel , but with a vShift parameter to change voltage activation of gates. The exact usage of vShift in expressions for rates is determined by the individual gates.

Parameters:
  • vShift (voltage)

  • conductance (conductance)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

OpenState#

class neuroml.nml.nml.OpenState(id: a NmlId (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

OpenState – A KSState with relativeConductance of 1

Parameters:

relativeConductance (none)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

Q10ConductanceScaling#

class neuroml.nml.nml.Q10ConductanceScaling(q10_factor: a Nml2Quantity_none (required) = None, experimental_temp: a Nml2Quantity_temperature (required) = None, gds_collector_=None, **kwargs_)#

Bases: BaseWithoutId

Q10ConductanceScaling – A value for the conductance scaling which varies as a standard function of the difference between the current temperature, temperature, and the temperature at which the conductance was originally determined, experimentalTemp

Parameters:
  • q10Factor (none)

  • experimentalTemp (temperature)

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

Q10Settings#

class neuroml.nml.nml.Q10Settings(type: a NmlId (required) = None, fixed_q10: a Nml2Quantity_none (optional) = None, q10_factor: a Nml2Quantity_none (optional) = None, experimental_temp: a Nml2Quantity_temperature (optional) = None, gds_collector_=None, **kwargs_)#

Bases: GeneratedsSuper

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

ReverseTransition#

class neuroml.nml.nml.ReverseTransition(id: a NmlId (required) = None, from_: a NmlId (required) = None, to: a NmlId (required) = None, anytypeobjs_=None, gds_collector_=None, **kwargs_)#

Bases: Base

ReverseTransition – A reverse only KSTransition for a gateKS which specifies a rate ( type baseHHRate ) which follows one of the standard Hodgkin Huxley forms ( e. g. HHExpRate , HHSigmoidRate , HHExpLinearRate

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

TauInfTransition#

class neuroml.nml.nml.TauInfTransition(id: a NmlId (required) = None, from_: a NmlId (required) = None, to: a NmlId (required) = None, steady_state: a HHVariable (required) = None, time_course: a HHTime (required) = None, gds_collector_=None, **kwargs_)#

Bases: Base

TauInfTransition – KS Transition specified in terms of time constant tau and steady state inf

add(obj=None, hint=None, force=False, validate=True, **kwargs)#

Generic function to allow easy addition of a new member to a NeuroML object. Without arguments, when obj=None, it simply calls the info() method to provide the list of valid member types for the NeuroML class.

Please use the info() method directly for more information on the current contents of this component object.

When obj is given a string name of a NeuroML class (“NeuroMLDocument”), or the class itself (neuroml.NeuroMLDocument), a new object will be created of this type and added as a member to the calling (parent) component type object.

Parameters:
  • obj (Object) – member object or class type (neuroml.NeuroMLDocument) or name of class type (“NeuroMLDocument”), or None

  • hint (string) – member name to add to when there are multiple members that obj can be added to

  • force (bool) – boolean to force addition when an obj has already been added previously

  • validate (bool) – validate component after adding (default: True)

Returns obj:

the provided or created object

Raises:
  • Exception – if a member compatible to obj could not be found

  • Exception – if multiple members can accept the object and no hint is provided.

classmethod component_factory(component_type, validate=True, **kwargs)#

Factory function to create a NeuroML Component object.

Users can provide the name of the component as a string or the class variable, along with its named constructor arguments, and this function will create a new object of the Component and return it.

Users can use the add() helper function to further modify components

This factory runs two checks while creating the component object:

  • that all arguments given do belong to the ComponentType (useful for caching typos)

  • that the created component is valid NeuroML

It is therefore less error prone than creating Components directly using the ComponentType constructors.

It may be useful to disable validation when starting a model. The validate parameter can be set to False for this.

Parameters:
  • component_type (str/type) – component type to create component from: this can either be the name of the component as a string, e.g. “NeuroMLDocument”, or it can be the class type itself: NeuroMLDocument. Note that when providing the class type, one will need to import it, e.g.: import NeuroMLDocument, to ensure that it is defined, whereas this will not be required when using the string.

  • validate (bool) – toggle validation (default: True)

  • kwargs (named arguments) – named arguments to be passed to ComponentType constructor

Returns:

new Component (object) of provided ComponentType

Return type:

object

Raises:

ValueError – if validation/checks fail

classmethod get_class_hierarchy()#

Get the class hierarchy for a component classs.

Reference: https://stackoverflow.com/a/75161393/375067

See the methods in neuroml.utils to use this generated hierarchy.

Returns:

nested single key dictionaries where the key of each dictionary is the root node of that subtree, and keys are its immediate descendents

classmethod get_nml2_class_hierarchy()#

Return the NeuroML class hierarchy.

The root here is NeuroMLDocument. This is useful in calculating paths to different components to aid in construction of relative paths.

This caches the value as a class variable so that it is not re-calculated when used multiple times.

has__content()#
info(show_contents=False, return_format='string')#

Provide information on NeuroML component.

This is useful to quickly check what members can go into a particular NeuroML class (which will match the Schema definitions). It lists these members and notes whether they are “single” type elements (Child elements) or “List” elements (Children elements). It will also note whether a member is optional or required.

To get a list of possible parents, use the parentinfo() method.

By default, this will only show the members, and not their contents. To see contents that have been set, use show_contents=True. This will not show empty/unset contents. To see all contents, set show_contents=all.

Note that not all members will have ids (since not all NeuroML2 ComponentTypes have ids). For members that do not have ids, the object reference is listed instead.

See http://www.davekuhlman.org/generateDS.html#user-methods for more information on the MemberSpec_ class that generateDS uses.

Parameters:
  • show_contents (bool or str) – toggle to print out the contents of the members

  • return_format (str) –

    select what format to return information in “string” (default), or “dict” or “list”.

    If “dict” or “list” is provided, the information is returned as a dict/list instead of being printed. Note that if show_contents is False, only a list of members is available and will be returned even if “dict” is supplied. If show_contents is True or “all” but “list” is provided, only the list of members will be returned. If something other than “string”, “list”, or “dict” is provided, the string representation is returned and printed.

Returns:

info string, or list of members or dict with members as keys and member values as values

Return type:

str, list/dict

parentinfo(return_format='string')#

Show the list of possible parents.

This object can then be added to objects of the parents using the add method.

It is similar to the info() method. However, where in the info() method, it is possible to find the contents of members for a component (object) rather easily, it is not so easily possible to get all the objects that may refer to another object.

So, this will provide information on possible parents. It will not provide information on whether the components (objects) of the particular parent have already been instantiated and what their values are. The user should be able to gather this information easily by reading the sources.

Please also note that various component types in NeuroML take ids of components as parameters. For example, an ExplicitInput will take the id of a cell as its target, and the id of a PulseGenerator as input. However, these are string fields, and the cell/pulse generator classes do not currently know that their ids can be used in ExplicitInput. This information does not live in the XSD schema, and so cannot be obtained here either.

Parameters:

return_format (str) – format in which to return information. If “string” (default), an information string is returned. If “list” or “dict”, a list or dictionary is returned. The list will only contain the parent names, whereas the dict will also include the member of the parent that the component type matches to.

Returns:

info string, or list of parents or dict with parents as keys and member information as values

Return type:

str, list/dict

validate(recursive=False)#

Validate the component.

Throws a Python ValueError if a the component is invalid. You can ignore this by using a try .. except ValueError: pass block.

Note: validating your NeuroML file against the schema, which pynml and jnml do, will also check this.

Note: that this is different from the validate_ method, which does not validate inherited members.

Parameters:

recursive (bool) – toggle recursive validation (default: False)

Returns:

None

Return type:

None

Raises:

ValueError – if component is invalid

channelTypes#

class neuroml.nml.nml.channelTypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: str, Enum

ION_CHANNEL_HH = 'ionChannelHH'#
ION_CHANNEL_PASSIVE = 'ionChannelPassive'#
capitalize()#

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()#

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)#

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int#

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')#

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool#

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)#

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int#

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str#

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str#

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int#

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()#

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()#

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()#

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()#

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()#

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()#

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()#

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()#

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()#

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()#

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()#

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()#

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)#

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)#

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()#

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)#

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()#

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)#

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)#

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)#

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)#

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int#

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int#

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)#

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)#

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)#

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)#

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)#

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)#

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool#

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)#

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()#

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()#

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)#

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()#

Return a copy of the string converted to uppercase.

zfill(width, /)#

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

gateTypes#

class neuroml.nml.nml.gateTypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: str, Enum

GATE_FRACTIONAL = 'gateFractional'#
GATE_HH_INSTANTANEOUS = 'gateHHInstantaneous'#
GATE_H_HRATES = 'gateHHrates'#
GATE_H_HRATES_INF = 'gateHHratesInf'#
GATE_H_HRATES_TAU = 'gateHHratesTau'#
GATE_H_HRATES_TAU_INF = 'gateHHratesTauInf'#
GATE_H_HTAU_INF = 'gateHHtauInf'#
GATE_KS = 'gateKS'#
capitalize()#

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()#

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)#

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int#

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')#

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool#

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)#

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int#

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str#

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str#

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int#

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()#

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()#

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()#

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()#

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()#

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()#

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()#

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()#

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()#

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()#

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()#

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()#

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)#

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)#

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()#

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)#

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()#

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)#

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)#

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)#

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)#

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int#

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int#

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)#

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)#

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)#

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)#

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)#

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)#

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool#

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)#

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()#

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()#

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)#

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()#

Return a copy of the string converted to uppercase.

zfill(width, /)#

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.