brian2tools.nmlexport.supporting module¶
-
class
brian2tools.nmlexport.supporting.
NeuroMLPoissonGenerator
(poissid, average_rate)[source]¶ Bases:
object
Makes XML of spikeGeneratorPoisson for NeuroML2/LEMS simulation.
-
class
brian2tools.nmlexport.supporting.
NeuroMLSimpleNetwork
(id_)[source]¶ Bases:
object
NeuroMLSimpleNetwork class representing network tag in NeuroML syntax as a XML DOM representation.
-
class
brian2tools.nmlexport.supporting.
NeuroMLSimulation
(simid, target, length='1s', step='0.1ms')[source]¶ Bases:
object
NeuroMLSimulation class representing Simulation tag in NeuroML syntax as a XML DOM representation.
-
add_display
(dispid, title='', time_scale='1ms', xmin='0', xmax='1000', ymin='0', ymax='11')[source]¶ Adds a Display element to Simulation.
Parameters:
-
add_eventoutputfile
(outfileid, filename='recordings.spikes', format_='TIME_ID')[source]¶ Adds an EventOutputFile element to a recently added Display.
Parameters:
-
add_eventselection
(esid, select, event_port='spike')[source]¶ Adds an EventSelection element to a recently added EventOutputFile.
Parameters:
-
add_line
(linid, quantity, scale='1mV', time_scale='1ms')[source]¶ Adds a Line element to a recently added Display.
Parameters:
-
add_outputcolumn
(ocid, quantity)[source]¶ Adds an OutputColumn element to a recently added OutputFile tag.
Parameters:
-
add_outputfile
(outfileid, filename='recordings.dat')[source]¶ Adds an OutputFile to Simulation.
Parameters:
-
build
()[source]¶ Builds NeuroML DOM structure of Simulation. It returns DOM object or it can be accessed by object.simulation.
Returns: simulation – DOM representation of simulation. Return type: xml.minidom.dom
-
-
class
brian2tools.nmlexport.supporting.
NeuroMLTarget
(component)[source]¶ Bases:
object
Makes XML of target of NeuroML2/LEMS simulation.
-
brian2tools.nmlexport.supporting.
brian_unit_to_lems
(valunit)[source]¶ Returns string representation of LEMS unit where * is between value and unit e.g. “20. mV” -> “20.*mV”.
Parameters: valunit ( Quantity
orstr
) – text or brian2.Quantity representation of a value with unitReturns: valstr – string representation of LEMS unit Return type: str
-
brian2tools.nmlexport.supporting.
from_string
(rep)[source]¶ Returns
Quantity
object from text representation of a value.Parameters: rep ( str
) – text representation of a value with unitReturns: q – Brian Quantity object Return type: Quantity
-
brian2tools.nmlexport.supporting.
read_nml_dims
(nmlcdpath='')[source]¶ Read from
NeuroMLCoreDimensions.xml
all supported by LEMS dimensions and store it as a Python dict with name as a key and Brian2 unit as value.Parameters: nmlcdpath ( str
, optional) – Path to ‘NeuroMLCoreDimensions.xml’Returns: lems_dimenssions – Dictionary with LEMS dimensions. Return type: dict