Skip to content

Commit

Permalink
Merge branch 'development' into experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Aug 19, 2024
2 parents 2661c58 + a7c827f commit 5957a51
Show file tree
Hide file tree
Showing 16 changed files with 2,501 additions and 2,274 deletions.
1 change: 1 addition & 0 deletions doc/component-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Cells": ["baseCell", "baseSpikingCell", "baseCellMembPot", "baseCellMembPotDL", "baseChannelPopulation", "channelPopulation", "channelPopulationNernst", "baseChannelDensity", "baseChannelDensityCond", "variableParameter", "inhomogeneousValue", "channelDensityNonUniform", "channelDensityNonUniformNernst", "channelDensityNonUniformGHK", "channelDensity", "channelDensityVShift", "channelDensityNernst", "channelDensityNernstCa2", "channelDensityGHK", "channelDensityGHK2", "pointCellCondBased", "pointCellCondBasedCa", "distal", "proximal", "parent", "segment", "segmentGroup", "member", "from", "to", "include", "path", "subTree", "inhomogeneousParameter", "proximalDetails", "distalDetails", "morphology", "specificCapacitance", "initMembPotential", "spikeThresh", "membraneProperties", "membraneProperties2CaPools", "biophysicalProperties", "biophysicalProperties2CaPools", "intracellularProperties", "intracellularProperties2CaPools", "resistivity", "concentrationModel", "decayingPoolConcentrationModel", "fixedFactorConcentrationModel", "fixedFactorConcentrationModelTraub", "species", "cell", "cell2CaPools", "baseCellMembPotCap", "baseIaf", "iafTauCell", "iafTauRefCell", "baseIafCapCell", "iafCell", "iafRefCell", "izhikevichCell", "izhikevich2007Cell", "adExIaFCell", "fitzHughNagumoCell", "pinskyRinzelCA3Cell", "hindmarshRose1984Cell"], "Synapses": ["baseSynapse", "baseVoltageDepSynapse", "baseSynapseDL", "baseCurrentBasedSynapse", "alphaCurrentSynapse", "baseConductanceBasedSynapse", "baseConductanceBasedSynapseTwo", "expOneSynapse", "alphaSynapse", "expTwoSynapse", "expThreeSynapse", "baseBlockMechanism", "voltageConcDepBlockMechanism", "basePlasticityMechanism", "tsodyksMarkramDepMechanism", "tsodyksMarkramDepFacMechanism", "blockingPlasticSynapse", "doubleSynapse", "stdpSynapse", "gapJunction", "baseGradedSynapse", "silentSynapse", "linearGradedSynapse", "gradedSynapse"], "Channels": ["baseVoltageDepRate", "baseVoltageConcDepRate", "baseHHRate", "HHExpRate", "HHSigmoidRate", "HHExpLinearRate", "baseVoltageDepVariable", "baseVoltageConcDepVariable", "baseHHVariable", "HHExpVariable", "HHSigmoidVariable", "HHExpLinearVariable", "baseVoltageDepTime", "baseVoltageConcDepTime", "fixedTimeCourse", "baseQ10Settings", "q10Fixed", "q10ExpTemp", "baseConductanceScaling", "q10ConductanceScaling", "baseConductanceScalingCaDependent", "baseGate", "gate", "gateHHrates", "gateHHtauInf", "gateHHInstantaneous", "gateHHratesTau", "gateHHratesInf", "gateHHratesTauInf", "gateFractional", "subGate", "baseIonChannel", "ionChannelPassive", "ionChannelHH", "ionChannel", "ionChannelVShift", "KSState", "closedState", "openState", "ionChannelKS", "KSTransition", "forwardTransition", "reverseTransition", "vHalfTransition", "tauInfTransition", "gateKS"], "Inputs": ["basePointCurrent", "baseVoltageDepPointCurrent", "baseVoltageDepPointCurrentSpiking", "basePointCurrentDL", "baseVoltageDepPointCurrentDL", "baseSpikeSource", "spikeGenerator", "spikeGeneratorRandom", "spikeGeneratorPoisson", "spikeGeneratorRefPoisson", "poissonFiringSynapse", "transientPoissonFiringSynapse", "timedSynapticInput", "spikeArray", "spike", "pulseGenerator", "compoundInput", "compoundInputDL", "pulseGeneratorDL", "sineGenerator", "sineGeneratorDL", "rampGenerator", "rampGeneratorDL", "voltageClamp", "voltageClampTriple"], "Networks": ["network", "networkWithTemperature", "basePopulation", "population", "populationList", "instance", "location", "region", "rectangularExtent", "projection", "explicitConnection", "connection", "synapticConnection", "synapticConnectionWD", "connectionWD", "electricalConnection", "electricalConnectionInstance", "electricalConnectionInstanceW", "electricalProjection", "continuousConnection", "continuousConnectionInstance", "continuousConnectionInstanceW", "continuousProjection", "explicitInput", "inputList", "input", "inputW"], "PyNN": ["basePyNNCell", "basePyNNIaFCell", "basePyNNIaFCondCell", "IF_curr_alpha", "IF_curr_exp", "IF_cond_alpha", "IF_cond_exp", "EIF_cond_exp_isfa_ista", "EIF_cond_alpha_isfa_ista", "HH_cond_exp", "basePynnSynapse", "expCondSynapse", "expCurrSynapse", "alphaCondSynapse", "alphaCurrSynapse", "SpikeSourcePoisson"], "NeuroMLCoreDimensions": [], "NeuroMLCoreCompTypes": ["notes", "annotation", "property", "baseStandalone", "rdf_RDF", "rdf_Description", "baseBqbiol", "bqbiol_encodes", "bqbiol_hasPart", "bqbiol_hasProperty", "bqbiol_hasVersion", "bqbiol_is", "bqbiol_isDescribedBy", "bqbiol_isEncodedBy", "bqbiol_isHomologTo", "bqbiol_isPartOf", "bqbiol_isPropertyOf", "bqbiol_isVersionOf", "bqbiol_occursIn", "bqbiol_hasTaxon", "bqmodel_is", "bqmodel_isDescribedBy", "bqmodel_isDerivedFrom", "rdf_Bag", "rdf:li", "point3DWithDiam"], "Simulation": ["Simulation", "Display", "Line", "OutputFile", "OutputColumn", "EventOutputFile", "EventSelection", "Meta"]}
146 changes: 102 additions & 44 deletions doc/helpers/nml-core-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,42 @@
Copyright 2023 NeuroML authors
"""

import json
import textwrap

print("Generating list of nml classes")

component_type_list = None
with open("../component-list.json", "r") as f:
component_type_list = json.load(f)

component_type_list["Other"] = []

output_files = {}
comp_num_dict = {}

for ctype in component_type_list.keys():
fwrite = open(f"../userdocs/{ctype}_list.rst", "w")
output_files[ctype] = fwrite
print(ctype, file=fwrite)
print("#" * len(ctype), file=fwrite)
print("\n", file=fwrite)
print("\n", file=fwrite)
print(
f"This documentation is auto-generated from the `NeuroML schema <https://docs.neuroml.org/Userdocs/Schemas/{ctype}.html>`__.",
file=fwrite,
)
print("\n", file=fwrite)
print("\n", file=fwrite)
print(".. Generated using nml-core-docs.py", file=fwrite)

comp_num_dict[ctype] = 0

comp_to_file_map = {}
for file, ctypes in component_type_list.items():
for ctype in ctypes:
comp_to_file_map[ctype[0].capitalize() + ctype[1:]] = file

classes = {}
files = {
"generatedssupersuper.py": [],
Expand All @@ -24,10 +56,6 @@
"PlasticityTypes",
"ZeroOrOne",
"allowedSpaces",
"channelTypes",
"gateTypes",
"networkTypes",
"populationTypes",
"_FixedOffsetTZ",
"GdsCollector_",
"GeneratedsSuperSuper",
Expand All @@ -52,47 +80,77 @@
classlist.sort()
classes[f] = classlist

with open("../userdocs/coreclasses_list.txt", "w") as fwrite:
print(".. Generated using nml-core-docs.py", file=fwrite)
for module, clist in classes.items():
f = module.split(".")[0]
for aclass in clist:
# do not print all the internal methods in GeneratedsSuper
if aclass == "GeneratedsSuper":
towrite = textwrap.dedent(
"""
{}
{}
.. autoclass:: neuroml.nml.{}.{}
:show-inheritance:
""".format(
aclass,
"#" * len(aclass),
f,
aclass,
)

total_classes = 0
for module, clist in classes.items():
total_classes += len(clist)
f = module.split(".")[0]
for aclass in clist:
# do not print all the internal methods in GeneratedsSuper
if aclass == "GeneratedsSuper":
towrite = textwrap.dedent(
"""
{}
{}
.. autoclass:: neuroml.nml.{}.{}
:show-inheritance:
""".format(
aclass,
"^" * len(aclass),
f,
aclass,
)
else:
towrite = textwrap.dedent(
"""
{}
{}
.. autoclass:: neuroml.nml.{}.{}
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
""".format(
aclass,
"#" * len(aclass),
f,
aclass,
)
)
else:
towrite = textwrap.dedent(
"""
{}
{}
.. autoclass:: neuroml.nml.{}.{}
:members:
:undoc-members:
:show-inheritance:
:inherited-members:
""".format(
aclass,
"^" * len(aclass),
f,
aclass,
)
)
try:
category = comp_to_file_map[aclass]
except KeyError:
if "cell" in aclass.lower():
category = "Cells"
elif "gate" in aclass.lower():
category = "Channels"
elif "hh" in aclass.lower():
category = "Channels"
elif "q10" in aclass.lower():
category = "Channels"
elif "channel" in aclass.lower():
category = "Channels"
elif "network" in aclass.lower():
category = "Networks"
elif "population" in aclass.lower():
category = "Networks"
else:
print(f"{aclass} fits nowhere, putting in Other")
category = "Other"
finally:
comp_num_dict[category] += 1
fwrite = output_files[category]
print(towrite, file=fwrite)

print("Saved to userdocs/coreclasses_list.txt")
print("Done")
print(comp_num_dict)

print(f"Total classes read from libNeuroML: {total_classes}")

for comp, num in comp_num_dict.items():
output_files[comp].close()
Loading

0 comments on commit 5957a51

Please sign in to comment.