6.1.1.2.1.1. equilibrator_api.model.bounds
Define lower and upper bounds on compounds.
6.1.1.2.1.1.1. Module Contents
- class equilibrator_api.model.bounds.BaseBounds[source]
Bases:
object
A base class for declaring bounds on things.
- abstract get_lower_bound(compound: str | equilibrator_cache.Compound)[source]
Get the lower bound for this key.
- Parameters:
key – a compound
- abstract get_upper_bound(compound: str | equilibrator_cache.Compound)[source]
Get the upper bound for this key.
- Parameters:
key – a compound
- get_lower_bounds(compounds: Iterable[str | equilibrator_cache.Compound]) Iterable[equilibrator_api.Q_] [source]
Get the bounds for a set of keys in order.
- Parameters:
compounds – an iterable of Compounds or strings
- Returns:
an iterable of the lower bounds
- get_upper_bounds(compounds: Iterable[str | equilibrator_cache.Compound]) Iterable[equilibrator_api.Q_] [source]
Get the bounds for a set of keys in order.
- Parameters:
compounds – an iterable of Compounds or strings
- Returns:
an iterable of the upper bounds
- get_bound_tuple(compound: str | equilibrator_cache.Compound) Tuple[equilibrator_api.Q_, equilibrator_api.Q_] [source]
Get both upper and lower bounds for this key.
- Parameters:
compound – a Compound object or string
- Returns:
a 2-tuple (lower bound, upper bound)
- get_bounds(compounds: Iterable[str | equilibrator_cache.Compound]) Tuple[Iterable[equilibrator_api.Q_], Iterable[equilibrator_api.Q_]] [source]
Get the bounds for a set of compounds.
- Parameters:
compounds – an iterable of Compounds
- Returns:
a 2-tuple (lower bounds, upper bounds)
- static conc2ln_conc(b: equilibrator_api.Q_) float [source]
Convert a concentration to log-concentration.
- Parameters:
b – a concentration
- Returns:
the log concentration
- get_ln_bounds(compounds: Iterable[str | equilibrator_cache.Compound]) Tuple[Iterable[float], Iterable[float]] [source]
Get the log-bounds for a set of compounds.
- Parameters:
compounds – an iterable of Compounds or strings
- Returns:
a 2-tuple (log lower bounds, log upper bounds)
- get_ln_lower_bounds(compounds: Iterable[str | equilibrator_cache.Compound]) Iterable[float] [source]
Get the log lower bounds for a set of compounds.
- Parameters:
compounds – an iterable of Compounds or strings
- Returns:
an iterable of log lower bounds
- class equilibrator_api.model.bounds.Bounds(lower_bounds: Dict[str | equilibrator_cache.Compound, equilibrator_api.Q_] = None, upper_bounds: Dict[str | equilibrator_cache.Compound, equilibrator_api.Q_] = None, default_lb: equilibrator_api.Q_ = default_conc_lb, default_ub: equilibrator_api.Q_ = default_conc_ub)[source]
Bases:
BaseBounds
Contains upper and lower bounds for various keys.
Allows for defaults.
- classmethod from_csv(f: TextIO | path.Path, comp_contrib: equilibrator_api.ComponentContribution, default_lb: equilibrator_api.Q_ = default_conc_lb, default_ub: equilibrator_api.Q_ = default_conc_ub) Bounds [source]
Read Bounds from a CSV file.
- Parameters:
f (File) – an open .csv file stream
comp_contrib (ComponentContribution) – used for parsing compound accessions
default_lb (Q_) – the default lower bound
default_ub (Q_) – the default upper bound
- get_lower_bound(compound: str | equilibrator_cache.Compound) equilibrator_api.Q_ [source]
Get the lower bound for this compound.
- get_upper_bound(compound: str | equilibrator_cache.Compound) equilibrator_api.Q_ [source]
Get the upper bound for this compound.
- static get_default_bounds(comp_contrib: equilibrator_api.ComponentContribution) Bounds [source]
Return the default lower and upper bounds for a pre-determined list.
- Parameters:
comp_contrib (ComponentContribution) –
- Return type:
a Bounds object with the default values