Implementing classes

This part of the documentation describes implementations of the core thermodynamic base classes, such as simu.ThermoContribution and simu.StateDefinition.

ThermoFrame Factory

class simu.app.RegThermoFactory

Bases: ThermoFactory

This factory class already registers the current content of simu.all_contributions and simu.all_states, making any further registration redundant as long as the definition of the contribution and states is loaded, and the entities are decorated with the appropriate register decorator (simu.registered_contribution and simu.registered_state).

All states and contributions of the simu.app submodule are automatically imported here.

@simu.registered_contribution

A class decorator to be applied to simu.ThermoContribution. All classes registered this way can be received as the list simu.all_contributions.

@simu.registered_state

A class decorator to be applied to simu.StateDefinition. All classes registered this way can be received as the list simu.all_states.

ThermoStructure

class simu.app.ThermoStructure

This class represents the structure of a thermodynamic model, representing the list of contributions and holding the state definition.

In terms of data, it is holding no more than a string representing the name of the StateDefinition class and a list representing the contributions as required for constructing ThermoFrame objects.

As the main additional feature, predefined configurations can be loaded via from_predefined(). Further, add-on contributions, such as augmenters, can easily be added via the +-operator.

To be accepted as a valid configuration struct in the create_frame() method, objects of this class behave like a mapping with two keys: state and contributions.

classmethod from_predefined(name: str)

Create a pre-defined model structure based on its identifier.

classmethod predefined() Iterable[str]

Return a list of all pre-defined model structures.

Pre-defined data

all_states (simu.core)

This is a list of all currently imported StateDefinition class definitions that are decorated with registered_state(). It normally contains at least the GibbsState and the HelmholtzState class.

all_contributions (simu.core)

This is a list of all currently imported ThermoContribution class definitions that are decorated with registered_contribution().

predefined_parameters (simu.app)

This is a ThermoParameterStore instance with some pre-defined thermodynamic parameters.

State definitions

Thermodynamic contributions