Activity Factories¶
Particula Index / Particula / Particles / Activity Factories
Auto-generated documentation for particula.particles.activity_factories module.
ActivityFactory¶
Show source in activity_factories.py:20
Factory class to create activity strategy builders
Factory class to create activity strategy builders for calculating activity and partial pressure of species in a mixture of liquids.
Methods¶
get_builders()
- Returns the mapping of strategy types to builder instances.get_strategy(strategy_type,
parameters) - Gets the strategy instance for the specified strategy type.strategy_type
- Type of activity strategy to use, can be 'mass_ideal' (default), 'molar_ideal', or 'kappa_parameter'. parameters(Dict[str, Any], optional): Parameters required for the builder, dependent on the chosen strategy type.mass_ideal
- No parameters are required.molar_ideal
- molar_mass kappa | kappa_parameter: kappa, density, molar_mass, water_index
Returns¶
ActivityStrategy
- An instance of the specified ActivityStrategy.
Raises¶
ValueError
- If an unknown strategy type is provided.ValueError
- If any required key is missing during check_keys or pre_build_check, or if trying to set an invalid parameter.
Examples¶
>>> strategy_is = ActivityFactory().get_strategy("mass_ideal")
Signature¶
class ActivityFactory(
StrategyFactory[
Union[
ActivityIdealMassBuilder,
ActivityIdealMolarBuilder,
ActivityKappaParameterBuilder,
],
Union[ActivityIdealMass, ActivityIdealMolar, ActivityKappaParameter],
]
): ...
See also¶
- ActivityIdealMassBuilder
- ActivityIdealMass
- ActivityIdealMolarBuilder
- ActivityIdealMolar
- ActivityKappaParameterBuilder
- ActivityKappaParameter
ActivityFactory().get_builders¶
Show source in activity_factories.py:61
Returns the mapping of strategy types to builder instances.
Returns¶
Dict[str,
Any] - A dictionary mapping strategy types to builder instances.mass_ideal
- IdealActivityMassBuildermolar_ideal
- IdealActivityMolarBuilderkappa_parameter
- KappaParameterActivityBuilder
Signature¶
def get_builders(self): ...