AFL.automation.mixing.Component#

Functions

enforce_units(value, unit_type)

Ensure that a number has units and convert to the default_units

Classes

Component(name[, mass, volume, density, ...])

Component of a mixture

Exceptions

MixWarning

ParseException(pstr[, loc, msg, elem])

Exception thrown when a parse expression doesn't match the input string

class AFL.automation.mixing.Component.Component(name: str, mass: Quantity | None = None, volume: Quantity | None = None, density: Quantity | None = None, formula: str | None = None, sld: Quantity | None = None, uid: str | None = None, solute: bool = False)[source]#

Component of a mixture

This class defines the basic properties of a component within a mixture. It includes attributes for mass, volume, density, formula, and scattering length density (SLD). It also enforces unit specifications for these attributes.

Parameters:
  • name (str) – The name of the component.

  • mass (str | units.Quantity | None) – The mass of the component, by default None.

  • volume (str | units.Quantity | None) – The volume of the component, by default None.

  • density (str | units.Quantity | None) – The density of the component, by default None.

  • formula (Optional[str], optional) – The chemical formula of the component, by default None.

  • sld (str | units.Quantity | None) – The scattering length density of the component, by default None.

__init__(name: str, mass: Quantity | None = None, volume: Quantity | None = None, density: Quantity | None = None, formula: str | None = None, sld: Quantity | None = None, uid: str | None = None, solute: bool = False) None[source]#
emit() Dict[str, str | Quantity][source]#
__hash__() int[source]#

Needed so Components can be dictionary keys

copy() Component[source]#
__iter__() Iterator[Tuple[str, Component]][source]#

Dummy iterator to mimic behavior of Mixture.

property mass: Quantity | None#
set_mass(value: Quantity) Component[source]#

Setter for inline mass changes

property volume: Quantity | None#
set_volume(value: Quantity) Component[source]#

Setter for inline volume changes

property density: Quantity | None#
property formula: formula | None#
property moles: Quantity | None#
property sld: Quantity | None#
property is_solute: bool#
property is_solvent: bool#
property has_mass: bool#
property has_volume: bool#
property has_density: bool#
property has_formula: bool#
property has_sld: bool#