### Install libsonata from GitHub Source: https://libsonata.readthedocs.io/en/latest/index.html Install libsonata directly from its GitHub repository, useful for development or to get the latest unreleased features. ```bash pip install git+https://github.com/openbraininstitute/libsonata ``` -------------------------------- ### Install libsonata from PyPI Source: https://libsonata.readthedocs.io/en/latest/index.html Use this command to install the latest stable version of libsonata from the Python Package Index. ```bash pip install libsonata ``` -------------------------------- ### Get Node Sets Path Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Returns the path to the node sets file. ```cpp const std::string & | getNodeSetsPath () const ``` -------------------------------- ### Get Compartment Sets Path Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Returns the path to the compartment sets file. ```cpp const std::string & | getCompartmentSetsPath () const ``` -------------------------------- ### get() Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_report_reader_1_1_population.html Retrieves data for a population, with options to filter by node IDs, time range, time stride, and block gap limit. ```APIDOC ## get() ### Description Retrieves data for a population, with options to filter by node IDs, time range, time stride, and block gap limit. ### Method GET (or equivalent for SDK) ### Endpoint `/population/get` (Illustrative - actual SDK method call) ### Parameters #### Path Parameters None #### Query Parameters - **node_ids** (Selection) - Optional - Limits the report to the given selection. - **tstart** (double) - Optional - Returns voltages occurring on or after tstart. `nonstd::nullopt` indicates no limit. - **tstop** (double) - Optional - Returns voltages occurring on or before tstop. `nonstd::nullopt` indicates no limit. - **tstride** (size_t) - Optional - Indicates every how many timesteps data is read. `nonstd::nullopt` indicates that all timesteps are read. - **block_gap_limit** (size_t) - Optional - Gap limit between each IO block while fetching data from storage. ### Request Example ```json { "node_ids": null, "tstart": null, "tstop": null, "tstride": null, "block_gap_limit": null } ``` ### Response #### Success Response (200) - **DataFrame** - The retrieved data. #### Response Example ```json { "example": "DataFrame content" } ``` ``` -------------------------------- ### get() Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_ReportReader%3A%3APopulation.html Retrieves data from the population, with options to filter by node IDs, time range, and time stride. It also accepts a block gap limit for efficient data fetching. ```APIDOC ## get() ### Description Retrieves data from the population, with options to filter by node IDs, time range, and time stride. It also accepts a block gap limit for efficient data fetching. ### Method `get` ### Parameters #### Path Parameters None #### Query Parameters - **_node_ids_** (nonstd::optional) - Optional - Limits the report to the given selection. - **_tstart_** (nonstd::optional) - Optional - Returns voltages occurring on or after tstart. `nonstd::nullopt` indicates no limit. - **_tstop_** (nonstd::optional) - Optional - Returns voltages occurring on or before tstop. `nonstd::nullopt` indicates no limit. - **_tstride_** (nonstd::optional) - Optional - Indicates every how many timesteps data is read. `nonstd::nullopt` indicates that all timesteps are read. - **_block_gap_limit_** (nonstd::optional) - Optional - Gap limit between each IO block while fetching data from storage. ### Request Example ```json { "_node_ids_": null, "_tstart_": null, "_tstop_": null, "_tstride_": null, "_block_gap_limit_": null } ``` ### Response #### Success Response (200) - **DataFrame** - The retrieved data. #### Response Example ```json { "example": "DataFrame content" } ``` ``` -------------------------------- ### EdgeStorage Initialization and Population Listing Source: https://libsonata.readthedocs.io/en/latest/index.html Demonstrates how to initialize EdgeStorage and list available population names. ```APIDOC ## EdgeStorage ### Description Handles population of edges. ### Initialization ```python import libsonata edges = libsonata.EdgeStorage('path/to/H5/file') ``` ### Methods #### population_names Get the names of all populations. ```python # list populations print(edges.population_names) ``` ``` -------------------------------- ### get_population_names (SomaReportReader) Source: https://libsonata.readthedocs.io/en/latest/api.html Get a list of all population names from a SomaReportReader. ```APIDOC ## get_population_names (SomaReportReader) ### Description Get list of all populations. ### Returns * list[str] - A list of population names. ``` -------------------------------- ### Build libsonata C++ Library Source: https://libsonata.readthedocs.io/en/latest/index.html Instructions for cloning the repository, configuring the build with CMake, and compiling the C++ library. Ensure you use the same C++ standard as your project. ```bash git clone git@github.com:openbraininstitute/libsonata.git --recursive cd libsonata mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release -DEXTLIB_FROM_SUBMODULES=ON .. make -j ``` -------------------------------- ### get (by type) Source: https://libsonata.readthedocs.io/en/latest/cpp/classnonstd_1_1variants_1_1variant.html Retrieves the value of the specified type T from the variant. ```APIDOC ## get (by type) ### Description Retrieves the value of the specified type T from the variant. ### Method `get()` ### Parameters - **T** - The type of the value to retrieve. ### Return Value - `T &` - A reference to the value if the variant holds type T. - `T const &` - A const reference to the value if the variant holds type T (const version). ``` -------------------------------- ### CircuitConfig::getCompartmentSetsPath Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_circuit_config.html Gets the path to the compartment sets file. ```APIDOC ## CircuitConfig::getCompartmentSetsPath ### Description Gets the path to the compartment sets file. ### Signature const std::string & getCompartmentSetsPath() const ``` -------------------------------- ### Load and Query Node Sets in Python Source: https://libsonata.readthedocs.io/en/latest/index.html Demonstrates loading node sets from a JSON file or string and materializing them into selections for a given population. ```python # load a node set JSON file >>> node_sets = libsonata.NodeSets.from_file('node_sets.json') # list node sets >>> node_sets.names {'L6_UPC', 'Layer1', 'Layer2', 'Layer3', ....} # get the selection of nodes that match in population >>> selection = node_sets.materialize('Layer1', population) # node sets can also be loaded from a JSON string >>> node_sets_manual = libsonata.NodeSets(json.dumps({"SLM_PPA_and_SP_PC": {"mtype": ["SLM_PPA", "SP_PC"]}})) >>> node_sets_manual.names {'SLM_PPA_and_SP_PC'} ``` -------------------------------- ### Create CircuitConfig from File Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Creates a CircuitConfig object by reading from a specified file path. ```cpp static CircuitConfig | fromFile (const std::string &path) ``` -------------------------------- ### CircuitConfig::getNodeSetsPath Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_circuit_config.html Gets the path to the node sets file. ```APIDOC ## CircuitConfig::getNodeSetsPath ### Description Gets the path to the node sets file. ### Signature const std::string & getNodeSetsPath() const ``` -------------------------------- ### ElementReportReader.get_population_names Source: https://libsonata.readthedocs.io/en/latest/api.html Gets a list of all population names available in the report reader. ```APIDOC ## ElementReportReader.get_population_names ### Description Get list of all populations. ### Method `get_population_names() → list[str]` ### Returns - list[str] - A list of population names. ``` -------------------------------- ### SimulationConfig._from_file Source: https://libsonata.readthedocs.io/en/latest/api.html Loads a SONATA JSON simulation configuration file from disk and returns a SimulationConfig object. ```APIDOC ## _from_file(_arg0 : object_) -> libsonata.SimulationConfig ### Description Loads a SONATA JSON simulation config file from disk and returns a SimulationConfig object which parses it. ### Parameters #### Path Parameters - **_arg0** (object) - Description of the file path or object to load from. ### Response #### Success Response (SimulationConfig) - Returns a SimulationConfig object. ### Error Handling Raises: SonataError on: - Non accessible file (does not exists / does not have read access) - Ill-formed JSON - Missing mandatory entries (in any depth) ``` -------------------------------- ### CircuitConfig::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Creates a CircuitConfig object from a file path. ```APIDOC ## CircuitConfig::fromFile ### Description Creates a CircuitConfig object from a file path. ### Signature static CircuitConfig fromFile(const std::string &path) ``` -------------------------------- ### _dynamicsAttributeDataType() Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_EdgePopulation.html Internal function to get the data type of a dynamics attribute. ```APIDOC ## _dynamicsAttributeDataType(const std::string &name) const ### Description Internal function to get the data type of a dynamics attribute. ### Method `std::string _dynamicsAttributeDataType(const std::string &name) const` ### Parameters * **name** (const std::string &) - The name of the dynamics attribute. ``` -------------------------------- ### SimulationConfig::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_simulation_config.html Loads a SONATA JSON simulation config file from disk and returns a SimulationConfig object which parses it. ```APIDOC ## static SimulationConfig bbp::sonata::SimulationConfig::fromFile(const std::string &path) ### Description Loads a SONATA JSON simulation config file from disk and returns a SimulationConfig object which parses it. ### Parameters #### Path Parameters - **path** (const std::string &) - The path to the SONATA JSON simulation configuration file. ### Exceptions - **SonataError**: Thrown if the file is not accessible (does not exist or no read access), if the JSON is ill-formed, or if mandatory entries are missing. ``` -------------------------------- ### Get Edge Population Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Retrieves a specific edge population by its name. ```cpp EdgePopulation | **getEdgePopulation** (const std::string &name) const ``` -------------------------------- ### Get Node Population Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Retrieves a specific node population by its name. ```cpp NodePopulation | **getNodePopulation** (const std::string &name) const ``` -------------------------------- ### Include Configuration Header Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Include the necessary header file for circuit configuration functionalities. ```cpp #include ``` -------------------------------- ### Work with Selection Ranges in Python Source: https://libsonata.readthedocs.io/en/latest/index.html Illustrates how to create and interpret libsonata.Selection objects, which represent ranges of element IDs for efficient data access. ```python >>> selection = libsonata.Selection([1, 2, 3, 5]) >>> selection.ranges [(1, 4), (5, 6)] ``` ```python >>> selection = libsonata.Selection([(1, 4), (5, 6)]) >>> selection.flatten() [1, 2, 3, 5] >>> selection.flat_size 4 >>> bool(selection) True ``` -------------------------------- ### _dynamicsAttributeDataType Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_node_population.html Internal method to get the data type of a dynamics attribute. ```APIDOC ## _dynamicsAttributeDataType ### Description Internal method to get the data type of a dynamics attribute. ### Method `_dynamicsAttributeDataType` ### Endpoint N/A (Method Call) ### Parameters #### Path Parameters - **name** (const std::string &) - The name of the dynamics attribute. ### Response - **std::string** - The data type of the dynamics attribute. ``` -------------------------------- ### get (by index) Source: https://libsonata.readthedocs.io/en/latest/cpp/classnonstd_1_1variants_1_1variant.html Retrieves the value at the specified index K from the variant. ```APIDOC ## get (by index) ### Description Retrieves the value at the specified index K from the variant. ### Method `get()` ### Parameters - **K** - The zero-based index of the type to retrieve. ### Return Value - `variant_alternative< K, variant >::type &` - A reference to the value at index K. - `variant_alternative< K, variant >::type const &` - A const reference to the value at index K (const version). ``` -------------------------------- ### CircuitConfig::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_circuit_config.html Creates a CircuitConfig object by reading from the specified file path. ```APIDOC ## CircuitConfig::fromFile ### Description Creates a CircuitConfig object by reading from the specified file path. ### Signature static CircuitConfig fromFile(const std::string &path) ``` -------------------------------- ### NodePopulation.enumeration_values Source: https://libsonata.readthedocs.io/en/latest/api.html Gets all allowed attribute enumeration values for a given attribute name. ```APIDOC ## NodePopulation.enumeration_values ### Description Get all allowed attribute enumeration values. ### Method `enumeration_values(_name : str_) → list[str]` ### Parameters - **name** (str) - Required - The name of the attribute to get enumeration values for. ### Returns - list[str] - A list of allowed enumeration values. ### Raises - If there is no such attribute for the population. ``` -------------------------------- ### Initialize and List Edge Populations Source: https://libsonata.readthedocs.io/en/latest/index.html Instantiate EdgeStorage to access edge data and list available population names. ```python >>> edges = libsonata.EdgeStorage('path/to/H5/file') # list populations >>> edges.population_names ``` -------------------------------- ### getNetwork Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SimulationConfig.html Retrieves the circuit configuration file associated with the simulation. ```APIDOC ## getNetwork() ### Description Returns the circuit config file associated with this simulation config. ### Method const std::string& bbp::sonata::SimulationConfig::getNetwork() const noexcept ### Returns - const std::string&: A const reference to the network configuration file path. ``` -------------------------------- ### Population::_dynamicsAttributeDataType Source: https://libsonata.readthedocs.io/en/latest/cpp/population_8h_source.html Internal method to get the data type of a dynamics attribute. ```APIDOC ## Population::_dynamicsAttributeDataType ### Description Internal method to get the data type of a dynamics attribute. ### Signature ```cpp std::string _dynamicsAttributeDataType(const std::string& name) const; ``` ``` -------------------------------- ### Get Expanded JSON Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Returns the expanded JSON representation of the circuit configuration. ```cpp const std::string & | getExpandedJSON () const ``` -------------------------------- ### Load and Inspect NodeStorage in Python Source: https://libsonata.readthedocs.io/en/latest/index.html Demonstrates how to open a SONATA HDF5 file and access its population names using libsonata's NodeStorage. ```python >>> import libsonata >>> nodes = libsonata.NodeStorage('path/to/H5/file') # list populations >>> nodes.population_names # open population >>> population = nodes.open_population() ``` -------------------------------- ### NodeSets::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_NodeSets.html Opens and reads a SONATA 'node sets' file from the specified file path. This static method is the primary way to load node set configurations from disk. ```APIDOC ## static NodeSets fromFile(const std::string &path) ### Description Open a SONATA `node sets` file from a path. ### Parameters * **path** (string) - The file path to the SONATA node sets file. ``` -------------------------------- ### CircuitConfig Constructors and Factory Method Source: https://libsonata.readthedocs.io/en/latest/cpp/config_8h_source.html Constructs a CircuitConfig object from string contents or loads it from a file. ```APIDOC ## CircuitConfig(const std::string& contents, const std::string& basePath) ### Description Constructs a CircuitConfig object by parsing the provided JSON string contents and resolving paths relative to basePath. ### Parameters #### Path Parameters - **contents** (std::string) - Required - The JSON string representing the circuit configuration. - **basePath** (std::string) - Required - The base path to resolve relative file paths within the configuration. ## CircuitConfig::fromFile(const std::string& path) ### Description Loads and parses a CircuitConfig object from a JSON file located at the specified path. ### Method static ### Parameters #### Path Parameters - **path** (std::string) - Required - The file path to the circuit configuration JSON. ### Returns - CircuitConfig - The loaded circuit configuration object. ``` -------------------------------- ### output Source: https://libsonata.readthedocs.io/en/latest/api.html Returns the Output section of the simulation configuration. ```APIDOC ## output ### Description Returns the Output section of the simulation configuration. ### Property _output ``` -------------------------------- ### Get Circuit Configuration Status Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Retrieves the current status of the circuit configuration. ```cpp ConfigStatus | getCircuitConfigStatus () const ``` -------------------------------- ### SimulationConfig Constructors Source: https://libsonata.readthedocs.io/en/latest/cpp/config_8h_source.html Constructs a SimulationConfig object from a given content string and base path, or loads it from a file. ```APIDOC ## SimulationConfig(const std::string& content, const std::string& basePath) ### Description Constructs a SimulationConfig object by parsing the provided content string and setting the base path for relative file paths. ### Parameters * **content** (std::string) - The configuration content in string format. * **basePath** (std::string) - The base directory path for resolving relative file paths. ## SimulationConfig::fromFile(const std::string& path) ### Description Loads and constructs a SimulationConfig object from a configuration file located at the specified path. ### Method static ### Parameters * **path** (std::string) - The file path to the simulation configuration file. ``` -------------------------------- ### Get Enumeration Values Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_population.html Retrieves all allowed values for a specified enumeration attribute. ```APIDOC ## enumerationValues() std::vector bbp::sonata::Population::enumerationValues(const std::string& _name_) const ### Description Get all allowed attribute enumeration values. ### Parameters * **name** (string): is a string to allow attributes not defined in spec. ### Exceptions if there is no such attribute for the population. ``` -------------------------------- ### Get All Enumeration Names Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_population.html Returns a set of all attribute names that are explicit enumerations. ```APIDOC ## enumerationNames() const std::set& bbp::sonata::Population::enumerationNames() const ### Description All attribute names that are explicit enumerations. ### See Also https://github.com/AllenInstitute/sonata/blob/master/docs/SONATA_DEVELOPER_GUIDE.md#nodes—enum-datatypes ``` -------------------------------- ### run Source: https://libsonata.readthedocs.io/en/latest/api.html Returns the Run section of the simulation configuration. ```APIDOC ## run ### Description Returns the Run section of the simulation configuration. ### Property _run ``` -------------------------------- ### CircuitConfig::fromFile() Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_circuit_config.html A static method to load and parse a SONATA JSON config file from a given path. It returns a CircuitConfig object and can throw SonataError for file access or parsing problems. ```APIDOC ## fromFile() static CircuitConfig bbp::sonata::CircuitConfig::fromFile(const std::string& _path_) Loads a SONATA JSON config file from disk and returns a CircuitConfig object which parses it. Exceptions: SonataError on: * Non accesible file (does not exists / does not have read access) * Ill-formed JSON * Missing mandatory entries (in any depth) * Missing entries which become mandatory when another entry is present * Multiple populations with the same name in different edge/node networks ``` -------------------------------- ### Get All Attribute Names Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_population.html Returns a set of all attribute names associated with the population. ```APIDOC ## attributeNames() const std::set& bbp::sonata::Population::attributeNames() const ### Description All attribute names (CSV columns + required attributes + union of attributes in groups). ``` -------------------------------- ### getNetwork() Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_simulation_config.html Retrieves the circuit configuration file associated with the simulation. ```APIDOC ## ◆ getNetwork() ### Description Returns circuit config file associated with this simulation config. ### Signature `const std::string& bbp::sonata::SimulationConfig::getNetwork() const noexcept` ``` -------------------------------- ### get (SomaDataFrame) Source: https://libsonata.readthedocs.io/en/latest/api.html Return reports with specified node IDs, time range, and stride. ```APIDOC ## get (SomaDataFrame) ### Description Return reports with all those node_ids between ‘tstart’ and ‘tstop’ with a stride tstride. ### Parameters * **_node_ids** (libsonata.Selection | None) - Limit the report to the given selection. If nullptr, all nodes in the report are used. * **_tstart** (float | None) - The start time for the report. * **_tstop** (float | None) - The stop time for the report. * **_tstride** (int | None) - The time stride for the report. * **_block_gap_limit** (int | None) - Gap limit between each IO block while fetching data from storage. ### Returns * libsonata.SomaDataFrame - The requested report data. ``` -------------------------------- ### openFile Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_Hdf5PluginInterface301std%3A%3Atuple301Ts8880140001std%3A%3Atup2aad3a074a6d97aa53b11cdc09840a8e.html Opens an HDF5 file at the specified path. This is a pure virtual function, meaning it must be implemented by derived classes. ```APIDOC ## openFile ### Description Opens an HDF5 file at the specified path. This is a pure virtual function that must be implemented by derived classes. ### Method (Not specified, but typically involves file I/O) ### Endpoint (Not applicable, this is an interface method) ### Parameters #### Path Parameters - **path** (const std::string &) - Required - The path to the HDF5 file to open. ### Response (Not specified, as this is an interface method. Implementations would define the return type, likely a file handle or object.) ``` -------------------------------- ### _attributeDataType() Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_EdgePopulation.html Internal function to get the data type of an attribute, with an option to translate enumerations. ```APIDOC ## _attributeDataType(const std::string &name, bool translate_enumeration = false) const ### Description Internal function to get the data type of an attribute. ### Method `std::string _attributeDataType(const std::string &name, bool translate_enumeration = false) const` ### Parameters * **name** (const std::string &) - The name of the attribute. * **translate_enumeration** (bool) - Whether to translate enumerations (default is false). ``` -------------------------------- ### network Source: https://libsonata.readthedocs.io/en/latest/api.html Returns the circuit configuration file associated with this simulation configuration. ```APIDOC ## network ### Description Returns circuit config file associated with this simulation config. ### Property _network ``` -------------------------------- ### Get Edge Population Properties Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Retrieves the properties for a given edge population name. ```cpp EdgePopulationProperties | getEdgePopulationProperties (const std::string &name) const ``` -------------------------------- ### CircuitConfig::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Loads and parses a SONATA JSON config file from a specified path, returning a CircuitConfig object. This static method handles file access and parsing, throwing SonataError on issues. ```APIDOC ## fromFile(const std::string & _path_) Loads a SONATA JSON config file from disk and returns a CircuitConfig object. ### Parameters - `_path_` (const std::string &) - The path to the JSON configuration file. ### Returns - `CircuitConfig` - An object representing the parsed configuration. ### Exceptions - `SonataError` - Thrown on: * File not accessible (does not exist or no read access). * Ill-formed JSON. * Missing mandatory entries. * Missing entries that become mandatory based on other entries. * Duplicate population names in different networks. ``` -------------------------------- ### Get Node Population Properties Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Retrieves the properties for a given node population name. ```cpp NodePopulationProperties | getNodePopulationProperties (const std::string &name) const ``` -------------------------------- ### Population::getTimes Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SpikeReader%3A%3APopulation.html Returns the start and stop times of the population's spike data. ```APIDOC ## Population::getTimes ### Description Return (tstart, tstop) of the population. ### Signature `std::tuple getTimes() const` ### Returns `std::tuple`: A tuple containing the start and stop times. ``` -------------------------------- ### getOutput() Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_simulation_config.html Retrieves the Output section of the simulation configuration. ```APIDOC ## getOutput() ### Description Returns the Output section of the simulation configuration. ### Method const Output& (const) ### Returns const Output& ``` -------------------------------- ### getOutput() Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SimulationConfig.html Retrieves the Output section of the simulation configuration. ```APIDOC ## getOutput() ### Description Returns the Output section of the simulation configuration. ### Method const Output& getOutput() const noexcept ### Returns The Output section of the simulation configuration. ``` -------------------------------- ### getTimes() Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_ReportReader%3A%3APopulation.html Retrieves the start time, stop time, and time step of the population data. ```APIDOC ## getTimes() ### Description Retrieves the start time, stop time, and time step of the population data. ### Method `getTimes` ### Parameters None ### Response #### Success Response (200) - **std::tuple** - A tuple containing (tstart, tstop, tstep). #### Response Example ```json { "example": [0.0, 100.0, 0.1] } ``` ``` -------------------------------- ### getTimes() - Retrieve Time Range Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_spike_reader_1_1_population.html Returns the start and stop times of the population data. ```APIDOC ## getTimes() ### Description Return (tstart, tstop) of the population. ### Method const ### Response #### Success Response (std::tuple) - Returns a tuple containing the start time and stop time. ``` -------------------------------- ### CircuitConfig Constructor Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Initializes a CircuitConfig object with the provided contents and base path. ```APIDOC ## CircuitConfig Constructor ### Description Initializes a CircuitConfig object with the provided contents and base path. ### Signature CircuitConfig(const std::string &contents, const std::string &basePath) ``` -------------------------------- ### Getting Edge Attributes Source: https://libsonata.readthedocs.io/en/latest/index.html Illustrates how to retrieve attribute values for single edges or selections of edges. ```APIDOC ### Methods #### get_attribute Retrieves attribute values for edges. ##### Single Edge ```python # get attribute value for single edge, say 123 delay = population.get_attribute('delay', 123) ``` ##### Selection of Edges ```python # Selection of edges => returns NumPy array with corresponding values selection = libsonata.Selection([1, 5, 9]) delays = population.get_attribute('delay', selection) # returns delays for edges 1, 5, 9 ``` ``` -------------------------------- ### SimulationConfig::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SimulationConfig.html Loads a SONATA JSON simulation config file from disk and returns a SimulationConfig object which parses it. This method handles file access, JSON parsing, and validation of mandatory entries. ```APIDOC ## SimulationConfig::fromFile ### Description Loads a SONATA JSON simulation config file from disk and returns a SimulationConfig object which parses it. This method handles file access, JSON parsing, and validation of mandatory entries. ### Method static ### Endpoint N/A (C++ method) ### Parameters #### Path Parameters - **path** (const std::string&) - Required - The path to the SONATA JSON simulation config file. ### Exceptions - SonataError: Thrown if the file is not accessible (does not exist or no read access), if the JSON is ill-formed, or if mandatory entries are missing at any depth. ``` -------------------------------- ### bbp::sonata::Population::_dynamicsAttributeDataType Source: https://libsonata.readthedocs.io/en/latest/cpp/population_8h_source.html Internal method to get the data type of a dynamics attribute. ```APIDOC ## bbp::sonata::Population::_dynamicsAttributeDataType ### Description Retrieves the data type of a specified dynamics attribute. ### Signature std::string _dynamicsAttributeDataType(const std::string &name) const ``` -------------------------------- ### getRun() Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SimulationConfig.html Retrieves the Run section of the simulation configuration. ```APIDOC ## getRun() ### Description Returns the Run section of the simulation configuration. ### Method const Run& getRun() const noexcept ### Returns The Run section of the simulation configuration. ``` -------------------------------- ### _attributeDataType Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_node_population.html Internal method to get the data type of an attribute. Can optionally translate enumeration types. ```APIDOC ## _attributeDataType ### Description Internal method to get the data type of an attribute. Can optionally translate enumeration types. ### Method `_attributeDataType` ### Endpoint N/A (Method Call) ### Parameters #### Path Parameters - **name** (const std::string &) - The name of the attribute. - **translate_enumeration** (bool) - Whether to translate enumeration types (default is false). ### Response - **std::string** - The data type of the attribute. ``` -------------------------------- ### getRun() Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_simulation_config.html Retrieves the Run section of the simulation configuration. ```APIDOC ## getRun() ### Description Returns the Run section of the simulation configuration. ### Method const Run& (const) ### Returns const Run& ``` -------------------------------- ### NodePopulation Constructors Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_node_population.html Constructs a NodePopulation object. Two constructors are available, one taking file paths and names, and another that also accepts an Hdf5Reader object for more control over data reading. ```APIDOC ## NodePopulation Constructors ### Description Constructs a NodePopulation object. ### Method Constructor ### Parameters #### Path Parameters - **h5FilePath** (const std::string &) - Description of the HDF5 file path. - **csvFilePath** (const std::string &) - Description of the CSV file path. - **name** (const std::string &) - The name of the node population. - **hdf5_reader** (const Hdf5Reader &) - An optional Hdf5Reader object for custom data reading. ### Code Example ```cpp // Example usage of constructors NodePopulation pop1("path/to/file.h5", "path/to/file.csv", "population_name"); // Hdf5Reader reader; // NodePopulation pop2("path/to/file.h5", "path/to/file.csv", "population_name", reader); ``` ``` -------------------------------- ### Get All Dynamics Attribute Names Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_population.html Returns a set of all dynamics attribute names associated with the population. ```APIDOC ## dynamicsAttributeNames() const std::set& bbp::sonata::Population::dynamicsAttributeNames() const ### Description All dynamics attribute names (JSON keys + union of attributes in groups). ``` -------------------------------- ### bbp::sonata::Hdf5Reader::Hdf5Reader() Source: https://libsonata.readthedocs.io/en/latest/cpp/hdf5__reader_8h_source.html Constructs an Hdf5Reader with the default plugin implementation. ```APIDOC ## Hdf5Reader() ### Description Creates a valid Hdf5Reader with the default plugin. ### Method Hdf5Reader() ``` -------------------------------- ### Get Dynamics Attribute Data Type Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_population.html Retrieves the data type of a specified dynamics attribute. ```APIDOC ## _dynamicsAttributeDataType() std::string bbp::sonata::Population::_dynamicsAttributeDataType(const std::string& _name_) const ### Description Get dynamics attribute data type. ### Parameters * **_name_** (const std::string&): The name of the dynamics attribute. ``` -------------------------------- ### getTimes() Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_report_reader_1_1_population.html Retrieves the time information (start time, stop time, and time step) for the population. ```APIDOC ## getTimes() ### Description Retrieves the time information (start time, stop time, and time step) for the population. ### Method GET (or equivalent for SDK) ### Endpoint `/population/times` (Illustrative - actual SDK method call) ### Parameters None ### Response #### Success Response (200) - **std::tuple** - A tuple containing tstart, tstop, and tstep. #### Response Example ```json { "example": [0.0, 1000.0, 0.1] } ``` ``` -------------------------------- ### getConnectionOverrides() Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_simulation_config.html Retrieves the full list of connection overrides for the simulation. ```APIDOC ## ◆ getConnectionOverrides() ### Description Returns the full list of connection overrides. ### Signature `const std::vector& bbp::sonata::SimulationConfig::getConnectionOverrides() const noexcept` ``` -------------------------------- ### Population::_attributeDataType Source: https://libsonata.readthedocs.io/en/latest/cpp/population_8h_source.html Internal method to get the data type of an attribute. Can optionally translate enumeration types. ```APIDOC ## Population::_attributeDataType ### Description Internal method to get the data type of an attribute. Can optionally translate enumeration types. ### Signature ```cpp std::string _attributeDataType(const std::string& name, bool translate_enumeration = false) const; ``` ``` -------------------------------- ### Constructors Source: https://libsonata.readthedocs.io/en/latest/cpp/classnonstd_1_1variants_1_1variant.html Constructs a variant object, initializing it with one of the possible types. ```APIDOC ## Constructors ### Description Constructs a variant object, initializing it with one of the possible types. ### Method Constructor ### Parameters - **t0** (T0 const &) - Description of parameter t0 - **t1** (T1 const &) - Description of parameter t1 - **t2** (T2 const &) - Description of parameter t2 - **t3** (T3 const &) - Description of parameter t3 - **t4** (T4 const &) - Description of parameter t4 - **t5** (T5 const &) - Description of parameter t5 - **t6** (T6 const &) - Description of parameter t6 - **t7** (T7 const &) - Description of parameter t7 - **t8** (T8 const &) - Description of parameter t8 - **t9** (T9 const &) - Description of parameter t9 - **t10** (T10 const &) - Description of parameter t10 - **t11** (T11 const &) - Description of parameter t11 - **t12** (T12 const &) - Description of parameter t12 - **t13** (T13 const &) - Description of parameter t13 - **t14** (T14 const &) - Description of parameter t14 - **t15** (T15 const &) - Description of parameter t15 - **other** (variant const &) - Copy constructor parameter ``` -------------------------------- ### Get Edge Population with Hdf5Reader Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Retrieves a specific edge population using its name and an HDF5 reader. ```cpp EdgePopulation | getEdgePopulation (const std::string &name, const Hdf5Reader &hdf5_reader) const ``` -------------------------------- ### Constructors Source: https://libsonata.readthedocs.io/en/latest/cpp/optional_8hpp_source.html Various constructors for initializing an optional object, including in-place construction and construction from values. ```APIDOC ## Constructors ### In-place construction (C++11) - `optional( nonstd_lite_in_place_t(T), Args&&... args )`: Constructs an optional in-place with the given arguments. - `optional( nonstd_lite_in_place_t(T), std::initializer_list il, Args&&... args )`: Constructs an optional in-place with an initializer list and additional arguments. ### Value construction (C++11) - `explicit optional( U && value )`: Explicitly constructs an optional by moving a value, if conversion is not implicitly allowed. - `optional( U && value )`: Constructs an optional by moving a value, if conversion is implicitly allowed. ### Value construction (C++98) - `optional( value_type const & value )`: Constructs an optional by copying a value. ``` -------------------------------- ### Get Node Population with Hdf5Reader Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_CircuitConfig.html Retrieves a specific node population using its name and an HDF5 reader. ```cpp NodePopulation | getNodePopulation (const std::string &name, const Hdf5Reader &hdf5_reader) const ``` -------------------------------- ### get() - Retrieve Spikes Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_spike_reader_1_1_population.html Retrieves spikes for specified node IDs within a given time range. ```APIDOC ## get() ### Description Return spikes with all those node_ids between 'tstart' and 'tstop'. ### Method const ### Parameters #### Path Parameters - **_node_ids_** (nonstd::optional< Selection >) - Optional - Defaults to `nonstd::nullopt`. - **_tstart_** (nonstd::optional< double >) - Optional - Defaults to `nonstd::nullopt`. - **_tstop_** (nonstd::optional< double >) - Optional - Defaults to `nonstd::nullopt`. ### Response #### Success Response (Spikes) - Returns a `Spikes` object containing the requested spike data. ``` -------------------------------- ### SimulationConfig Constructor Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_simulation_config.html Constructs a SimulationConfig object from a JSON content string and a base path. ```APIDOC ## SimulationConfig Constructor ### Description Initializes a SimulationConfig object using a JSON string representing the configuration and a base path for file resolution. ### Signature `SimulationConfig(const std::string &content, const std::string &basePath)` ### Parameters - **content** (const std::string &) - The JSON string containing the simulation configuration. - **basePath** (const std::string &) - The base directory path for resolving relative file paths within the configuration. ``` -------------------------------- ### SimulationConfig Constructor Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SimulationConfig.html Constructs a SimulationConfig object from a JSON content string and a base path. ```APIDOC ## SimulationConfig Constructor ### Description Initializes a SimulationConfig object using provided JSON content and a base file path. ### Signature `SimulationConfig(const std::string &content, const std::string &basePath)` ``` -------------------------------- ### ElementReportReader.get Source: https://libsonata.readthedocs.io/en/latest/api.html Retrieves reports with specified node IDs between start and stop times, with a given time stride. ```APIDOC ## ElementReportReader.get ### Description Return reports with all those node_ids between ‘tstart’ and ‘tstop’ with a stride tstride. ### Method `get(_node_ids : libsonata.Selection | None = None_, _tstart : float | None = None_, _tstop : float | None = None_, _tstride : int | None = None_, _block_gap_limit : int | None = None_) → libsonata.ElementDataFrame` ### Parameters - **node_ids** (libsonata.Selection | None) - Optional - Limit the report to the given selection. If nullptr, all nodes in the report are used. - **tstart** (float | None) - Optional - The start time for the report. - **tstop** (float | None) - Optional - The stop time for the report. - **tstride** (int | None) - Optional - The time stride. - **block_gap_limit** (int | None) - Optional - Gap limit between each IO block while fetching data from storage. ### Returns - libsonata.ElementDataFrame - A container of raw reporting data. ``` -------------------------------- ### SpikeReader Constructor Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SpikeReader.html Initializes a SpikeReader object with the specified filename. ```APIDOC ## SpikeReader(std::string filename) ### Description Constructs a SpikeReader object to read spike data from the given file. ### Parameters #### Path Parameters - **filename** (std::string) - Required - The path to the spike file to be read. ``` -------------------------------- ### CircuitConfig Status and Path Retrieval Source: https://libsonata.readthedocs.io/en/latest/cpp/config_8h_source.html Methods to get the status of the circuit configuration and retrieve paths to node sets. ```APIDOC ## CircuitConfig::getCircuitConfigStatus() const ### Description Retrieves the current status of the circuit configuration, indicating if it's complete, partial, or invalid. ### Returns - ConfigStatus - The status of the circuit configuration. ## CircuitConfig::getNodeSetsPath() const ### Description Returns the file path to the node sets configuration. ### Returns - const std::string& - The path to the node sets file. ## CircuitConfig::getCompartmentSetsPath() const ### Description Returns the file path to the compartment sets configuration. ### Returns - const std::string& - The path to the compartment sets file. ``` -------------------------------- ### bbp::sonata::CompartmentSets::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/compartment__sets_8h_source.html Creates a CompartmentSets object by loading data from a specified file path. ```APIDOC ## bbp::sonata::CompartmentSets::fromFile ### Description Load compartment sets from a file. ### Signature static CompartmentsSets fromFile(const std::string &path) ### Parameters #### Path Parameters - **path** (std::string) - Required - The path to the file containing compartment set data. ``` -------------------------------- ### Get Attribute Data Type Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_population.html Retrieves the data type of a specified attribute. It can optionally translate enumeration types. ```APIDOC ## _attributeDataType() std::string bbp::sonata::Population::_attributeDataType(const std::string& _name_, bool _translate_enumeration_ = false) const ### Description Get attribute data type, optionally translating enumeration types. ### Parameters * **_name_** (const std::string&): The name of the attribute. * **_translate_enumeration_** (bool): If true, translate enumeration types. Defaults to false. ``` -------------------------------- ### Get Edge Attribute for Single Edge or Selection Source: https://libsonata.readthedocs.io/en/latest/index.html Retrieve attribute values for a single edge by its ID or for a selection of edges. ```python # get attribute value for single edge, say 123 >>> population.get_attribute('delay', 123) # ...or Selection of edges => returns NumPy array with corresponding values >>> selection = libsonata.Selection([1, 5, 9]) >>> population.get_attribute('delay', selection) # returns delays for edges 1, 5, 9 ``` -------------------------------- ### get_enumeration Source: https://libsonata.readthedocs.io/en/latest/api.html Retrieves enumeration values for a given node or selection of nodes. This function is used to get all allowed attribute enumeration values. ```APIDOC ## get_enumeration ### Description Overloaded function to get enumeration values for a given node or selection of nodes. ### Signatures 1. `get_enumeration(name: str, node_id: int) -> object` 2. `get_enumeration(name: str, selection: libsonata.Selection) -> object` ### Parameters - **name** (str) - Required - The name of the attribute for which to retrieve enumeration values. Allows attributes not defined in the spec. - **node_id** (int) - Required - The ID of the node. - **selection** (libsonata.Selection) - Required - A selection object to retrieve enumeration values from. ### Raises - If there is no such attribute for the population. ``` -------------------------------- ### getConnectionOverrides Source: https://libsonata.readthedocs.io/en/latest/cpp/doxygen_SimulationConfig.html Retrieves the full list of connection overrides for the simulation. ```APIDOC ## getConnectionOverrides() ### Description Returns the full list of connection overrides for the simulation. ### Method const std::vector& bbp::sonata::SimulationConfig::getConnectionOverrides() const noexcept ### Returns - const std::vector&: A const reference to a vector of ConnectionOverride objects. ``` -------------------------------- ### optional class constructors Source: https://libsonata.readthedocs.io/en/latest/cpp/optional_8hpp_source.html Constructors for the optional class, including default construction, construction with nullopt, and copy construction. ```APIDOC template< typename T> class optional { public: typedef T value_type; optional_constexpr optional() optional_noexcept optional_constexpr optional( nullopt_t /*unused*/ ) optional_noexcept #if optional_CPP11_OR_GREATER template< typename U = T optional_REQUIRES_T( std::is_copy_constructible::value || std11::is_trivially_copy_constructible::value ``` -------------------------------- ### InputBase Structure Source: https://libsonata.readthedocs.io/en/latest/cpp/structbbp_1_1sonata_1_1_simulation_config_1_1_input_base.html Defines the structure of an input configuration for Sonata simulations. ```APIDOC ## bbp::sonata::SimulationConfig::InputBase ### Description Represents the base configuration for simulation inputs. ### Public Types #### enum class Module Enumerates the types of stimulus modules. - **invalid**: Invalid module type. - **linear**: Linear stimulus. - **relative_linear**: Relative linear stimulus. - **pulse**: Pulse stimulus. - **sinusoidal**: Sinusoidal stimulus. - **subthreshold**: Subthreshold stimulus. - **hyperpolarizing**: Hyperpolarizing stimulus. - **synapse_replay**: Synapse replay stimulus. - **seclamp**: Seclamp stimulus. - **noise**: Noise stimulus. - **shot_noise**: Shot noise stimulus. - **relative_shot_noise**: Relative shot noise stimulus. - **absolute_shot_noise**: Absolute shot noise stimulus. - **ornstein_uhlenbeck**: Ornstein-Uhlenbeck process stimulus. - **relative_ornstein_uhlenbeck**: Relative Ornstein-Uhlenbeck process stimulus. #### enum class InputType Enumerates the types of input. - **invalid**: Invalid input type. - **spikes**: Spike input. - **extracellular_stimulation**: Extracellular stimulation. - **current_clamp**: Current clamp input. - **voltage_clamp**: Voltage clamp input. - **conductance**: Conductance input. ### Public Attributes - **module** (Module): Type of stimulus. - **inputType** (InputType): Type of input. - **delay** (double): Time when input is activated (ms). - **duration** (double): Time duration for how long input is activated (ms). - **nodeSet** (std::string): Node set which is affected by input. ``` -------------------------------- ### Conditional Includes Source: https://libsonata.readthedocs.io/en/latest/cpp/optional_8hpp_source.html Includes standard library headers conditionally based on C++ standard version and feature availability. For example, `` is included unless exceptions are disabled. ```cpp #if optional_CONFIG_NO_EXCEPTIONS // already included: #else # include #endif #if optional_CPP11_OR_GREATER # include #endif #if optional_HAVE( INITIALIZER_LIST ) # include #endif #if optional_HAVE( TYPE_TRAITS ) # include #elif optional_HAVE( TR1_TYPE_TRAITS ) # include #endif ``` -------------------------------- ### bbp::sonata::Hdf5Reader::openFile Source: https://libsonata.readthedocs.io/en/latest/cpp/hdf5__reader_8h_source.html Opens an HDF5 file at the specified path. ```APIDOC ## openFile(const std::string& filename) const ### Description Opens an HDF5 file specified by the filename. ### Method HighFive::File openFile(const std::string& filename) const ### Parameters #### Path Parameters - **filename** (std::string) - Description of the filename parameter ``` -------------------------------- ### NodeSets::fromFile Source: https://libsonata.readthedocs.io/en/latest/cpp/classbbp_1_1sonata_1_1_node_sets.html Opens and creates a NodeSets object from a SONATA 'node sets' file specified by its path. ```APIDOC ## NodeSets::fromFile(const std::string &path) ### Description Opens a SONATA `node sets` file from a path. ### Parameters * **path** (string) - The path to the SONATA node sets file. ```