Full NeuroML cell element with morphology, biophysics, and channel populations
NML2_SingleCompHHCell.nml
The recommended way to define a HH cell in NeuroML2: using the <cell> element with explicit morphology (segment), membrane properties (channel densities), and intracellular properties.
This is the canonical example for compatibility with multi-simulator export (NEURON, Brian2, NEST) via pyNeuroML.
import urllib.requesturl ="https://raw.githubusercontent.com/NeuroML/NeuroML2/master/examples/NML2_SingleCompHHCell.nml"with urllib.request.urlopen(url) as resp: text = resp.read().decode()# Show key structurein_cell =Falsefor line in text.split('\n'): stripped = line.strip()if'<cell 'in stripped or'<morphology'in stripped or\'<biophysicalProperties'in stripped or'<channelDensity'in stripped or\'<specificCapacitance'in stripped or'<initMembPotential'in stripped or\'</cell>'in stripped:print(stripped[:120])
The key difference: NeuroML’s <cell> format separates morphology, channels, and biophysics into composable elements. TVBO’s Dynamics flattens everything into a single ODE system.