Loading .travis.yml +35 −34 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ install: - pip install --upgrade pip setuptools wheel tox tox-travis script: - tox -- --benchmark-skip --cov-report xml --cov-report term - travis_wait tox -- --benchmark-skip --cov-report xml --cov-report term - bash <(curl -s https://codecov.io/bash) stages: Loading @@ -41,30 +41,31 @@ stages: #before_deploy: # - source scripts/prepare_notes.sh jobs: include: - stage: deploy python: "3.6" install: - pip install --upgrade pip setuptools wheel script: - echo "Deploying..." deploy: - provider: pypi skip_cleanup: true distributions: sdist bdist_wheel install: skip script: - echo "Deploying COBRApy to PyPI." user: cobrapy password: $PYPI_PASSWORD on: tags: true repo: $GITHUB_REPO user: cobrapy password: $PYPI_PASSWORD - provider: script skip_cleanup: true install: skip script: scripts/deploy_website.sh on: tags: true repo: $GITHUB_REPO - provider: releases skip_cleanup: true install: skip script: - echo "Releasing COBRApy to GitHub." api_key: $GITHUB_TOKEN body: "Please see https://github.com/opencobra/cobrapy/tree/${TRAVIS_TAG}/release-notes/${TRAVIS_TAG}.md for the full release notes." on: Loading appveyor.yml +14 −39 Original line number Diff line number Diff line Loading @@ -4,57 +4,32 @@ branches: - devel - /^[0-9]+\.[0-9]+\.[0-9]+[.0-9ab]*$/ environment: global: PIP_CACHE_DIR: "pip_cache" PIP_DISABLE_PIP_VERSION_CHECK: "yes" clone_depth: 2 environment: matrix: - PYTHON: "C:\\Miniconda-x64" CONDA: true - PYTHON: "C:\\Miniconda36-x64" CONDA: true - PYTHON: "C:\\Python27-x64" TOXENV: py27 TOXENV: py36 - PYTHON: "C:\\Miniconda37-x64" TOXENV: py37 - PYTHON: "C:\\Python36-x64" TOXENV: py36 matrix: fast_finish: true clone_depth: 2 init: - "ECHO %PYTHON%" - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - python -V cache: - pip_cache -> appveyor.yml - '%LOCALAPPDATA%\pip\Cache' install: - ps: | if ($env:CONDA -eq "true") { conda config --set always_yes yes --set changeps1 no; conda config --add channels conda-forge conda install -q pip setuptools wheel numpy scipy; pip install -r develop-requirements.txt; pip install . } else { pip install --upgrade setuptools wheel tox } platform: x64 build: off install: - set PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%PATH%" - "ECHO %PYTHON%" - python --version - python -m pip install --upgrade --disable-pip-version-check pip setuptools wheel tox test_script: - ps: | if ($env:CONDA -eq "true") { pytest --benchmark-skip cobra/test } else { tox } - tox cobra/__init__.py +2 −1 Original line number Diff line number Diff line Loading @@ -13,9 +13,10 @@ from cobra.core import ( Species) from cobra import flux_analysis from cobra import io from cobra import sampling from cobra.util import show_versions __version__ = "0.14.2" __version__ = "0.15.4" # set the warning format to be prettier and fit on one line _cobra_path = _dirname(_abspath(__file__)) Loading cobra/core/__init__.py +2 −1 Original line number Diff line number Diff line Loading @@ -9,5 +9,6 @@ from cobra.core.metabolite import Metabolite from cobra.core.model import Model from cobra.core.object import Object from cobra.core.reaction import Reaction from cobra.core.solution import LegacySolution, Solution, get_solution from cobra.core.group import Group from cobra.core.solution import Solution, LegacySolution, get_solution from cobra.core.species import Species cobra/core/configuration.py +49 −4 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ class BaseConfiguration(object): solver : {"glpk", "cplex", "gurobi"} The default solver for new models. The solver choices are the ones provided by `optlang` and solvers installed in your environment. tolerance: float The default tolerance for the solver being used (default 1E-09). lower_bound : float The standard lower bound for reversible reactions (default -1000). upper_bound : float Loading @@ -50,8 +52,10 @@ class BaseConfiguration(object): def __init__(self): self._solver = None self.tolerance = 1E-07 self.lower_bound = None self.upper_bound = None # Set the default solver from a preferred order. for name in ["gurobi", "cplex", "glpk"]: try: Loading @@ -60,7 +64,9 @@ class BaseConfiguration(object): continue else: break self.bounds = -1000.0, 1000.0 try: self.processes = cpu_count() except NotImplementedError: Loading Loading @@ -99,10 +105,49 @@ class BaseConfiguration(object): self.upper_bound = bounds[1] def __repr__(self): return "solver: {}\nlower_bound: {}\nupper_bound: {}\n" \ "processes: {}".format( interface_to_str(self.solver), self.lower_bound, self.upper_bound, self.processes) return """ solver: {solver} solver tolerance: {tolerance} lower_bound: {lower_bound} upper_bound: {upper_bound} processes: {processes}""".format( solver=interface_to_str(self.solver), tolerance=self.tolerance, lower_bound=self.lower_bound, upper_bound=self.upper_bound, processes=self.processes, ) def _repr_html_(self): return """ <table> <tr> <td><strong>Solver</strong></td> <td>{solver}</td> </tr> <tr> <td><strong>Solver tolerance</strong></td> <td>{tolerance}</td> </tr> <tr> <td><strong>Lower bound</strong></td> <td>{lower_bound}</td> </tr> <tr> <td><strong>Upper bound</strong></td> <td>{upper_bound}</td> </tr> <tr> <td><strong>Processes</strong></td> <td>{processes}</td> </tr> </table>""".format( solver=interface_to_str(self.solver), tolerance=self.tolerance, lower_bound=self.lower_bound, upper_bound=self.upper_bound, processes=self.processes, ) class Configuration(with_metaclass(Singleton, BaseConfiguration)): Loading Loading
.travis.yml +35 −34 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ install: - pip install --upgrade pip setuptools wheel tox tox-travis script: - tox -- --benchmark-skip --cov-report xml --cov-report term - travis_wait tox -- --benchmark-skip --cov-report xml --cov-report term - bash <(curl -s https://codecov.io/bash) stages: Loading @@ -41,30 +41,31 @@ stages: #before_deploy: # - source scripts/prepare_notes.sh jobs: include: - stage: deploy python: "3.6" install: - pip install --upgrade pip setuptools wheel script: - echo "Deploying..." deploy: - provider: pypi skip_cleanup: true distributions: sdist bdist_wheel install: skip script: - echo "Deploying COBRApy to PyPI." user: cobrapy password: $PYPI_PASSWORD on: tags: true repo: $GITHUB_REPO user: cobrapy password: $PYPI_PASSWORD - provider: script skip_cleanup: true install: skip script: scripts/deploy_website.sh on: tags: true repo: $GITHUB_REPO - provider: releases skip_cleanup: true install: skip script: - echo "Releasing COBRApy to GitHub." api_key: $GITHUB_TOKEN body: "Please see https://github.com/opencobra/cobrapy/tree/${TRAVIS_TAG}/release-notes/${TRAVIS_TAG}.md for the full release notes." on: Loading
appveyor.yml +14 −39 Original line number Diff line number Diff line Loading @@ -4,57 +4,32 @@ branches: - devel - /^[0-9]+\.[0-9]+\.[0-9]+[.0-9ab]*$/ environment: global: PIP_CACHE_DIR: "pip_cache" PIP_DISABLE_PIP_VERSION_CHECK: "yes" clone_depth: 2 environment: matrix: - PYTHON: "C:\\Miniconda-x64" CONDA: true - PYTHON: "C:\\Miniconda36-x64" CONDA: true - PYTHON: "C:\\Python27-x64" TOXENV: py27 TOXENV: py36 - PYTHON: "C:\\Miniconda37-x64" TOXENV: py37 - PYTHON: "C:\\Python36-x64" TOXENV: py36 matrix: fast_finish: true clone_depth: 2 init: - "ECHO %PYTHON%" - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - python -V cache: - pip_cache -> appveyor.yml - '%LOCALAPPDATA%\pip\Cache' install: - ps: | if ($env:CONDA -eq "true") { conda config --set always_yes yes --set changeps1 no; conda config --add channels conda-forge conda install -q pip setuptools wheel numpy scipy; pip install -r develop-requirements.txt; pip install . } else { pip install --upgrade setuptools wheel tox } platform: x64 build: off install: - set PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%PATH%" - "ECHO %PYTHON%" - python --version - python -m pip install --upgrade --disable-pip-version-check pip setuptools wheel tox test_script: - ps: | if ($env:CONDA -eq "true") { pytest --benchmark-skip cobra/test } else { tox } - tox
cobra/__init__.py +2 −1 Original line number Diff line number Diff line Loading @@ -13,9 +13,10 @@ from cobra.core import ( Species) from cobra import flux_analysis from cobra import io from cobra import sampling from cobra.util import show_versions __version__ = "0.14.2" __version__ = "0.15.4" # set the warning format to be prettier and fit on one line _cobra_path = _dirname(_abspath(__file__)) Loading
cobra/core/__init__.py +2 −1 Original line number Diff line number Diff line Loading @@ -9,5 +9,6 @@ from cobra.core.metabolite import Metabolite from cobra.core.model import Model from cobra.core.object import Object from cobra.core.reaction import Reaction from cobra.core.solution import LegacySolution, Solution, get_solution from cobra.core.group import Group from cobra.core.solution import Solution, LegacySolution, get_solution from cobra.core.species import Species
cobra/core/configuration.py +49 −4 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ class BaseConfiguration(object): solver : {"glpk", "cplex", "gurobi"} The default solver for new models. The solver choices are the ones provided by `optlang` and solvers installed in your environment. tolerance: float The default tolerance for the solver being used (default 1E-09). lower_bound : float The standard lower bound for reversible reactions (default -1000). upper_bound : float Loading @@ -50,8 +52,10 @@ class BaseConfiguration(object): def __init__(self): self._solver = None self.tolerance = 1E-07 self.lower_bound = None self.upper_bound = None # Set the default solver from a preferred order. for name in ["gurobi", "cplex", "glpk"]: try: Loading @@ -60,7 +64,9 @@ class BaseConfiguration(object): continue else: break self.bounds = -1000.0, 1000.0 try: self.processes = cpu_count() except NotImplementedError: Loading Loading @@ -99,10 +105,49 @@ class BaseConfiguration(object): self.upper_bound = bounds[1] def __repr__(self): return "solver: {}\nlower_bound: {}\nupper_bound: {}\n" \ "processes: {}".format( interface_to_str(self.solver), self.lower_bound, self.upper_bound, self.processes) return """ solver: {solver} solver tolerance: {tolerance} lower_bound: {lower_bound} upper_bound: {upper_bound} processes: {processes}""".format( solver=interface_to_str(self.solver), tolerance=self.tolerance, lower_bound=self.lower_bound, upper_bound=self.upper_bound, processes=self.processes, ) def _repr_html_(self): return """ <table> <tr> <td><strong>Solver</strong></td> <td>{solver}</td> </tr> <tr> <td><strong>Solver tolerance</strong></td> <td>{tolerance}</td> </tr> <tr> <td><strong>Lower bound</strong></td> <td>{lower_bound}</td> </tr> <tr> <td><strong>Upper bound</strong></td> <td>{upper_bound}</td> </tr> <tr> <td><strong>Processes</strong></td> <td>{processes}</td> </tr> </table>""".format( solver=interface_to_str(self.solver), tolerance=self.tolerance, lower_bound=self.lower_bound, upper_bound=self.upper_bound, processes=self.processes, ) class Configuration(with_metaclass(Singleton, BaseConfiguration)): Loading