Public Member Functions | Protected Member Functions | Protected Attributes
bbp::sonata::Population Class Reference
Inheritance diagram for bbp::sonata::Population:
bbp::sonata::EdgePopulation bbp::sonata::NodePopulation

Public Member Functions

std::string name () const
 
uint64_t size () const
 
Selection selectAll () const
 
const std::set< std::string > & attributeNames () const
 
const std::set< std::string > & enumerationNames () const
 
template<typename T >
std::vector< T > getAttribute (const std::string &name, const Selection &selection) const
 
template<typename T >
std::vector< T > getAttribute (const std::string &name, const Selection &selection, const T &defaultValue) const
 
template<typename T >
std::vector< T > getEnumeration (const std::string &name, const Selection &selection) const
 
std::vector< std::string > enumerationValues (const std::string &name) const
 
std::string _attributeDataType (const std::string &name, bool translate_enumeration=false) const
 
const std::set< std::string > & dynamicsAttributeNames () const
 
template<typename T >
std::vector< T > getDynamicsAttribute (const std::string &name, const Selection &selection) const
 
template<typename T >
std::vector< T > getDynamicsAttribute (const std::string &name, const Selection &selection, const T &defaultValue) const
 
std::string _dynamicsAttributeDataType (const std::string &name) const
 
template<typename T >
Selection filterAttribute (const std::string &name, std::function< bool(const T)> pred) const
 

Protected Member Functions

 Population (const std::string &h5FilePath, const std::string &csvFilePath, const std::string &name, const std::string &prefix, const Hdf5Reader &hdf5_reader)
 
 Population (const Population &)=delete
 
 Population (Population &&) noexcept
 

Protected Attributes

std::unique_ptr< Impl > impl_
 

Member Function Documentation

◆ _attributeDataType()

std::string bbp::sonata::Population::_attributeDataType ( const std::string &  name,
bool  translate_enumeration = false 
) const

Get attribute data type, optionally translating enumeration types

◆ _dynamicsAttributeDataType()

std::string bbp::sonata::Population::_dynamicsAttributeDataType ( const std::string &  name) const

Get dynamics attribute data type

◆ attributeNames()

const std::set<std::string>& bbp::sonata::Population::attributeNames ( ) const

All attribute names (CSV columns + required attributes + union of attributes in groups)

◆ dynamicsAttributeNames()

const std::set<std::string>& bbp::sonata::Population::dynamicsAttributeNames ( ) const

All dynamics attribute names (JSON keys + union of attributes in groups)

◆ enumerationNames()

const std::set<std::string>& bbp::sonata::Population::enumerationNames ( ) const

◆ enumerationValues()

std::vector<std::string> bbp::sonata::Population::enumerationValues ( const std::string &  name) const

Get all allowed attribute enumeration values

Parameters
nameis a string to allow attributes not defined in spec
Exceptions
ifthere is no such attribute for the population

◆ getAttribute() [1/2]

template<typename T >
std::vector<T> bbp::sonata::Population::getAttribute ( const std::string &  name,
const Selection selection 
) const

Get attribute values for given {element} Selection

If string values are requested and the attribute is a explicit enumeration, values will be resolved to strings.

See also: https://github.com/AllenInstitute/sonata/blob/master/docs/SONATA_DEVELOPER_GUIDE.md#nodes&mdash;enum-datatypes

Parameters
nameis a string to allow attributes not defined in spec
selectionis a selection to retrieve the attribute values from
Exceptions
ifthere is no such attribute for the population
ifthe attribute is not defined for any element from the selection

◆ getAttribute() [2/2]

template<typename T >
std::vector<T> bbp::sonata::Population::getAttribute ( const std::string &  name,
const Selection selection,
const T &  defaultValue 
) const

Get attribute values for given {element} Selection

If string values are requested and the attribute is a explicit enumeration, values will be resolved to strings.

See also: https://github.com/AllenInstitute/sonata/blob/master/docs/SONATA_DEVELOPER_GUIDE.md#nodes&mdash;enum-datatypes

Parameters
nameis a string to allow attributes not defined in spec
selectionis a selection to retrieve the attribute values from
defaultis a value to use for {element}s without the given attribute
Exceptions
ifthere is no such attribute for the population

◆ getDynamicsAttribute() [1/2]

template<typename T >
std::vector<T> bbp::sonata::Population::getDynamicsAttribute ( const std::string &  name,
const Selection selection 
) const

Get dynamics attribute values for given {element} Selection

Parameters
nameis a string to allow attributes not defined in spec
selectionis a selection to retrieve the dynamics attribute values from
Exceptions
ifthere is no such attribute for the population
ifthe attribute is not defined for any edge from the edge selection

◆ getDynamicsAttribute() [2/2]

template<typename T >
std::vector<T> bbp::sonata::Population::getDynamicsAttribute ( const std::string &  name,
const Selection selection,
const T &  defaultValue 
) const

Get dynamics attribute values for given {element} Selection

Parameters
nameis a string to allow attributes not defined in spec
selectionis a selection to retrieve the dynamics attribute values from
defaultis a value to use for {element}s without the given attribute
Exceptions
ifthere is no such attribute for the population

◆ getEnumeration()

template<typename T >
std::vector<T> bbp::sonata::Population::getEnumeration ( const std::string &  name,
const Selection selection 
) const

Get enumeration values for given attribute and {element} Selection

See also: https://github.com/AllenInstitute/sonata/blob/master/docs/SONATA_DEVELOPER_GUIDE.md#nodes&mdash;enum-datatypes

Parameters
nameis a string to allow enumeration attributes not defined in spec
selectionis a selection to retrieve the enumeration values from
Exceptions
ifthere is no such attribute for the population
ifthe attribute is not defined for any element from the selection

◆ name()

std::string bbp::sonata::Population::name ( ) const

Name of the population used for identifying it in circuit composition

◆ selectAll()

Selection bbp::sonata::Population::selectAll ( ) const

Selection covering all elements

◆ size()

uint64_t bbp::sonata::Population::size ( ) const

Total number of elements