From 3e0abbbcd0073e8e4019f6d278143756c31402fb Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 3 May 2023 12:46:48 +0100 Subject: [PATCH 1/6] chore: sync schema --- neuroml/nml/NeuroML_v2.3.xsd | 487 +++++++++++++++++++---------------- 1 file changed, 271 insertions(+), 216 deletions(-) diff --git a/neuroml/nml/NeuroML_v2.3.xsd b/neuroml/nml/NeuroML_v2.3.xsd index 2a281932..e9f3c4b6 100644 --- a/neuroml/nml/NeuroML_v2.3.xsd +++ b/neuroml/nml/NeuroML_v2.3.xsd @@ -318,6 +318,10 @@ + + + + @@ -357,6 +361,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Float value restricted to between 1 and 0 @@ -532,7 +587,7 @@ 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 \n -:param conductance: +:param conductance: :type conductance: conductance @@ -552,7 +607,7 @@ 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. \n -:param conductance: +:param conductance: :type conductance: conductance @@ -579,7 +634,7 @@ 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. \n -:param conductance: +:param conductance: :type conductance: conductance @@ -592,9 +647,9 @@ 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. \n -:param vShift: +:param vShift: :type vShift: voltage -:param conductance: +:param conductance: :type conductance: conductance @@ -616,9 +671,9 @@ 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** \n -:param q10Factor: +:param q10Factor: :type q10Factor: none -:param experimentalTemp: +:param experimentalTemp: :type experimentalTemp: temperature @@ -646,7 +701,7 @@ A **KSState** with **relativeConductance** of 0 \n -:param relativeConductance: +:param relativeConductance: :type relativeConductance: none @@ -661,7 +716,7 @@ A **KSState** with **relativeConductance** of 1 \n -:param relativeConductance: +:param relativeConductance: :type relativeConductance: none @@ -730,7 +785,7 @@ A gate which consists of multiple **KSState** s and **KSTransition** s giving the rates of transition between them \n -:param instances: +:param instances: :type instances: none @@ -776,7 +831,7 @@ Gate which follows the general Hodgkin Huxley formalism \n -:param instances: +:param instances: :type instances: none @@ -798,7 +853,7 @@ Gate which follows the general Hodgkin Huxley formalism \n -:param instances: +:param instances: :type instances: none @@ -820,7 +875,7 @@ Gate which follows the general Hodgkin Huxley formalism \n -:param instances: +:param instances: :type instances: none @@ -844,7 +899,7 @@ Gate which follows the general Hodgkin Huxley formalism \n -:param instances: +:param instances: :type instances: none @@ -867,7 +922,7 @@ Gate which follows the general Hodgkin Huxley formalism \n -:param instances: +:param instances: :type instances: none @@ -890,7 +945,7 @@ Gate which follows the general Hodgkin Huxley formalism but is instantaneous, so tau = 0 and gate follows exactly inf value \n -:param instances: +:param instances: :type instances: none @@ -910,7 +965,7 @@ Gate composed of subgates contributing with fractional conductance \n -:param instances: +:param instances: :type instances: none @@ -988,11 +1043,11 @@ Model of an intracellular buffering mechanism for **ion** ( currently hard Coded to be calcium, due to requirement for **iCa** ) which has a baseline level **restingConc** and tends to this value with time course **decayConstant.** The ion is assumed to occupy a shell inside the membrane of thickness **shellThickness.** \n -:param restingConc: +:param restingConc: :type restingConc: concentration -:param decayConstant: +:param decayConstant: :type decayConstant: time -:param shellThickness: +:param shellThickness: :type shellThickness: length @@ -1013,11 +1068,11 @@ Model of buffering of concentration of an ion ( currently hard coded to be calcium, due to requirement for **iCa** ) which has a baseline level **restingConc** and tends to this value with time course **decayConstant.** A fixed factor **rho** is used to scale the incoming current *independently of the size of the compartment* to produce a concentration change. \n -:param restingConc: +:param restingConc: :type restingConc: concentration -:param decayConstant: +:param decayConstant: :type decayConstant: time -:param rho: +:param rho: :type rho: rho_factor @@ -1113,7 +1168,7 @@ Gap junction/single electrical connection \n -:param conductance: +:param conductance: :type conductance: conductance @@ -1139,7 +1194,7 @@ Behaves just like a one way gap junction. \n -:param conductance: +:param conductance: :type conductance: conductance @@ -1154,7 +1209,7 @@ Graded/analog synapse. Based on synapse in Methods of http://www. nature.com/neuro/journal/v7/n12/abs/nn1352.html \n -:param conductance: +:param conductance: :type conductance: conductance :param delta: Slope of the activation curve :type delta: voltage @@ -1237,9 +1292,9 @@ Ohmic synapse model whose conductance waveform on receiving an event has a rise time of **tauRise** and a decay time of **tauDecay.** Max conductance reached during this time ( assuming zero conductance before ) is **gbase** * **weight.** \n -:param tauRise: +:param tauRise: :type tauRise: time -:param tauDecay: +:param tauDecay: :type tauDecay: time :param gbase: Baseline conductance, generally the maximum conductance following a single spike :type gbase: conductance @@ -1259,11 +1314,11 @@ Ohmic synapse similar to expTwoSynapse but consisting of two components that can differ in decay times and max conductances but share the same rise time. \n -:param tauRise: +:param tauRise: :type tauRise: time -:param tauDecay1: +:param tauDecay1: :type tauDecay1: time -:param tauDecay2: +:param tauDecay2: :type tauDecay2: time :param gbase1: Baseline conductance 1 :type gbase1: conductance @@ -1300,9 +1355,9 @@ Biexponential synapse that allows for optional block and plasticity mechanisms, which can be expressed as child elements. \n -:param tauRise: +:param tauRise: :type tauRise: time -:param tauDecay: +:param tauDecay: :type tauDecay: time :param gbase: Baseline conductance, generally the maximum conductance following a single spike :type gbase: conductance @@ -1370,9 +1425,9 @@ Integrate and fire cell which returns to its leak reversal potential of **leakReversal** with a time constant **tau** \n -:param leakReversal: +:param leakReversal: :type leakReversal: voltage -:param tau: +:param tau: :type tau: time :param thresh: The membrane potential at which to emit a spiking event and reset voltage :type thresh: voltage @@ -1394,11 +1449,11 @@ Integrate and fire cell which returns to its leak reversal potential of **leakReversal** with a time course **tau.** It has a refractory period of **refract** after spiking \n -:param refract: +:param refract: :type refract: time -:param leakReversal: +:param leakReversal: :type leakReversal: voltage -:param tau: +:param tau: :type tau: time :param thresh: The membrane potential at which to emit a spiking event and reset voltage :type thresh: voltage @@ -1417,13 +1472,13 @@ Integrate and fire cell with capacitance **C,** **leakConductance** and **leakReversal** \n -:param leakConductance: +:param leakConductance: :type leakConductance: conductance -:param leakReversal: +:param leakReversal: :type leakReversal: voltage -:param thresh: +:param thresh: :type thresh: voltage -:param reset: +:param reset: :type reset: voltage :param C: Total capacitance of the cell membrane :type C: capacitance @@ -1444,15 +1499,15 @@ Integrate and fire cell with capacitance **C,** **leakConductance,** **leakReversal** and refractory period **refract** \n -:param refract: +:param refract: :type refract: time -:param leakConductance: +:param leakConductance: :type leakConductance: conductance -:param leakReversal: +:param leakReversal: :type leakReversal: voltage -:param thresh: +:param thresh: :type thresh: voltage -:param reset: +:param reset: :type reset: voltage :param C: Total capacitance of the cell membrane :type C: capacitance @@ -1520,23 +1575,23 @@ Cell based on the modified Izhikevich model in Izhikevich 2007, Dynamical systems in neuroscience, MIT Press \n -:param v0: +:param v0: :type v0: voltage -:param k: +:param k: :type k: conductance_per_voltage -:param vr: +:param vr: :type vr: voltage -:param vt: +:param vt: :type vt: voltage -:param vpeak: +:param vpeak: :type vpeak: voltage -:param a: +:param a: :type a: per_time -:param b: +:param b: :type b: conductance -:param c: +:param c: :type c: voltage -:param d: +:param d: :type d: current :param C: Total capacitance of the cell membrane :type C: capacitance @@ -1561,25 +1616,25 @@ Model based on Brette R and Gerstner W ( 2005 ) Adaptive Exponential Integrate-and-Fire Model as an Effective Description of Neuronal Activity. J Neurophysiol 94:3637-3642 \n -:param gL: +:param gL: :type gL: conductance -:param EL: +:param EL: :type EL: voltage -:param VT: +:param VT: :type VT: voltage -:param thresh: +:param thresh: :type thresh: voltage -:param reset: +:param reset: :type reset: voltage -:param delT: +:param delT: :type delT: voltage -:param tauw: +:param tauw: :type tauw: time -:param refract: +:param refract: :type refract: time -:param a: +:param a: :type a: conductance -:param b: +:param b: :type b: current :param C: Total capacitance of the cell membrane :type C: capacitance @@ -1605,7 +1660,7 @@ Simple dimensionless model of spiking cell from FitzHugh and Nagumo. Superseded by **fitzHughNagumo1969Cell** ( See https://github.com/NeuroML/NeuroML2/issues/42 ) \n -:param I: +:param I: :type I: none @@ -1620,17 +1675,17 @@ The Fitzhugh Nagumo model is a two-dimensional simplification of the Hodgkin-Huxley model of spike generation in squid giant axons. This system was suggested by FitzHugh ( FitzHugh R. [1961]: Impulses and physiological states in theoretical models of nerve membrane. Biophysical J. 1:445-466 ), who called it " Bonhoeffer-van der Pol model ", and the equivalent circuit by Nagumo et al. ( Nagumo J. , Arimoto S. , and Yoshizawa S. [1962] An active pulse transmission line simulating nerve axon. Proc IRE. 50:2061-2070. 1962 ). This version corresponds to the one described in FitzHugh R. [1969]: Mathematical models of excitation and propagation in nerve. Chapter 1 ( pp. 1-85 in H. P. Schwan, ed. Biological Engineering, McGraw-Hill Book Co. , N. Y. ) \n -:param a: +:param a: :type a: none -:param b: +:param b: :type b: none :param I: plays the role of an external injected current :type I: none -:param phi: +:param phi: :type phi: none -:param V0: +:param V0: :type V0: none -:param W0: +:param W0: :type W0: none @@ -1650,47 +1705,47 @@ Reduced CA3 cell model from Pinsky and Rinzel 1994. See https://github.com/OpenSourceBrain/PinskyRinzelModel \n -:param iSoma: +:param iSoma: :type iSoma: currentDensity -:param iDend: +:param iDend: :type iDend: currentDensity -:param gLs: +:param gLs: :type gLs: conductanceDensity -:param gLd: +:param gLd: :type gLd: conductanceDensity -:param gNa: +:param gNa: :type gNa: conductanceDensity -:param gKdr: +:param gKdr: :type gKdr: conductanceDensity -:param gCa: +:param gCa: :type gCa: conductanceDensity -:param gKahp: +:param gKahp: :type gKahp: conductanceDensity -:param gKC: +:param gKC: :type gKC: conductanceDensity -:param gc: +:param gc: :type gc: conductanceDensity -:param eNa: +:param eNa: :type eNa: voltage -:param eCa: +:param eCa: :type eCa: voltage -:param eK: +:param eK: :type eK: voltage -:param eL: +:param eL: :type eL: voltage -:param pp: +:param pp: :type pp: none -:param cm: +:param cm: :type cm: specificCapacitance -:param alphac: +:param alphac: :type alphac: none -:param betac: +:param betac: :type betac: none -:param gNmda: +:param gNmda: :type gNmda: conductanceDensity -:param gAmpa: +:param gAmpa: :type gAmpa: conductanceDensity -:param qd0: +:param qd0: :type qd0: none @@ -2013,7 +2068,7 @@ Membrane potential at which to emit a spiking event. Note, usually the spiking event will not be emitted again until the membrane potential has fallen below this value and rises again to cross it in a positive direction \n -:param value: +:param value: :type value: voltage @@ -2029,7 +2084,7 @@ Capacitance per unit area \n -:param value: +:param value: :type value: specificCapacitance @@ -2045,7 +2100,7 @@ Explicitly set initial membrane potential for the cell \n -:param value: +:param value: :type value: voltage @@ -2061,7 +2116,7 @@ The resistivity, or specific axial resistance, of the cytoplasm \n -:param value: +:param value: :type value: resistivity @@ -2167,7 +2222,7 @@ \n :param erev: The reversal potential of the current produced :type erev: voltage -:param condDensity: +:param condDensity: :type condDensity: conductanceDensity @@ -2194,11 +2249,11 @@ Same as **channelDensity** , 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. \n -:param vShift: +:param vShift: :type vShift: voltage :param erev: The reversal potential of the current produced :type erev: voltage -:param condDensity: +:param condDensity: :type condDensity: conductanceDensity @@ -2213,7 +2268,7 @@ Specifies a time varying conductance density, **gDensity,** which is distributed on an area of the **cell,** producing a current density **iDensity** and whose reversal potential is calculated from the Nernst equation. Hard coded for Ca only! See https://github.com/OpenSourceBrain/ghk-nernst. \n -:param condDensity: +:param condDensity: :type condDensity: conductanceDensity @@ -2239,7 +2294,7 @@ This component is similar to the original component type **channelDensityNernst** but it is changed in order to have a reversal potential that depends on a second independent Ca++ pool ( ca2 ). See https://github.com/OpenSourceBrain/ghk-nernst. \n -:param condDensity: +:param condDensity: :type condDensity: conductanceDensity @@ -2254,7 +2309,7 @@ Specifies a time varying conductance density, **gDensity,** which is distributed on an area of the cell, producing a current density **iDensity** and whose reversal potential is calculated from the Goldman Hodgkin Katz equation. Hard coded for Ca only! See https://github.com/OpenSourceBrain/ghk-nernst. \n -:param permeability: +:param permeability: :type permeability: permeability @@ -2277,7 +2332,7 @@ Time varying conductance density, **gDensity,** which is distributed on an area of the cell, producing a current density **iDensity.** Modified version of Jaffe et al. 1994 ( used also in Lawrence et al. 2006 ). See https://github.com/OpenSourceBrain/ghk-nernst. \n -:param condDensity: +:param condDensity: :type condDensity: conductanceDensity @@ -2336,9 +2391,9 @@ Description of a chemical species identified by **ion,** which has internal, **concentration,** and external, **extConcentration** values for its concentration \n -:param initialConcentration: +:param initialConcentration: :type initialConcentration: concentration -:param initialExtConcentration: +:param initialExtConcentration: :type initialExtConcentration: concentration @@ -2793,11 +2848,11 @@ Poisson spike generator firing at **averageRate** after a **delay** and for a **duration,** connected to single **synapse** that is triggered every time a spike is generated, providing an input current. Similar to ComponentType **poissonFiringSynapse** . \n -:param averageRate: +:param averageRate: :type averageRate: per_time -:param delay: +:param delay: :type delay: time -:param duration: +:param duration: :type duration: time @@ -2995,11 +3050,11 @@ Specifies the ( x, y, z ) location of a single **instance** of a component in a **population** \n -:param x: +:param x: :type x: none -:param y: +:param y: :type y: none -:param z: +:param z: :type z: none @@ -3121,9 +3176,9 @@ Event connection between named components, which gets processed via a new instance of a synapse component which is created on the target component, includes setting of **weight** and **delay** for the synaptic connection \n -:param weight: +:param weight: :type weight: none -:param delay: +:param delay: :type delay: time @@ -3174,7 +3229,7 @@ To enable connections between populations through gap junctions. Populations need to be of type **populationList** and contain **instance** and **location** elements. Includes setting of **weight** for the connection \n -:param weight: +:param weight: :type weight: none @@ -3225,7 +3280,7 @@ An instance of a connection in a **continuousProjection** between **presynapticPopulation** to another **postsynapticPopulation** through a **preComponent** at the start and **postComponent** at the end. Populations need to be of type **populationList** and contain **instance** and **location** elements. Can be used for analog synapses. Includes setting of **weight** for the connection \n -:param weight: +:param weight: :type weight: none @@ -3283,7 +3338,7 @@ Specifies input lists. Can set **weight** to scale individual inputs. \n -:param weight: +:param weight: :type weight: none @@ -3301,15 +3356,15 @@ Base type of any PyNN standard cell model. Note: membrane potential **v** has dimensions voltage, but all other parameters are dimensionless. This is to facilitate translation to and from PyNN scripts in Python, where these parameters have implicit units, see http://neuralensemble.org/trac/PyNN/wiki/StandardModels \n -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3328,25 +3383,25 @@ Base type of any PyNN standard integrate and fire model \n -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3369,25 +3424,25 @@ :type e_rev_E: none :param e_rev_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type e_rev_I: none -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3403,25 +3458,25 @@ Leaky integrate and fire model with fixed threshold and alpha-function-shaped post-synaptic current \n -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3435,25 +3490,25 @@ Leaky integrate and fire model with fixed threshold and decaying-exponential post-synaptic current \n -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3471,25 +3526,25 @@ :type e_rev_E: none :param e_rev_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type e_rev_I: none -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3507,25 +3562,25 @@ :type e_rev_E: none :param e_rev_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type e_rev_I: none -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3539,39 +3594,39 @@ Adaptive exponential integrate and fire neuron according to Brette R and Gerstner W ( 2005 ) with exponentially-decaying post-synaptic conductance \n -:param v_spike: +:param v_spike: :type v_spike: none -:param delta_T: +:param delta_T: :type delta_T: none -:param tau_w: +:param tau_w: :type tau_w: none -:param a: +:param a: :type a: none -:param b: +:param b: :type b: none :param e_rev_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type e_rev_E: none :param e_rev_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type e_rev_I: none -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3590,39 +3645,39 @@ Adaptive exponential integrate and fire neuron according to Brette R and Gerstner W ( 2005 ) with alpha-function-shaped post-synaptic conductance \n -:param v_spike: +:param v_spike: :type v_spike: none -:param delta_T: +:param delta_T: :type delta_T: none -:param tau_w: +:param tau_w: :type tau_w: none -:param a: +:param a: :type a: none -:param b: +:param b: :type b: none :param e_rev_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type e_rev_E: none :param e_rev_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type e_rev_I: none -:param tau_refrac: +:param tau_refrac: :type tau_refrac: none -:param v_thresh: +:param v_thresh: :type v_thresh: none -:param tau_m: +:param tau_m: :type tau_m: none -:param v_rest: +:param v_rest: :type v_rest: none -:param v_reset: +:param v_reset: :type v_reset: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3636,33 +3691,33 @@ Single-compartment Hodgkin-Huxley-type neuron with transient sodium and delayed-rectifier potassium currents using the ion channel models from Traub. \n -:param gbar_K: +:param gbar_K: :type gbar_K: none -:param gbar_Na: +:param gbar_Na: :type gbar_Na: none -:param g_leak: +:param g_leak: :type g_leak: none -:param e_rev_K: +:param e_rev_K: :type e_rev_K: none -:param e_rev_Na: +:param e_rev_Na: :type e_rev_Na: none -:param e_rev_leak: +:param e_rev_leak: :type e_rev_leak: none -:param v_offset: +:param v_offset: :type v_offset: none -:param e_rev_E: +:param e_rev_E: :type e_rev_E: none -:param e_rev_I: +:param e_rev_I: :type e_rev_I: none -:param cm: +:param cm: :type cm: none -:param i_offset: +:param i_offset: :type i_offset: none :param tau_syn_E: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_E: none :param tau_syn_I: This parameter is never used in the NeuroML2 description of this cell! Any synapse producing a current can be placed on this cell :type tau_syn_I: none -:param v_init: +:param v_init: :type v_init: none @@ -3685,7 +3740,7 @@ Base type for all PyNN synapses. Note, the current **I** produced is dimensionless, but it requires a membrane potential **v** with dimension voltage \n -:param tau_syn: +:param tau_syn: :type tau_syn: none @@ -3700,9 +3755,9 @@ Conductance based synapse with instantaneous rise and single exponential decay ( with time constant tau_syn ) \n -:param e_rev: +:param e_rev: :type e_rev: none -:param tau_syn: +:param tau_syn: :type tau_syn: none @@ -3717,9 +3772,9 @@ Alpha synapse: rise time and decay time are both tau_syn. Conductance based synapse. \n -:param e_rev: +:param e_rev: :type e_rev: none -:param tau_syn: +:param tau_syn: :type tau_syn: none @@ -3734,7 +3789,7 @@ Current based synapse with instantaneous rise and single exponential decay ( with time constant tau_syn ) \n -:param tau_syn: +:param tau_syn: :type tau_syn: none @@ -3749,7 +3804,7 @@ Alpha synapse: rise time and decay time are both tau_syn. Current based synapse. \n -:param tau_syn: +:param tau_syn: :type tau_syn: none @@ -3764,11 +3819,11 @@ Spike source, generating spikes according to a Poisson process. \n -:param start: +:param start: :type start: time -:param duration: +:param duration: :type duration: time -:param rate: +:param rate: :type rate: per_time From 7af3db916f211fd3d26380bb7ab276503caedbf2 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 3 May 2023 12:48:07 +0100 Subject: [PATCH 2/6] chore(nml.py): regenerate --- neuroml/nml/nml.py | 1896 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1893 insertions(+), 3 deletions(-) diff --git a/neuroml/nml/nml.py b/neuroml/nml/nml.py index 0bc54f0d..c235960b 100644 --- a/neuroml/nml/nml.py +++ b/neuroml/nml/nml.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Generated Wed Apr 26 10:50:48 2023 by generateDS.py version 2.41.3. +# Generated Wed May 3 12:43:16 2023 by generateDS.py version 2.41.3. # Python 3.10.11 (main, Apr 5 2023, 00:00:00) [GCC 13.0.1 20230404 (Red Hat 13.0.1-0)] # # Command line options: @@ -1185,6 +1185,11 @@ class PlasticityTypes(str, Enum): TSODYKS_MARKRAM_DEP_FAC_MECHANISM = "tsodyksMarkramDepFacMechanism" +class TrueOrFalse(str, Enum): + TRUE = "true" + FALSE = "false" + + class ZeroOrOne(str, Enum): """ZeroOrOne -- Value which is either 0 or 1""" @@ -1996,6 +2001,53 @@ class Dynamics(GeneratedsSuper): }, None, ), + MemberSpec_( + "OnStart", + "OnStart", + 0, + 1, + {"maxOccurs": "1", "minOccurs": "0", "name": "OnStart", "type": "OnStart"}, + None, + ), + MemberSpec_( + "OnEvent", + "OnEvent", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "OnEvent", + "type": "OnEvent", + }, + None, + ), + MemberSpec_( + "OnCondition", + "OnCondition", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "OnCondition", + "type": "OnCondition", + }, + None, + ), + MemberSpec_( + "Regime", + "Regime", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "Regime", + "type": "Regime", + }, + None, + ), ] subclass = None superclass = None @@ -2006,6 +2058,10 @@ def __init__( DerivedVariable: "list of DerivedVariable(s) (optional)" = None, ConditionalDerivedVariable: "list of ConditionalDerivedVariable(s) (optional)" = None, TimeDerivative: "list of TimeDerivative(s) (optional)" = None, + OnStart: "a OnStart (optional)" = None, + OnEvent: "list of OnEvent(s) (optional)" = None, + OnCondition: "list of OnCondition(s) (optional)" = None, + Regime: "list of Regime(s) (optional)" = None, gds_collector_=None, **kwargs_, ): @@ -2034,6 +2090,23 @@ def __init__( else: self.TimeDerivative = TimeDerivative self.TimeDerivative_nsprefix_ = None + self.OnStart = OnStart + self.OnStart_nsprefix_ = None + if OnEvent is None: + self.OnEvent = [] + else: + self.OnEvent = OnEvent + self.OnEvent_nsprefix_ = None + if OnCondition is None: + self.OnCondition = [] + else: + self.OnCondition = OnCondition + self.OnCondition_nsprefix_ = None + if Regime is None: + self.Regime = [] + else: + self.Regime = Regime + self.Regime_nsprefix_ = None def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: @@ -2053,6 +2126,10 @@ def _hasContent(self): or self.DerivedVariable or self.ConditionalDerivedVariable or self.TimeDerivative + or self.OnStart is not None + or self.OnEvent + or self.OnCondition + or self.Regime ): return True else: @@ -2181,6 +2258,62 @@ def _exportChildren( name_="TimeDerivative", pretty_print=pretty_print, ) + if self.OnStart is not None: + namespaceprefix_ = ( + self.OnStart_nsprefix_ + ":" + if (UseCapturedNS_ and self.OnStart_nsprefix_) + else "" + ) + self.OnStart.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="OnStart", + pretty_print=pretty_print, + ) + for OnEvent_ in self.OnEvent: + namespaceprefix_ = ( + self.OnEvent_nsprefix_ + ":" + if (UseCapturedNS_ and self.OnEvent_nsprefix_) + else "" + ) + OnEvent_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="OnEvent", + pretty_print=pretty_print, + ) + for OnCondition_ in self.OnCondition: + namespaceprefix_ = ( + self.OnCondition_nsprefix_ + ":" + if (UseCapturedNS_ and self.OnCondition_nsprefix_) + else "" + ) + OnCondition_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="OnCondition", + pretty_print=pretty_print, + ) + for Regime_ in self.Regime: + namespaceprefix_ = ( + self.Regime_nsprefix_ + ":" + if (UseCapturedNS_ and self.Regime_nsprefix_) + else "" + ) + Regime_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="Regime", + pretty_print=pretty_print, + ) def validate_(self, gds_collector, recursive=False): self.gds_collector_ = gds_collector @@ -2203,6 +2336,16 @@ def validate_(self, gds_collector, recursive=False): self.gds_check_cardinality_( self.TimeDerivative, "TimeDerivative", min_occurs=0, max_occurs=9999999 ) + self.gds_check_cardinality_(self.OnStart, "OnStart", min_occurs=0, max_occurs=1) + self.gds_check_cardinality_( + self.OnEvent, "OnEvent", min_occurs=0, max_occurs=9999999 + ) + self.gds_check_cardinality_( + self.OnCondition, "OnCondition", min_occurs=0, max_occurs=9999999 + ) + self.gds_check_cardinality_( + self.Regime, "Regime", min_occurs=0, max_occurs=9999999 + ) if recursive: for item in self.StateVariable: item.validate_(gds_collector, recursive=True) @@ -2212,6 +2355,14 @@ def validate_(self, gds_collector, recursive=False): item.validate_(gds_collector, recursive=True) for item in self.TimeDerivative: item.validate_(gds_collector, recursive=True) + if self.OnStart is not None: + self.OnStart.validate_(gds_collector, recursive=True) + for item in self.OnEvent: + item.validate_(gds_collector, recursive=True) + for item in self.OnCondition: + item.validate_(gds_collector, recursive=True) + for item in self.Regime: + item.validate_(gds_collector, recursive=True) return message_count == len(self.gds_collector_.get_messages()) def build(self, node, gds_collector_=None): @@ -2252,6 +2403,26 @@ def _buildChildren( obj_.build(child_, gds_collector_=gds_collector_) self.TimeDerivative.append(obj_) obj_.original_tagname_ = "TimeDerivative" + elif nodeName_ == "OnStart": + obj_ = OnStart.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.OnStart = obj_ + obj_.original_tagname_ = "OnStart" + elif nodeName_ == "OnEvent": + obj_ = OnEvent.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.OnEvent.append(obj_) + obj_.original_tagname_ = "OnEvent" + elif nodeName_ == "OnCondition": + obj_ = OnCondition.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.OnCondition.append(obj_) + obj_.original_tagname_ = "OnCondition" + elif nodeName_ == "Regime": + obj_ = Regime.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.Regime.append(obj_) + obj_.original_tagname_ = "Regime" # end class Dynamics @@ -2622,6 +2793,1709 @@ def _buildChildren( # end class TimeDerivative +class OnStart(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_( + "StateAssignment", + "StateAssignment", + 1, + 0, + { + "maxOccurs": "unbounded", + "minOccurs": "1", + "name": "StateAssignment", + "type": "StateAssignment", + }, + None, + ), + ] + subclass = None + superclass = None + + def __init__( + self, + StateAssignment: "list of StateAssignment(s) (required)" = None, + gds_collector_=None, + **kwargs_, + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + if StateAssignment is None: + self.StateAssignment = [] + else: + self.StateAssignment = StateAssignment + self.StateAssignment_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, OnStart) + if subclass is not None: + return subclass(*args_, **kwargs_) + if OnStart.subclass: + return OnStart.subclass(*args_, **kwargs_) + else: + return OnStart(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if self.StateAssignment: + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnStart", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("OnStart") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "OnStart": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="OnStart" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="OnStart", + pretty_print=pretty_print, + ) + showIndent(outfile, level, pretty_print) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, outfile, level, already_processed, namespaceprefix_="", name_="OnStart" + ): + pass + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnStart", + fromsubclass_=False, + pretty_print=True, + ): + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + for StateAssignment_ in self.StateAssignment: + namespaceprefix_ = ( + self.StateAssignment_nsprefix_ + ":" + if (UseCapturedNS_ and self.StateAssignment_nsprefix_) + else "" + ) + StateAssignment_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="StateAssignment", + pretty_print=pretty_print, + ) + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + # validate simple type children + # validate complex type children + self.gds_check_cardinality_( + self.StateAssignment, "StateAssignment", min_occurs=1, max_occurs=9999999 + ) + if recursive: + for item in self.StateAssignment: + item.validate_(gds_collector, recursive=True) + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + pass + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + if nodeName_ == "StateAssignment": + obj_ = StateAssignment.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.StateAssignment.append(obj_) + obj_.original_tagname_ = "StateAssignment" + + +# end class OnStart + + +class StateAssignment(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_( + "variable", "xs:string", 0, 0, {"use": "required", "name": "variable"} + ), + MemberSpec_("value", "xs:string", 0, 0, {"use": "required", "name": "value"}), + ] + subclass = None + superclass = None + + def __init__( + self, + variable: "a string (required)" = None, + value: "a string (required)" = None, + gds_collector_=None, + **kwargs_, + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + self.variable = _cast(None, variable) + self.variable_nsprefix_ = None + self.value = _cast(None, value) + self.value_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, StateAssignment) + if subclass is not None: + return subclass(*args_, **kwargs_) + if StateAssignment.subclass: + return StateAssignment.subclass(*args_, **kwargs_) + else: + return StateAssignment(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if (): + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="StateAssignment", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("StateAssignment") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "StateAssignment": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="StateAssignment" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="StateAssignment", + pretty_print=pretty_print, + ) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, + outfile, + level, + already_processed, + namespaceprefix_="", + name_="StateAssignment", + ): + if self.variable is not None and "variable" not in already_processed: + already_processed.add("variable") + outfile.write( + " variable=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.variable), input_name="variable" + ) + ), + ) + ) + if self.value is not None and "value" not in already_processed: + already_processed.add("value") + outfile.write( + " value=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.value), input_name="value" + ) + ), + ) + ) + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="StateAssignment", + fromsubclass_=False, + pretty_print=True, + ): + pass + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + self.gds_validate_builtin_ST_( + self.gds_validate_string, self.variable, "variable" + ) + self.gds_check_cardinality_(self.variable, "variable", required=True) + self.gds_validate_builtin_ST_(self.gds_validate_string, self.value, "value") + self.gds_check_cardinality_(self.value, "value", required=True) + # validate simple type children + # validate complex type children + if recursive: + pass + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + value = find_attr_value_("variable", node) + if value is not None and "variable" not in already_processed: + already_processed.add("variable") + self.variable = value + value = find_attr_value_("value", node) + if value is not None and "value" not in already_processed: + already_processed.add("value") + self.value = value + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + pass + + +# end class StateAssignment + + +class OnEvent(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_("port", "xs:string", 0, 0, {"use": "required", "name": "port"}), + MemberSpec_( + "StateAssignment", + "StateAssignment", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "StateAssignment", + "type": "StateAssignment", + }, + None, + ), + MemberSpec_( + "EventOut", + "EventOut", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "EventOut", + "type": "EventOut", + }, + None, + ), + ] + subclass = None + superclass = None + + def __init__( + self, + port: "a string (required)" = None, + StateAssignment: "list of StateAssignment(s) (optional)" = None, + EventOut: "list of EventOut(s) (optional)" = None, + gds_collector_=None, + **kwargs_, + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + self.port = _cast(None, port) + self.port_nsprefix_ = None + if StateAssignment is None: + self.StateAssignment = [] + else: + self.StateAssignment = StateAssignment + self.StateAssignment_nsprefix_ = None + if EventOut is None: + self.EventOut = [] + else: + self.EventOut = EventOut + self.EventOut_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, OnEvent) + if subclass is not None: + return subclass(*args_, **kwargs_) + if OnEvent.subclass: + return OnEvent.subclass(*args_, **kwargs_) + else: + return OnEvent(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if self.StateAssignment or self.EventOut: + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnEvent", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("OnEvent") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "OnEvent": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="OnEvent" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="OnEvent", + pretty_print=pretty_print, + ) + showIndent(outfile, level, pretty_print) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, outfile, level, already_processed, namespaceprefix_="", name_="OnEvent" + ): + if self.port is not None and "port" not in already_processed: + already_processed.add("port") + outfile.write( + " port=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.port), input_name="port" + ) + ), + ) + ) + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnEvent", + fromsubclass_=False, + pretty_print=True, + ): + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + for StateAssignment_ in self.StateAssignment: + namespaceprefix_ = ( + self.StateAssignment_nsprefix_ + ":" + if (UseCapturedNS_ and self.StateAssignment_nsprefix_) + else "" + ) + StateAssignment_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="StateAssignment", + pretty_print=pretty_print, + ) + for EventOut_ in self.EventOut: + namespaceprefix_ = ( + self.EventOut_nsprefix_ + ":" + if (UseCapturedNS_ and self.EventOut_nsprefix_) + else "" + ) + EventOut_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="EventOut", + pretty_print=pretty_print, + ) + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + self.gds_validate_builtin_ST_(self.gds_validate_string, self.port, "port") + self.gds_check_cardinality_(self.port, "port", required=True) + # validate simple type children + # validate complex type children + self.gds_check_cardinality_( + self.StateAssignment, "StateAssignment", min_occurs=0, max_occurs=9999999 + ) + self.gds_check_cardinality_( + self.EventOut, "EventOut", min_occurs=0, max_occurs=9999999 + ) + if recursive: + for item in self.StateAssignment: + item.validate_(gds_collector, recursive=True) + for item in self.EventOut: + item.validate_(gds_collector, recursive=True) + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + value = find_attr_value_("port", node) + if value is not None and "port" not in already_processed: + already_processed.add("port") + self.port = value + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + if nodeName_ == "StateAssignment": + obj_ = StateAssignment.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.StateAssignment.append(obj_) + obj_.original_tagname_ = "StateAssignment" + elif nodeName_ == "EventOut": + obj_ = EventOut.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.EventOut.append(obj_) + obj_.original_tagname_ = "EventOut" + + +# end class OnEvent + + +class EventOut(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_("port", "xs:string", 0, 0, {"use": "required", "name": "port"}), + ] + subclass = None + superclass = None + + def __init__( + self, port: "a string (required)" = None, gds_collector_=None, **kwargs_ + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + self.port = _cast(None, port) + self.port_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, EventOut) + if subclass is not None: + return subclass(*args_, **kwargs_) + if EventOut.subclass: + return EventOut.subclass(*args_, **kwargs_) + else: + return EventOut(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if (): + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="EventOut", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("EventOut") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "EventOut": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="EventOut" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="EventOut", + pretty_print=pretty_print, + ) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, outfile, level, already_processed, namespaceprefix_="", name_="EventOut" + ): + if self.port is not None and "port" not in already_processed: + already_processed.add("port") + outfile.write( + " port=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.port), input_name="port" + ) + ), + ) + ) + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="EventOut", + fromsubclass_=False, + pretty_print=True, + ): + pass + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + self.gds_validate_builtin_ST_(self.gds_validate_string, self.port, "port") + self.gds_check_cardinality_(self.port, "port", required=True) + # validate simple type children + # validate complex type children + if recursive: + pass + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + value = find_attr_value_("port", node) + if value is not None and "port" not in already_processed: + already_processed.add("port") + self.port = value + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + pass + + +# end class EventOut + + +class OnCondition(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_("test", "xs:string", 0, 0, {"use": "required", "name": "test"}), + MemberSpec_( + "StateAssignment", + "StateAssignment", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "StateAssignment", + "type": "StateAssignment", + }, + None, + ), + MemberSpec_( + "EventOut", + "EventOut", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "EventOut", + "type": "EventOut", + }, + None, + ), + MemberSpec_( + "Transition", + "Transition", + 0, + 1, + { + "maxOccurs": "1", + "minOccurs": "0", + "name": "Transition", + "type": "Transition", + }, + None, + ), + ] + subclass = None + superclass = None + + def __init__( + self, + test: "a string (required)" = None, + StateAssignment: "list of StateAssignment(s) (optional)" = None, + EventOut: "list of EventOut(s) (optional)" = None, + Transition: "a Transition (optional)" = None, + gds_collector_=None, + **kwargs_, + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + self.test = _cast(None, test) + self.test_nsprefix_ = None + if StateAssignment is None: + self.StateAssignment = [] + else: + self.StateAssignment = StateAssignment + self.StateAssignment_nsprefix_ = None + if EventOut is None: + self.EventOut = [] + else: + self.EventOut = EventOut + self.EventOut_nsprefix_ = None + self.Transition = Transition + self.Transition_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, OnCondition) + if subclass is not None: + return subclass(*args_, **kwargs_) + if OnCondition.subclass: + return OnCondition.subclass(*args_, **kwargs_) + else: + return OnCondition(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if self.StateAssignment or self.EventOut or self.Transition is not None: + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnCondition", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("OnCondition") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "OnCondition": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="OnCondition" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="OnCondition", + pretty_print=pretty_print, + ) + showIndent(outfile, level, pretty_print) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, + outfile, + level, + already_processed, + namespaceprefix_="", + name_="OnCondition", + ): + if self.test is not None and "test" not in already_processed: + already_processed.add("test") + outfile.write( + " test=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.test), input_name="test" + ) + ), + ) + ) + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnCondition", + fromsubclass_=False, + pretty_print=True, + ): + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + for StateAssignment_ in self.StateAssignment: + namespaceprefix_ = ( + self.StateAssignment_nsprefix_ + ":" + if (UseCapturedNS_ and self.StateAssignment_nsprefix_) + else "" + ) + StateAssignment_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="StateAssignment", + pretty_print=pretty_print, + ) + for EventOut_ in self.EventOut: + namespaceprefix_ = ( + self.EventOut_nsprefix_ + ":" + if (UseCapturedNS_ and self.EventOut_nsprefix_) + else "" + ) + EventOut_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="EventOut", + pretty_print=pretty_print, + ) + if self.Transition is not None: + namespaceprefix_ = ( + self.Transition_nsprefix_ + ":" + if (UseCapturedNS_ and self.Transition_nsprefix_) + else "" + ) + self.Transition.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="Transition", + pretty_print=pretty_print, + ) + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + self.gds_validate_builtin_ST_(self.gds_validate_string, self.test, "test") + self.gds_check_cardinality_(self.test, "test", required=True) + # validate simple type children + # validate complex type children + self.gds_check_cardinality_( + self.StateAssignment, "StateAssignment", min_occurs=0, max_occurs=9999999 + ) + self.gds_check_cardinality_( + self.EventOut, "EventOut", min_occurs=0, max_occurs=9999999 + ) + self.gds_check_cardinality_( + self.Transition, "Transition", min_occurs=0, max_occurs=1 + ) + if recursive: + for item in self.StateAssignment: + item.validate_(gds_collector, recursive=True) + for item in self.EventOut: + item.validate_(gds_collector, recursive=True) + if self.Transition is not None: + self.Transition.validate_(gds_collector, recursive=True) + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + value = find_attr_value_("test", node) + if value is not None and "test" not in already_processed: + already_processed.add("test") + self.test = value + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + if nodeName_ == "StateAssignment": + obj_ = StateAssignment.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.StateAssignment.append(obj_) + obj_.original_tagname_ = "StateAssignment" + elif nodeName_ == "EventOut": + obj_ = EventOut.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.EventOut.append(obj_) + obj_.original_tagname_ = "EventOut" + elif nodeName_ == "Transition": + obj_ = Transition.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.Transition = obj_ + obj_.original_tagname_ = "Transition" + + +# end class OnCondition + + +class Transition(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_("regime", "xs:string", 0, 0, {"use": "required", "name": "regime"}), + ] + subclass = None + superclass = None + + def __init__( + self, regime: "a string (required)" = None, gds_collector_=None, **kwargs_ + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + self.regime = _cast(None, regime) + self.regime_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, Transition) + if subclass is not None: + return subclass(*args_, **kwargs_) + if Transition.subclass: + return Transition.subclass(*args_, **kwargs_) + else: + return Transition(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if (): + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="Transition", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("Transition") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "Transition": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="Transition" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="Transition", + pretty_print=pretty_print, + ) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, outfile, level, already_processed, namespaceprefix_="", name_="Transition" + ): + if self.regime is not None and "regime" not in already_processed: + already_processed.add("regime") + outfile.write( + " regime=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.regime), input_name="regime" + ) + ), + ) + ) + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="Transition", + fromsubclass_=False, + pretty_print=True, + ): + pass + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + self.gds_validate_builtin_ST_(self.gds_validate_string, self.regime, "regime") + self.gds_check_cardinality_(self.regime, "regime", required=True) + # validate simple type children + # validate complex type children + if recursive: + pass + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + value = find_attr_value_("regime", node) + if value is not None and "regime" not in already_processed: + already_processed.add("regime") + self.regime = value + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + pass + + +# end class Transition + + +class Regime(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_("name", "xs:string", 0, 0, {"use": "required", "name": "name"}), + MemberSpec_( + "initial", "TrueOrFalse", 0, 1, {"use": "optional", "name": "initial"} + ), + MemberSpec_( + "TimeDerivative", + "TimeDerivative", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "TimeDerivative", + "type": "TimeDerivative", + }, + None, + ), + MemberSpec_( + "OnEntry", + "OnEntry", + 0, + 1, + {"maxOccurs": "1", "minOccurs": "0", "name": "OnEntry", "type": "OnEntry"}, + None, + ), + MemberSpec_( + "OnCondition", + "OnCondition", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "OnCondition", + "type": "OnCondition", + }, + None, + ), + ] + subclass = None + superclass = None + + def __init__( + self, + name: "a string (required)" = None, + initial: "a TrueOrFalse (optional)" = None, + TimeDerivative: "list of TimeDerivative(s) (optional)" = None, + OnEntry: "a OnEntry (optional)" = None, + OnCondition: "list of OnCondition(s) (optional)" = None, + gds_collector_=None, + **kwargs_, + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + self.name = _cast(None, name) + self.name_nsprefix_ = None + self.initial = _cast(None, initial) + self.initial_nsprefix_ = None + if TimeDerivative is None: + self.TimeDerivative = [] + else: + self.TimeDerivative = TimeDerivative + self.TimeDerivative_nsprefix_ = None + self.OnEntry = OnEntry + self.OnEntry_nsprefix_ = None + if OnCondition is None: + self.OnCondition = [] + else: + self.OnCondition = OnCondition + self.OnCondition_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, Regime) + if subclass is not None: + return subclass(*args_, **kwargs_) + if Regime.subclass: + return Regime.subclass(*args_, **kwargs_) + else: + return Regime(*args_, **kwargs_) + + factory = staticmethod(factory) + + def validate_TrueOrFalse(self, value): + # Validate type TrueOrFalse, a restriction on xs:string. + if ( + value is not None + and Validate_simpletypes_ + and self.gds_collector_ is not None + ): + if not isinstance(value, str): + lineno = self.gds_get_node_lineno_() + self.gds_collector_.add_message( + 'Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' + % { + "value": value, + "lineno": lineno, + } + ) + return False + value = value + enumerations = ["true", "false"] + if value not in enumerations: + lineno = self.gds_get_node_lineno_() + self.gds_collector_.add_message( + 'Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on TrueOrFalse' + % {"value": encode_str_2_3(value), "lineno": lineno} + ) + result = False + + def _hasContent(self): + if self.TimeDerivative or self.OnEntry is not None or self.OnCondition: + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="Regime", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("Regime") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "Regime": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="Regime" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="Regime", + pretty_print=pretty_print, + ) + showIndent(outfile, level, pretty_print) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, outfile, level, already_processed, namespaceprefix_="", name_="Regime" + ): + if self.name is not None and "name" not in already_processed: + already_processed.add("name") + outfile.write( + " name=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.name), input_name="name" + ) + ), + ) + ) + if self.initial is not None and "initial" not in already_processed: + already_processed.add("initial") + outfile.write( + " initial=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.initial), input_name="initial" + ) + ), + ) + ) + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="Regime", + fromsubclass_=False, + pretty_print=True, + ): + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + for TimeDerivative_ in self.TimeDerivative: + namespaceprefix_ = ( + self.TimeDerivative_nsprefix_ + ":" + if (UseCapturedNS_ and self.TimeDerivative_nsprefix_) + else "" + ) + TimeDerivative_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="TimeDerivative", + pretty_print=pretty_print, + ) + if self.OnEntry is not None: + namespaceprefix_ = ( + self.OnEntry_nsprefix_ + ":" + if (UseCapturedNS_ and self.OnEntry_nsprefix_) + else "" + ) + self.OnEntry.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="OnEntry", + pretty_print=pretty_print, + ) + for OnCondition_ in self.OnCondition: + namespaceprefix_ = ( + self.OnCondition_nsprefix_ + ":" + if (UseCapturedNS_ and self.OnCondition_nsprefix_) + else "" + ) + OnCondition_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="OnCondition", + pretty_print=pretty_print, + ) + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + self.gds_validate_builtin_ST_(self.gds_validate_string, self.name, "name") + self.gds_check_cardinality_(self.name, "name", required=True) + self.gds_validate_defined_ST_( + self.validate_TrueOrFalse, self.initial, "initial" + ) + self.gds_check_cardinality_(self.initial, "initial", required=False) + # validate simple type children + # validate complex type children + self.gds_check_cardinality_( + self.TimeDerivative, "TimeDerivative", min_occurs=0, max_occurs=9999999 + ) + self.gds_check_cardinality_(self.OnEntry, "OnEntry", min_occurs=0, max_occurs=1) + self.gds_check_cardinality_( + self.OnCondition, "OnCondition", min_occurs=0, max_occurs=9999999 + ) + if recursive: + for item in self.TimeDerivative: + item.validate_(gds_collector, recursive=True) + if self.OnEntry is not None: + self.OnEntry.validate_(gds_collector, recursive=True) + for item in self.OnCondition: + item.validate_(gds_collector, recursive=True) + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + value = find_attr_value_("name", node) + if value is not None and "name" not in already_processed: + already_processed.add("name") + self.name = value + value = find_attr_value_("initial", node) + if value is not None and "initial" not in already_processed: + already_processed.add("initial") + self.initial = value + self.validate_TrueOrFalse(self.initial) # validate type TrueOrFalse + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + if nodeName_ == "TimeDerivative": + obj_ = TimeDerivative.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.TimeDerivative.append(obj_) + obj_.original_tagname_ = "TimeDerivative" + elif nodeName_ == "OnEntry": + obj_ = OnEntry.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.OnEntry = obj_ + obj_.original_tagname_ = "OnEntry" + elif nodeName_ == "OnCondition": + obj_ = OnCondition.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.OnCondition.append(obj_) + obj_.original_tagname_ = "OnCondition" + + +# end class Regime + + +class OnEntry(GeneratedsSuper): + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_( + "StateAssignment", + "StateAssignment", + 1, + 0, + { + "maxOccurs": "unbounded", + "minOccurs": "1", + "name": "StateAssignment", + "type": "StateAssignment", + }, + None, + ), + ] + subclass = None + superclass = None + + def __init__( + self, + StateAssignment: "list of StateAssignment(s) (required)" = None, + gds_collector_=None, + **kwargs_, + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + if StateAssignment is None: + self.StateAssignment = [] + else: + self.StateAssignment = StateAssignment + self.StateAssignment_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, OnEntry) + if subclass is not None: + return subclass(*args_, **kwargs_) + if OnEntry.subclass: + return OnEntry.subclass(*args_, **kwargs_) + else: + return OnEntry(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if self.StateAssignment: + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnEntry", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("OnEntry") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "OnEntry": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, level, already_processed, namespaceprefix_, name_="OnEntry" + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="OnEntry", + pretty_print=pretty_print, + ) + showIndent(outfile, level, pretty_print) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, outfile, level, already_processed, namespaceprefix_="", name_="OnEntry" + ): + pass + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_=' xmlns:None="http://www.neuroml.org/schema/neuroml2" ', + name_="OnEntry", + fromsubclass_=False, + pretty_print=True, + ): + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + for StateAssignment_ in self.StateAssignment: + namespaceprefix_ = ( + self.StateAssignment_nsprefix_ + ":" + if (UseCapturedNS_ and self.StateAssignment_nsprefix_) + else "" + ) + StateAssignment_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="StateAssignment", + pretty_print=pretty_print, + ) + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + # validate simple type children + # validate complex type children + self.gds_check_cardinality_( + self.StateAssignment, "StateAssignment", min_occurs=1, max_occurs=9999999 + ) + if recursive: + for item in self.StateAssignment: + item.validate_(gds_collector, recursive=True) + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + pass + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + if nodeName_ == "StateAssignment": + obj_ = StateAssignment.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.StateAssignment.append(obj_) + obj_.original_tagname_ = "StateAssignment" + + +# end class OnEntry + + class IncludeType(GeneratedsSuper): __hash__ = GeneratedsSuper.__hash__ member_data_items_ = [ @@ -18040,8 +19914,7 @@ def _buildChildren( class ChannelDensityGHK2(Base): - """ChannelDensityGHK2 -- Time varying conductance density, **gDensity,** which is distributed on an area of the cel - l, producing a current density **iDensity.** Modified version of Jaffe et al. 1994 ( used also in Lawrence et al. 2006 ). See https://github.com/OpenSourceBrain/ghk-nernst. + """ChannelDensityGHK2 -- Time varying conductance density, **gDensity,** which is distributed on an area of the cell, producing a current density **iDensity.** Modified version of Jaffe et al. 1994 ( used also in Lawrence et al. 2006 ). See https://github.com/OpenSourceBrain/ghk-nernst. \n :param condDensity: :type condDensity: conductanceDensity @@ -64930,6 +66803,7 @@ def main(): ("DoubleGreaterThanZero", "NeuroML_v2.3.xsd", "ST"), ("ZeroOrOne", "NeuroML_v2.3.xsd", "ST"), ("Notes", "NeuroML_v2.3.xsd", "ST"), + ("TrueOrFalse", "NeuroML_v2.3.xsd", "ST"), ("ZeroToOne", "NeuroML_v2.3.xsd", "ST"), ("channelTypes", "NeuroML_v2.3.xsd", "ST"), ("gateTypes", "NeuroML_v2.3.xsd", "ST"), @@ -64956,6 +66830,14 @@ def main(): ("ConditionalDerivedVariable", "NeuroML_v2.3.xsd", "CT"), ("Case", "NeuroML_v2.3.xsd", "CT"), ("TimeDerivative", "NeuroML_v2.3.xsd", "CT"), + ("OnStart", "NeuroML_v2.3.xsd", "CT"), + ("StateAssignment", "NeuroML_v2.3.xsd", "CT"), + ("OnEvent", "NeuroML_v2.3.xsd", "CT"), + ("EventOut", "NeuroML_v2.3.xsd", "CT"), + ("OnCondition", "NeuroML_v2.3.xsd", "CT"), + ("Transition", "NeuroML_v2.3.xsd", "CT"), + ("Regime", "NeuroML_v2.3.xsd", "CT"), + ("OnEntry", "NeuroML_v2.3.xsd", "CT"), ("NeuroMLDocument", "NeuroML_v2.3.xsd", "CT"), ("IncludeType", "NeuroML_v2.3.xsd", "CT"), ("IonChannelScalable", "NeuroML_v2.3.xsd", "CT"), @@ -65195,6 +67077,7 @@ def main(): "ElectricalConnectionInstance", "ElectricalConnectionInstanceW", "ElectricalProjection", + "EventOut", "ExpCondSynapse", "ExpCurrSynapse", "ExpOneSynapse", @@ -65264,6 +67147,10 @@ def main(): "NamedDimensionalVariable", "Network", "NeuroMLDocument", + "OnCondition", + "OnEntry", + "OnEvent", + "OnStart", "OpenState", "Parameter", "Path", @@ -65283,6 +67170,7 @@ def main(): "RampGeneratorDL", "RandomLayout", "ReactionScheme", + "Regime", "Region", "Requirement", "Resistivity", @@ -65307,6 +67195,7 @@ def main(): "SpikeSourcePoisson", "SpikeThresh", "Standalone", + "StateAssignment", "StateVariable", "SubTree", "SynapticConnection", @@ -65314,6 +67203,7 @@ def main(): "TimeDerivative", "TimedSynapticInput", "TransientPoissonFiringSynapse", + "Transition", "UnstructuredLayout", "VariableParameter", "VoltageClamp", From ff5994eac600cfdc5527c91377014daa0fac5568 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 3 May 2023 13:34:47 +0100 Subject: [PATCH 3/6] chore: sync schema --- neuroml/nml/NeuroML_v2.3.xsd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/neuroml/nml/NeuroML_v2.3.xsd b/neuroml/nml/NeuroML_v2.3.xsd index e9f3c4b6..c83d2370 100644 --- a/neuroml/nml/NeuroML_v2.3.xsd +++ b/neuroml/nml/NeuroML_v2.3.xsd @@ -291,6 +291,16 @@ + + + LEMS DerivedParamter element + + + + + + + From 2a04222d84214187cecbc3020227304b0aaaa51d Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 3 May 2023 13:34:57 +0100 Subject: [PATCH 4/6] chore(nml.py): regenerate --- neuroml/nml/nml.py | 193 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 192 insertions(+), 1 deletion(-) diff --git a/neuroml/nml/nml.py b/neuroml/nml/nml.py index c235960b..5a8651b8 100644 --- a/neuroml/nml/nml.py +++ b/neuroml/nml/nml.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Generated Wed May 3 12:43:16 2023 by generateDS.py version 2.41.3. +# Generated Wed May 3 13:33:04 2023 by generateDS.py version 2.41.3. # Python 3.10.11 (main, Apr 5 2023, 00:00:00) [GCC 13.0.1 20230404 (Red Hat 13.0.1-0)] # # Command line options: @@ -55907,6 +55907,195 @@ def _buildChildren( # end class LEMS_Property +class DerivedParameter(NamedDimensionalType): + """DerivedParameter -- LEMS DerivedParamter element""" + + __hash__ = GeneratedsSuper.__hash__ + member_data_items_ = [ + MemberSpec_("value", "xs:string", 0, 0, {"use": "required", "name": "value"}), + ] + subclass = None + superclass = NamedDimensionalType + + def __init__( + self, + name: "a string (required)" = None, + dimension: "a string (required)" = None, + description: "a string (optional)" = None, + value: "a string (required)" = None, + gds_collector_=None, + **kwargs_, + ): + self.gds_collector_ = gds_collector_ + self.gds_elementtree_node_ = None + self.original_tagname_ = None + self.parent_object_ = kwargs_.get("parent_object_") + self.ns_prefix_ = None + super(globals().get("DerivedParameter"), self).__init__( + name, dimension, description, **kwargs_ + ) + self.value = _cast(None, value) + self.value_nsprefix_ = None + + def factory(*args_, **kwargs_): + if CurrentSubclassModule_ is not None: + subclass = getSubclassFromModule_(CurrentSubclassModule_, DerivedParameter) + if subclass is not None: + return subclass(*args_, **kwargs_) + if DerivedParameter.subclass: + return DerivedParameter.subclass(*args_, **kwargs_) + else: + return DerivedParameter(*args_, **kwargs_) + + factory = staticmethod(factory) + + def _hasContent(self): + if super(DerivedParameter, self)._hasContent(): + return True + else: + return False + + def export( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="DerivedParameter", + pretty_print=True, + ): + imported_ns_def_ = GenerateDSNamespaceDefs_.get("DerivedParameter") + if imported_ns_def_ is not None: + namespacedef_ = imported_ns_def_ + if pretty_print: + eol_ = "\n" + else: + eol_ = "" + if self.original_tagname_ is not None and name_ == "DerivedParameter": + name_ = self.original_tagname_ + if UseCapturedNS_ and self.ns_prefix_: + namespaceprefix_ = self.ns_prefix_ + ":" + showIndent(outfile, level, pretty_print) + outfile.write( + "<%s%s%s" + % ( + namespaceprefix_, + name_, + namespacedef_ and " " + namespacedef_ or "", + ) + ) + already_processed = set() + self._exportAttributes( + outfile, + level, + already_processed, + namespaceprefix_, + name_="DerivedParameter", + ) + if self._hasContent(): + outfile.write(">%s" % (eol_,)) + self._exportChildren( + outfile, + level + 1, + namespaceprefix_, + namespacedef_, + name_="DerivedParameter", + pretty_print=pretty_print, + ) + outfile.write("%s" % (namespaceprefix_, name_, eol_)) + else: + outfile.write("/>%s" % (eol_,)) + + def _exportAttributes( + self, + outfile, + level, + already_processed, + namespaceprefix_="", + name_="DerivedParameter", + ): + super(DerivedParameter, self)._exportAttributes( + outfile, + level, + already_processed, + namespaceprefix_, + name_="DerivedParameter", + ) + if self.value is not None and "value" not in already_processed: + already_processed.add("value") + outfile.write( + " value=%s" + % ( + self.gds_encode( + self.gds_format_string( + quote_attrib(self.value), input_name="value" + ) + ), + ) + ) + + def _exportChildren( + self, + outfile, + level, + namespaceprefix_="", + namespacedef_="", + name_="DerivedParameter", + fromsubclass_=False, + pretty_print=True, + ): + super(DerivedParameter, self)._exportChildren( + outfile, + level, + namespaceprefix_, + namespacedef_, + name_, + True, + pretty_print=pretty_print, + ) + pass + + def validate_(self, gds_collector, recursive=False): + self.gds_collector_ = gds_collector + message_count = len(self.gds_collector_.get_messages()) + # validate simple type attributes + self.gds_validate_builtin_ST_(self.gds_validate_string, self.value, "value") + self.gds_check_cardinality_(self.value, "value", required=True) + # validate simple type children + # validate complex type children + if recursive: + pass + return message_count == len(self.gds_collector_.get_messages()) + + def build(self, node, gds_collector_=None): + self.gds_collector_ = gds_collector_ + if SaveElementTreeNode: + self.gds_elementtree_node_ = node + already_processed = set() + self.ns_prefix_ = node.prefix + self._buildAttributes(node, node.attrib, already_processed) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_) + return self + + def _buildAttributes(self, node, attrs, already_processed): + value = find_attr_value_("value", node) + if value is not None and "value" not in already_processed: + already_processed.add("value") + self.value = value + super(DerivedParameter, self)._buildAttributes(node, attrs, already_processed) + + def _buildChildren( + self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None + ): + super(DerivedParameter, self)._buildChildren(child_, node, nodeName_, True) + pass + + +# end class DerivedParameter + + class Parameter(NamedDimensionalType): __hash__ = GeneratedsSuper.__hash__ member_data_items_ = [] @@ -66821,6 +67010,7 @@ def main(): ("NamedDimensionalType", "NeuroML_v2.3.xsd", "CT"), ("NamedDimensionalVariable", "NeuroML_v2.3.xsd", "CT"), ("Parameter", "NeuroML_v2.3.xsd", "CT"), + ("DerivedParameter", "NeuroML_v2.3.xsd", "CT"), ("LEMS_Property", "NeuroML_v2.3.xsd", "CT"), ("Requirement", "NeuroML_v2.3.xsd", "CT"), ("InstanceRequirement", "NeuroML_v2.3.xsd", "CT"), @@ -67067,6 +67257,7 @@ def main(): "ContinuousConnectionInstanceW", "ContinuousProjection", "DecayingPoolConcentrationModel", + "DerivedParameter", "DerivedVariable", "DistalDetails", "DoubleSynapse", From e0cd0b67728ee87c5bd590cfa8c2048f6b530038 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 3 May 2023 13:40:51 +0100 Subject: [PATCH 5/6] chore: sync schema --- neuroml/nml/NeuroML_v2.3.xsd | 1 + 1 file changed, 1 insertion(+) diff --git a/neuroml/nml/NeuroML_v2.3.xsd b/neuroml/nml/NeuroML_v2.3.xsd index c83d2370..db782772 100644 --- a/neuroml/nml/NeuroML_v2.3.xsd +++ b/neuroml/nml/NeuroML_v2.3.xsd @@ -229,6 +229,7 @@ + From ac058fb129958d56f0aa7bb92f426235282d6f00 Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Wed, 3 May 2023 13:41:05 +0100 Subject: [PATCH 6/6] chore(nml.py): regenerate --- neuroml/nml/nml.py | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/neuroml/nml/nml.py b/neuroml/nml/nml.py index 5a8651b8..46c19aa9 100644 --- a/neuroml/nml/nml.py +++ b/neuroml/nml/nml.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # -# Generated Wed May 3 13:33:04 2023 by generateDS.py version 2.41.3. +# Generated Wed May 3 13:39:08 2023 by generateDS.py version 2.41.3. # Python 3.10.11 (main, Apr 5 2023, 00:00:00) [GCC 13.0.1 20230404 (Red Hat 13.0.1-0)] # # Command line options: @@ -1270,6 +1270,19 @@ class ComponentType(GeneratedsSuper): }, None, ), + MemberSpec_( + "DerivedParameter", + "DerivedParameter", + 1, + 1, + { + "maxOccurs": "unbounded", + "minOccurs": "0", + "name": "DerivedParameter", + "type": "DerivedParameter", + }, + None, + ), MemberSpec_( "Constant", "Constant", @@ -1346,6 +1359,7 @@ def __init__( description: "a string (optional)" = None, Property: "list of Property(s) (optional)" = None, Parameter: "list of Parameter(s) (optional)" = None, + DerivedParameter: "list of DerivedParameter(s) (optional)" = None, Constant: "list of Constant(s) (optional)" = None, Exposure: "list of Exposure(s) (optional)" = None, Requirement: "list of Requirement(s) (optional)" = None, @@ -1375,6 +1389,11 @@ def __init__( else: self.Parameter = Parameter self.Parameter_nsprefix_ = None + if DerivedParameter is None: + self.DerivedParameter = [] + else: + self.DerivedParameter = DerivedParameter + self.DerivedParameter_nsprefix_ = None if Constant is None: self.Constant = [] else: @@ -1417,6 +1436,7 @@ def _hasContent(self): if ( self.Property or self.Parameter + or self.DerivedParameter or self.Constant or self.Exposure or self.Requirement @@ -1562,6 +1582,20 @@ def _exportChildren( name_="Parameter", pretty_print=pretty_print, ) + for DerivedParameter_ in self.DerivedParameter: + namespaceprefix_ = ( + self.DerivedParameter_nsprefix_ + ":" + if (UseCapturedNS_ and self.DerivedParameter_nsprefix_) + else "" + ) + DerivedParameter_.export( + outfile, + level, + namespaceprefix_, + namespacedef_="", + name_="DerivedParameter", + pretty_print=pretty_print, + ) for Constant_ in self.Constant: namespaceprefix_ = ( self.Constant_nsprefix_ + ":" @@ -1653,6 +1687,9 @@ def validate_(self, gds_collector, recursive=False): self.gds_check_cardinality_( self.Parameter, "Parameter", min_occurs=0, max_occurs=9999999 ) + self.gds_check_cardinality_( + self.DerivedParameter, "DerivedParameter", min_occurs=0, max_occurs=9999999 + ) self.gds_check_cardinality_( self.Constant, "Constant", min_occurs=0, max_occurs=9999999 ) @@ -1676,6 +1713,8 @@ def validate_(self, gds_collector, recursive=False): item.validate_(gds_collector, recursive=True) for item in self.Parameter: item.validate_(gds_collector, recursive=True) + for item in self.DerivedParameter: + item.validate_(gds_collector, recursive=True) for item in self.Constant: item.validate_(gds_collector, recursive=True) for item in self.Exposure: @@ -1727,6 +1766,11 @@ def _buildChildren( obj_.build(child_, gds_collector_=gds_collector_) self.Parameter.append(obj_) obj_.original_tagname_ = "Parameter" + elif nodeName_ == "DerivedParameter": + obj_ = DerivedParameter.factory(parent_object_=self) + obj_.build(child_, gds_collector_=gds_collector_) + self.DerivedParameter.append(obj_) + obj_.original_tagname_ = "DerivedParameter" elif nodeName_ == "Constant": obj_ = Constant.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_)