Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

work-around equalities in coupling bounds in MAT #825

Merged
merged 6 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: CI

on:
push:
branches:
- master
- develop
pull_request:

jobs:
test:
Expand All @@ -13,8 +14,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6' # Oldest supported version for COBREXA.jl
- '1' # This is always the latest stable release in the 1.X series
- '1.6' # LTS
#- 'nightly'
os:
- ubuntu-latest
Expand All @@ -23,28 +24,20 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- uses: julia-actions/julia-runtest@latest
continue-on-error: ${{ matrix.version == 'nightly' }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
307 changes: 0 additions & 307 deletions .gitlab-ci.yml

This file was deleted.

12 changes: 10 additions & 2 deletions src/base/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ function make_optimization_model(model::MetabolicModel, optimizer; sense = MAX_S
C = coupling(model) # empty if no coupling
isempty(C) || begin
cl, cu = coupling_bounds(model)
@constraint(optimization_model, c_lbs, cl .<= C * x) # coupling lower bounds
@constraint(optimization_model, c_ubs, C * x .<= cu) # coupling upper bounds
@constraint(
optimization_model,
c_lbs,
cl[isfinite.(cl)] .<= C[isfinite.(cl), :] * x
) # coupling lower bounds
@constraint(
optimization_model,
c_ubs,
C[isfinite.(cu), :] * x .<= cu[isfinite.(cu)]
) # coupling upper bounds
end

return optimization_model
Expand Down
Loading
Loading