Skip to content

Commit

Permalink
Merge pull request #21 from MetExplore/development
Browse files Browse the repository at this point in the history
Prepare v0.9.0-beta.5
  • Loading branch information
pablormier authored Aug 21, 2021
2 parents 9f2ddee + 6078f4d commit c8643c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion miom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
from miom.mio import load_gem

__all__ = ["load", "load_gem", "Solvers", "Comparator", "ExtractionMode"]
__version__ = "0.9.0-beta.4"
__version__ = "0.9.0-beta.5"
13 changes: 9 additions & 4 deletions miom/miom.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,7 @@ def subset_selection(self, rxn_weights, direction='max', eps=1e-2):
# Calculate min valid EPS based on integrality tolerance
min_eps = self._options["_min_eps"]
if eps < min_eps:
warnings.warn(f"The minimum epsilon value for the current solver \
parameters is {min_eps}, which is less than {eps}.")
warnings.warn(f"Minimum epsilon value below min. allowed value, changed to {min_eps}.")
eps = max(eps, min_eps)
if not isinstance(rxn_weights, Iterable):
rxn_weights = [rxn_weights] * self.network.num_reactions
Expand Down Expand Up @@ -920,6 +919,7 @@ def _copy(self, **kwargs):
m = PicosModel(previous_step_model=self)
m.problem = self.problem.copy()
variables = m.problem._mutables.keys()
m.variables._assigned_reactions = self.variables._assigned_reactions
if "X" in variables:
m.variables._indicator_vars = m.problem._mutables.get("X")
if "V" in variables:
Expand Down Expand Up @@ -1069,8 +1069,13 @@ def _select_subnetwork(self, **kwargs):
def _copy(self, **kwargs):
m = PythonMipModel(previous_step_model=self)
m.problem = self.problem.copy()
m.variables._flux_vars = [v for v in m.problem.vars if v.name.startswith("V_")]
m.variables._indicator_vars = [v for v in m.problem.vars if v.name.startswith("X_")]
m.variables._assigned_reactions = self.variables._assigned_reactions
fluxvars = [v for v in m.problem.vars if v.name.startswith("V_")]
indicators = [v for v in m.problem.vars if v.name.startswith("X_")]
if len(fluxvars) > 0:
m.variables._flux_vars = fluxvars
if len(indicators) > 0:
m.variables._indicator_vars = indicators
return m


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "miom"
version = "0.9.0-beta.4"
version = "0.9.0-beta.5"
description = "Mixed Integer Optimization for Metabolism"
authors = ["Pablo R. Mier <[email protected]>"]
keywords = ["optimization", "LP", "MIP", "metabolism", "metabolic-networks"]
Expand Down

0 comments on commit c8643c9

Please sign in to comment.