diff --git a/include/bbp/sonata/config.h b/include/bbp/sonata/config.h index 93be23cb..ab1bc819 100644 --- a/include/bbp/sonata/config.h +++ b/include/bbp/sonata/config.h @@ -92,11 +92,6 @@ struct SONATA_API NodePopulationProperties: public CommonPopulationProperties { * mandatory. */ nonstd::optional microdomainsFile{nonstd::nullopt}; - - /** - * Path to the directory containing the dendritic spine morphologies. - */ - nonstd::optional spineMorphologiesDir{nonstd::nullopt}; }; /** @@ -112,6 +107,11 @@ struct SONATA_API EdgePopulationProperties: public CommonPopulationProperties { * Path to spatial_segment_index */ nonstd::optional endfeetMeshesFile{nonstd::nullopt}; + + /** + * Path to the directory containing the dendritic spine morphologies. + */ + nonstd::optional spineMorphologiesDir{nonstd::nullopt}; }; /** diff --git a/python/bindings.cpp b/python/bindings.cpp index fe42db30..9508d4ae 100644 --- a/python/bindings.cpp +++ b/python/bindings.cpp @@ -570,10 +570,7 @@ PYBIND11_MODULE(_libsonata, m) { DOC_NODE_POPULATION_PROPERTIES(vasculatureMesh)) .def_readonly("microdomains_file", &NodePopulationProperties::microdomainsFile, - DOC_NODE_POPULATION_PROPERTIES(microdomainsFile)) - .def_readonly("spine_morphologies_dir", - &NodePopulationProperties::spineMorphologiesDir, - DOC_NODE_POPULATION_PROPERTIES(spineMorphologiesDir)); + DOC_NODE_POPULATION_PROPERTIES(microdomainsFile)); py::class_( m, "EdgePopulationProperties", "Stores edge population-specific network information") @@ -582,7 +579,10 @@ PYBIND11_MODULE(_libsonata, m) { DOC_EDGE_POPULATION_PROPERTIES(spatialSynapseIndexDir)) .def_readonly("endfeet_meshes_file", &EdgePopulationProperties::endfeetMeshesFile, - DOC_EDGE_POPULATION_PROPERTIES(endfeetMeshesFile)); + DOC_EDGE_POPULATION_PROPERTIES(endfeetMeshesFile)) + .def_readonly("spine_morphologies_dir", + &EdgePopulationProperties::spineMorphologiesDir, + DOC_EDGE_POPULATION_PROPERTIES(spineMorphologiesDir)); py::enum_(m, "CircuitConfigStatus") .value("invalid", CircuitConfig::ConfigStatus::invalid) diff --git a/python/generated/docstrings.h b/python/generated/docstrings.h index 33c81b61..cb368eeb 100644 --- a/python/generated/docstrings.h +++ b/python/generated/docstrings.h @@ -181,6 +181,8 @@ static const char *__doc_bbp_sonata_EdgePopulationProperties_endfeetMeshesFile = static const char *__doc_bbp_sonata_EdgePopulationProperties_spatialSynapseIndexDir = R"doc(Path to spatial_synapse_index)doc"; +static const char *__doc_bbp_sonata_EdgePopulationProperties_spineMorphologiesDir = R"doc(Path to the directory containing the dendritic spine morphologies.)doc"; + static const char *__doc_bbp_sonata_EdgePopulation_EdgePopulation = R"doc()doc"; static const char *__doc_bbp_sonata_EdgePopulation_EdgePopulation_2 = R"doc()doc"; @@ -302,8 +304,6 @@ populations where it is mandatory.)doc"; static const char *__doc_bbp_sonata_NodePopulationProperties_spatialSegmentIndexDir = R"doc(Path to spatial_segment_index)doc"; -static const char *__doc_bbp_sonata_NodePopulationProperties_spineMorphologiesDir = R"doc(Path to the directory containing the dendritic spine morphologies.)doc"; - static const char *__doc_bbp_sonata_NodePopulationProperties_vasculatureFile = R"doc(Path to the .h5 file containing the vasculature morphology. Only for vasculature node populations where it is mandatory.)doc"; @@ -833,8 +833,6 @@ static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_ornstein_u static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_pulse = R"doc()doc"; -static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_sinusoidal = R"doc()doc"; - static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_relative_linear = R"doc()doc"; static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_relative_ornstein_uhlenbeck = R"doc()doc"; @@ -845,6 +843,8 @@ static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_seclamp = static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_shot_noise = R"doc()doc"; +static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_sinusoidal = R"doc()doc"; + static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_subthreshold = R"doc()doc"; static const char *__doc_bbp_sonata_SimulationConfig_InputBase_Module_synapse_replay = R"doc()doc"; @@ -913,16 +913,6 @@ static const char *__doc_bbp_sonata_SimulationConfig_InputPulse_representsPhysic static const char *__doc_bbp_sonata_SimulationConfig_InputPulse_width = R"doc(The length of time each pulse lasts (ms))doc"; -static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal = R"doc()doc"; - -static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_ampStart = R"doc(The amount of current initially injected (nA))doc"; - -static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_frequency = R"doc(The frequency of the waveform (Hz))doc"; - -static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_dt = R"doc(Timestep of generated signal in ms. Default is 0.025 ms)doc"; - -static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_representsPhysicalElectrode = R"doc(Whether this input represents a physical electrode. Default is false)doc"; - static const char *__doc_bbp_sonata_SimulationConfig_InputRelativeLinear = R"doc()doc"; static const char *__doc_bbp_sonata_SimulationConfig_InputRelativeLinear_percentEnd = R"doc(The percentage of a cell's threshold current to inject at the end)doc"; @@ -1014,6 +1004,16 @@ static const char *__doc_bbp_sonata_SimulationConfig_InputShotNoise_reversal = R static const char *__doc_bbp_sonata_SimulationConfig_InputShotNoise_riseTime = R"doc(The rise time of the bi-exponential shots (ms))doc"; +static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal = R"doc()doc"; + +static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_ampStart = R"doc(The peak amplitude of the sinusoid. Given in nA.)doc"; + +static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_dt = R"doc(Timestep of generated signal in ms. Default is 0.025 ms)doc"; + +static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_frequency = R"doc(The frequency of the sinusoidal waveform. Given in Hz.)doc"; + +static const char *__doc_bbp_sonata_SimulationConfig_InputSinusoidal_representsPhysicalElectrode = R"doc(Whether this input represents a physical electrode. Default is false)doc"; + static const char *__doc_bbp_sonata_SimulationConfig_InputSubthreshold = R"doc()doc"; static const char *__doc_bbp_sonata_SimulationConfig_InputSubthreshold_percentLess = R"doc(A percentage adjusted from 100 of a cell's threshold current)doc"; @@ -1334,14 +1334,16 @@ static const char *__doc_bbp_sonata_SpikeReader_Population_getRawArrays = R"doc( static const char *__doc_bbp_sonata_SpikeReader_Population_getSorting = R"doc(Return the way data are sorted ('none', 'by_id', 'by_time'))doc"; -static const char *__doc_bbp_sonata_SpikeReader_Population_getTimes = R"doc(Return (tstart, tstop) of the population)doc"; - static const char *__doc_bbp_sonata_SpikeReader_Population_getTimeUnits = R"doc(Return the unit of time)doc"; +static const char *__doc_bbp_sonata_SpikeReader_Population_getTimes = R"doc(Return (tstart, tstop) of the population)doc"; + static const char *__doc_bbp_sonata_SpikeReader_Population_sorting = R"doc()doc"; static const char *__doc_bbp_sonata_SpikeReader_Population_spike_times = R"doc()doc"; +static const char *__doc_bbp_sonata_SpikeReader_Population_time_units = R"doc()doc"; + static const char *__doc_bbp_sonata_SpikeReader_Population_tstart = R"doc()doc"; static const char *__doc_bbp_sonata_SpikeReader_Population_tstop = R"doc()doc"; diff --git a/python/tests/test_config.py b/python/tests/test_config.py index b015a5e0..753dc3e3 100644 --- a/python/tests/test_config.py +++ b/python/tests/test_config.py @@ -68,6 +68,10 @@ def test_get_population_properties(self): self.assertEqual(edge_prop.types_path, '') self.assertTrue(edge_prop.elements_path.endswith('tests/data/edges1.h5')) + self.assertTrue(edge_prop.spine_morphologies_dir.endswith('spine_morphologies_dir_edges-AC')) + + edge_prop = self.config.edge_population_properties('edges-AB') + self.assertTrue(edge_prop.spine_morphologies_dir.endswith('spine_morphologies_dir_component')) def test_partial(self): contents = { "metadata": { "status": "NOT A TYPE" }, } diff --git a/src/config.cpp b/src/config.cpp index 5c98ad20..9e046af1 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -830,9 +830,6 @@ class CircuitConfig::Parser if (!component.microdomainsFile) { component.microdomainsFile = defaultComponents.microdomainsFile; } - if (!component.spineMorphologiesDir) { - component.spineMorphologiesDir = defaultComponents.spineMorphologiesDir; - } } } @@ -846,6 +843,9 @@ class CircuitConfig::Parser if (!component.endfeetMeshesFile) { component.endfeetMeshesFile = defaultComponents.endfeetMeshesFile; } + if (!component.spineMorphologiesDir) { + component.spineMorphologiesDir = defaultComponents.spineMorphologiesDir; + } } } @@ -926,8 +926,6 @@ class CircuitConfig::Parser popProperties.vasculatureFile = getOptionalJSONPath(popData, "vasculature_file"); popProperties.vasculatureMesh = getOptionalJSONPath(popData, "vasculature_mesh"); popProperties.microdomainsFile = getOptionalJSONPath(popData, "microdomains_file"); - popProperties.spineMorphologiesDir = getOptionalJSONPath(popData, - "spine_morphologies_dir"); }); } @@ -939,6 +937,8 @@ class CircuitConfig::Parser [&](EdgePopulationProperties& popProperties, const nlohmann::json& popData) { popProperties.spatialSynapseIndexDir = getJSONPath(popData, "spatial_synapse_index_dir"); popProperties.endfeetMeshesFile = getOptionalJSONPath(popData, "endfeet_meshes_file"); + popProperties.spineMorphologiesDir = getOptionalJSONPath(popData, + "spine_morphologies_dir"); }); } diff --git a/tests/data/config/circuit_config.json b/tests/data/config/circuit_config.json index 9ce0ceea..c978ba35 100644 --- a/tests/data/config/circuit_config.json +++ b/tests/data/config/circuit_config.json @@ -9,7 +9,8 @@ "morphologies_dir": "$COMPONENT_DIR/morphologies", "biophysical_neuron_models_dir": "$COMPONENT_DIR/biophysical_neuron_models", "vasculature_file": "$COMPONENT_DIR/some_file", - "vasculature_mesh": "$COMPONENT_DIR/some_file" + "vasculature_mesh": "$COMPONENT_DIR/some_file", + "spine_morphologies_dir": "$COMPONENT_DIR/spine_morphologies_dir_component" }, "node_sets_file": "$BASE_DIR/node_sets.json", "networks": { @@ -33,7 +34,8 @@ "populations": { "edges-AB": {}, "edges-AC": { - "spatial_synapse_index_dir": "$COMPONENT_DIR/spatial_synapse_index_dir" + "spatial_synapse_index_dir": "$COMPONENT_DIR/spatial_synapse_index_dir", + "spine_morphologies_dir": "$COMPONENT_DIR/spine_morphologies_dir_edges-AC" } } }