Classes | Public Types | Public Member Functions | Static Public Member Functions
bbp::sonata::CircuitConfig Class Reference

#include <config.h>

Public Types

enum  ConfigStatus { ConfigStatus::invalid, ConfigStatus::complete, ConfigStatus::partial }
 

Public Member Functions

 CircuitConfig (const std::string &contents, const std::string &basePath)
 
ConfigStatus getCircuitConfigStatus () const
 
const std::string & getNodeSetsPath () const
 
std::set< std::string > listNodePopulations () const
 
NodePopulation getNodePopulation (const std::string &name, const Hdf5Reader &hdf5_reader) const
 
NodePopulation getNodePopulation (const std::string &name) const
 
std::set< std::string > listEdgePopulations () const
 
EdgePopulation getEdgePopulation (const std::string &name, const Hdf5Reader &hdf5_reader) const
 
EdgePopulation getEdgePopulation (const std::string &name) const
 
NodePopulationProperties getNodePopulationProperties (const std::string &name) const
 
EdgePopulationProperties getEdgePopulationProperties (const std::string &name) const
 
const std::string & getExpandedJSON () const
 

Static Public Member Functions

static CircuitConfig fromFile (const std::string &path)
 

Detailed Description

Read access to a SONATA circuit config file.

Member Enumeration Documentation

◆ ConfigStatus

Enumerator
invalid 

needed for parsing json contents that are null / not an enum value

complete 

all mandatory properties exist, and the config should return correct values in all possible cases

partial 

Partial configs relax the requirements:

  • can be missing the top level networks key
  • can be missing the nodes and edges properties under network
  • mandatory properties aren't enforced (for example for biophysical circuits)

Constructor & Destructor Documentation

◆ CircuitConfig()

bbp::sonata::CircuitConfig::CircuitConfig ( const std::string &  contents,
const std::string &  basePath 
)

Parses a SONATA JSON config file.

Exceptions
SonataErroron:
  • 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

Member Function Documentation

◆ fromFile()

static CircuitConfig bbp::sonata::CircuitConfig::fromFile ( const std::string &  path)
static

Loads a SONATA JSON config file from disk and returns a CircuitConfig object which parses it.

Exceptions
SonataErroron:
  • 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

◆ getCircuitConfigStatus()

ConfigStatus bbp::sonata::CircuitConfig::getCircuitConfigStatus ( ) const

Returns the completeness of the checks that are performed for the circuit; see ConfigStatus for more information

◆ getEdgePopulation()

EdgePopulation bbp::sonata::CircuitConfig::getEdgePopulation ( const std::string &  name,
const Hdf5Reader hdf5_reader 
) const

Creates and returns an EdgePopulation object, initialized from the given population, and the edge network it belongs to.

Exceptions
SonataErrorif the given population does not exist in any edge network.

◆ getEdgePopulationProperties()

EdgePopulationProperties bbp::sonata::CircuitConfig::getEdgePopulationProperties ( const std::string &  name) const

Return a structure containing edge population specific properties, falling back to network properties if there are no population-specific ones.

Exceptions
SonataErrorif the given population name does not correspond to any existing edge population.

◆ getExpandedJSON()

const std::string& bbp::sonata::CircuitConfig::getExpandedJSON ( ) const

Returns the configuration file JSON whose variables have been expanded by the manifest entries.

◆ getNodePopulation()

NodePopulation bbp::sonata::CircuitConfig::getNodePopulation ( const std::string &  name,
const Hdf5Reader hdf5_reader 
) const

Creates and returns a NodePopulation object, initialized from the given population, and the node network it belongs to.

Exceptions
SonataErrorif the given population does not exist in any node network.

◆ getNodePopulationProperties()

NodePopulationProperties bbp::sonata::CircuitConfig::getNodePopulationProperties ( const std::string &  name) const

Return a structure containing node population specific properties, falling back to network properties if there are no population-specific ones.

Exceptions
SonataErrorif the given population name does not correspond to any existing node population.

◆ getNodeSetsPath()

const std::string& bbp::sonata::CircuitConfig::getNodeSetsPath ( ) const

Returns the path to the node sets file.

◆ listEdgePopulations()

std::set<std::string> bbp::sonata::CircuitConfig::listEdgePopulations ( ) const

Returns a set with all available population names across all the edge networks.

◆ listNodePopulations()

std::set<std::string> bbp::sonata::CircuitConfig::listNodePopulations ( ) const

Returns a set with all available population names across all the node networks.