Download SimPhoNy Documentation

Transcript
CHAPTER 3
API Reference
3.1 Core
Core components and objects of the simphony package.
For a list of the CUBA-keywords, see CUBA-Keywords
Classes
DataContainer(*args, **kwargs)
A DataContainer instance
Implementation
class simphony.core.data_container.DataContainer(*args, **kwargs)
Bases: dict
A DataContainer instance
The DataContainer object is implemented as a python dictionary whose keys are restricted to be members of the
CUBA enum class.
The data container can be initialized like a typical python dict using the mapping and iterables where the keys
are CUBA enum members.
For convenience keywords can be passed as capitalized CUBA enum members:
>>> DataContainer(ACCELERATION=234)
{<CUBA.ACCELERATION: 22>: 234}
# CUBA.ACCELERATION is 22
__setitem__(key, value)
Set/Update the key value only when the key is a CUBA key.
update(*args, **kwargs)
9