4.1.1.2.1.1. equilibrator_api.model.bounds¶
Define lower and upper bounds on compounds.
4.1.1.2.1.1.1. Module Contents¶
-
class
equilibrator_api.model.bounds.BaseBounds[source]¶ Bases:
objectA base class for declaring bounds on things.
-
abstract
get_lower_bound(self, compound: equilibrator_cache.Compound)[source]¶ Get the lower bound for this key.
- Parameters
key – a compound
-
abstract
get_upper_bound(self, compound: equilibrator_cache.Compound)[source]¶ Get the upper bound for this key.
- Parameters
key – a compound
-
get_lower_bounds(self, compounds: Iterable[Compound]) → Iterable[Q_][source]¶ Get the bounds for a set of keys in order.
- Parameters
compounds – an iterable of Compounds
- Returns
an iterable of the lower bounds
-
get_upper_bounds(self, compounds: Iterable[Compound]) → Iterable[Q_][source]¶ Get the bounds for a set of keys in order.
- Parameters
compounds – an iterable of Compounds
- Returns
an iterable of the upper bounds
-
get_bound_tuple(self, compound: equilibrator_cache.Compound) → Tuple[Q_, Q_][source]¶ Get both upper and lower bounds for this key.
- Parameters
compound – a Compound object
- Returns
a 2-tuple (lower bound, upper bound)
-
get_bounds(self, compounds: Iterable[Compound]) → Tuple[Iterable[Q_], Iterable[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(self, compounds: Iterable[Compound]) → Tuple[Iterable[float], Iterable[float]][source]¶ Get the log-bounds for a set of compounds.
- Parameters
compounds – an iterable of Compounds
- Returns
a 2-tuple (log lower bounds, log upper bounds)
-
get_ln_lower_bounds(self, compounds: Iterable[Compound]) → Iterable[float][source]¶ Get the log lower bounds for a set of compounds.
- Parameters
compounds – an iterable of Compounds
- Returns
an iterable of log lower bounds
-
get_ln_upper_bounds(self, compounds: Iterable[Compound]) → Iterable[float][source]¶ Get the log upper bounds for a set of compounds.
- Parameters
compounds – an iterable of Compounds
- Returns
an iterable of log upper bounds
-
set_bounds(self, compound: equilibrator_cache.Compound, lb: equilibrator_api.Q_, ub: equilibrator_api.Q_) → None[source]¶ Set bounds for a specific key.
- Parameters
key – a string representation of a KEGG compound ID,
i.e. C00001 for water :param lb: the lower bound value :param ub: the upper bound value
-
abstract
-
class
equilibrator_api.model.bounds.Bounds(lower_bounds: Dict[Compound, Q_] = None, upper_bounds: Dict[Compound, Q_] = None, default_lb: equilibrator_api.Q_ = default_conc_lb, default_ub: equilibrator_api.Q_ = default_conc_ub)[source]¶ Bases:
equilibrator_api.model.bounds.BaseBoundsContains upper and lower bounds for various keys.
Allows for defaults.
-
classmethod
from_csv(cls, f: TextIO, comp_contrib: equilibrator_api.ComponentContribution, default_lb: equilibrator_api.Q_ = default_conc_lb, default_ub: equilibrator_api.Q_ = default_conc_ub) → equilibrator_api.model.bounds.Bounds[source]¶ Read Bounds from a CSV file.
- Parameters
f (TextIO) – 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
-
copy(self) → equilibrator_api.model.bounds.Bounds[source]¶ Return a deep copy of self.
-
get_lower_bound(self, compound: equilibrator_cache.Compound) → equilibrator_api.Q_[source]¶ Get the lower bound for this compound.
-
get_upper_bound(self, compound: equilibrator_cache.Compound) → equilibrator_api.Q_[source]¶ Get the upper bound for this compound.
-
static
get_default_bounds(comp_contrib: equilibrator_api.ComponentContribution) → equilibrator_api.model.bounds.Bounds[source]¶ Return the default lower and upper bounds for a pre-determined list.
- Parameters
comp_contrib (ComponentContribution) –
- Returns
- Return type
a Bounds object with the default values
-
classmethod