Skip to content

Commit

Permalink
Move spine_morphologies_dir to edge population (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf authored Oct 17, 2024
1 parent f9f161f commit e4ebf38
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 33 deletions.
10 changes: 5 additions & 5 deletions include/bbp/sonata/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ struct SONATA_API NodePopulationProperties: public CommonPopulationProperties {
* mandatory.
*/
nonstd::optional<std::string> microdomainsFile{nonstd::nullopt};

/**
* Path to the directory containing the dendritic spine morphologies.
*/
nonstd::optional<std::string> spineMorphologiesDir{nonstd::nullopt};
};

/**
Expand All @@ -112,6 +107,11 @@ struct SONATA_API EdgePopulationProperties: public CommonPopulationProperties {
* Path to spatial_segment_index
*/
nonstd::optional<std::string> endfeetMeshesFile{nonstd::nullopt};

/**
* Path to the directory containing the dendritic spine morphologies.
*/
nonstd::optional<std::string> spineMorphologiesDir{nonstd::nullopt};
};

/**
Expand Down
10 changes: 5 additions & 5 deletions python/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_<EdgePopulationProperties, CommonPopulationProperties>(
m, "EdgePopulationProperties", "Stores edge population-specific network information")
Expand All @@ -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_<CircuitConfig::ConfigStatus>(m, "CircuitConfigStatus")
.value("invalid", CircuitConfig::ConfigStatus::invalid)
Expand Down
34 changes: 18 additions & 16 deletions python/generated/docstrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
4 changes: 4 additions & 0 deletions python/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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" }, }
Expand Down
10 changes: 5 additions & 5 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,9 +830,6 @@ class CircuitConfig::Parser
if (!component.microdomainsFile) {
component.microdomainsFile = defaultComponents.microdomainsFile;
}
if (!component.spineMorphologiesDir) {
component.spineMorphologiesDir = defaultComponents.spineMorphologiesDir;
}
}
}

Expand All @@ -846,6 +843,9 @@ class CircuitConfig::Parser
if (!component.endfeetMeshesFile) {
component.endfeetMeshesFile = defaultComponents.endfeetMeshesFile;
}
if (!component.spineMorphologiesDir) {
component.spineMorphologiesDir = defaultComponents.spineMorphologiesDir;
}
}
}

Expand Down Expand Up @@ -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");
});
}

Expand All @@ -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");
});
}

Expand Down
6 changes: 4 additions & 2 deletions tests/data/config/circuit_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
}
}
}
Expand Down

0 comments on commit e4ebf38

Please sign in to comment.