7.1.1.3.1.3. pta.sampling.primitives
Abstract base class for sampling over the flux polytope.
7.1.1.3.1.3.1. Module Contents
- class pta.sampling.primitives.FluxSpaceSamplingModel(polytope: PolyRound.api.Polytope, reaction_ids: List[str])[source]
Bases:
pta.sampling.commons.SamplerInterfaceObject holding the information necessary to sample a flux space.
- Parameters
polytope (Polytope) – Polytope object describing the flux space.
reaction_ids (List[str]) – Identifiers of the reactions in the flux space.
- property h(self) numpy.array[source]
Gets the right-hand side of the constraints of the flux space.
- property to_fluxes_transform(self) Tuple[numpy.array, numpy.array][source]
Gets the transform from a point in the model to a point in the flux space.
- to_fluxes(self, value: numpy.array) numpy.array[source]
Transform a point or matrix from the model to the flux space.
- Parameters
value (np.array) – Input values.
- Returns
The corresponding fluxes.
- Return type
np.array
- get_initial_points(self, num_points: int) numpy.array[source]
Gets initial points for sampling fluxes.
- Parameters
model (UniformSamplingModel) – The model to sample.
num_points (int) – Number of initial points to generate.
- Returns
Array containing the initial points.
- Return type
np.array