riverine.experiments#
Classes#
A class collecting many related mixes and components, allowing methods to be run that consider all of them |
Functions#
Module Contents#
- riverine.experiments._exp_attr_set_reference(self, attribute: Any, reference: riverine.references.Reference | None) riverine.references.Reference | None[source]#
- class riverine.experiments.LocationInfo[source]#
-
- classmethod from_obj(obj) LocationInfo[source]#
- class riverine.experiments.LocationDict(locs: dict[str, LocationInfo | Any])[source]#
- _locs: dict[str, LocationInfo][source]#
- classmethod from_obj(obj) LocationDict[source]#
- __getitem__(key: str) LocationInfo[source]#
- __setitem__(key: str, value: LocationInfo | Any) None[source]#
- values() collections.abc.ValuesView[LocationInfo][source]#
- items() collections.abc.ItemsView[str, LocationInfo][source]#
- get(key: str, default: Any | None = None) LocationInfo | None[source]#
- class riverine.experiments.Experiment[source]#
A class collecting many related mixes and components, allowing methods to be run that consider all of them together.
Components can be referenced, and set, by name with [], and can be iterated through.
- components: dict[str, riverine.components.AbstractComponent][source]#
- reference: riverine.references.Reference | None[source]#
- locations: LocationDict[source]#
- add(component: riverine.components.AbstractComponent, *, check_volumes: bool | None = None, apply_reference: bool = True, check_existing: bool | Literal['equal'] = 'equal') Experiment[source]#
- add_mix(mix_or_actions: riverine.mixes.Mix | Sequence[riverine.actions.AbstractAction] | riverine.actions.AbstractAction, name: str = '', test_tube_name: str | None = None, *, fixed_total_volume: riverine.units.DecimalQuantity | str | None = None, fixed_concentration: str | riverine.units.DecimalQuantity | None = None, buffer_name: str = 'Buffer', min_volume: riverine.units.DecimalQuantity | str = Q_('0.5', uL), check_volumes: bool | None = None, apply_reference: bool = True, check_existing: bool | Literal['equal'] = 'equal') Experiment[source]#
Add a mix to the experiment, either as a Mix object, or by creating a new Mix.
Either the first argument should be a Mix, or arguments should be passed as for initializing a Mix.
If check_volumes is True (by default), the mix will be added to the experiment, and volumes checked. If the mix causes a volume usage problem, it will not be added to the Experiment, and a VolumeError will be raised.
If check_existing is True (by default), then a exception is raised if the experiment already contains a mix with the name name. Otherwise, the existing mix is replaced with the new mix.
- __setitem__(name: str, mix: riverine.components.AbstractComponent) None[source]#
- __getitem__(name: str) riverine.components.AbstractComponent[source]#
- __iter__() Iterator[riverine.components.AbstractComponent][source]#
- consumed_and_produced_volumes() Mapping[str, Tuple[riverine.units.DecimalQuantity, riverine.units.DecimalQuantity]][source]#
- check_volumes(showall: bool = False, display: bool = True, raise_error: bool = False) str | None[source]#
Check to ensure that consumed volumes are less than made volumes.
- classmethod _structure(d: dict[str, Any]) Experiment[source]#
Create an Experiment from a dict representation.
- classmethod load(filename_or_stream: str | os.PathLike | TextIO) Experiment[source]#
Load an experiment from a JSON-formatted file created by Experiment.save.
- resolve_components() None[source]#
Resolve string/blank-component components in mixes, searching through the mixes in the experiment. FIXME Add used mixes to the experiment if they are not already there.
- save(filename_or_stream: str | os.PathLike | TextIO) None[source]#
Save an experiment to a JSON-formatted file.
Tries to store each component/mix only once, with other mixes referencing those components.
- use_reference(reference: riverine.references.Reference) Experiment[source]#
Apply a Reference, in place, to all components in the Experiment.