Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f58f9d6
perf(link_z): derive big-M from variable bounds instead of a per-row LP
VonAlphaBisZulu Jul 10, 2026
87fdbb0
Merge branch 'main' into perf-remove-boundm-lp-main
VonAlphaBisZulu Jul 13, 2026
bc81541
docs(link_z): note the arity-1 bound-fold consolidation step (not ena…
VonAlphaBisZulu Jul 17, 2026
283c9b4
perf(reassign_lb_ub_from_ineq): linear arity scan instead of O(nnz^2)
VonAlphaBisZulu Jul 17, 2026
a130ce7
perf(link_z): fix structurally-vacuous intervention binaries to zero
VonAlphaBisZulu Jul 17, 2026
66a9f83
feat(protect): per-block region-FVA bounds (blocked + reversibility),…
VonAlphaBisZulu Jul 17, 2026
1c22d63
feat(protect): make region-FVA unconditional (remove protect_region_f…
VonAlphaBisZulu Jul 17, 2026
ff2ac5a
feat(compression): revert compression-induced coeff shift in module c…
VonAlphaBisZulu Jul 17, 2026
9cb4482
refactor(fva): compute region FVA once for all modules; SDMILP reads …
VonAlphaBisZulu Jul 17, 2026
477b152
feat(protect->suppress): apply region-FVA bound override to SUPPRESS too
VonAlphaBisZulu Jul 17, 2026
33f8592
refactor(link_z): fix free intervention binaries at END of link_z (wa…
VonAlphaBisZulu Jul 17, 2026
7a6a1da
perf: skip solver backend rebuild on preprocessing model copies
VonAlphaBisZulu Jul 18, 2026
ca67ab5
perf(compress): group parallel reactions in O(n) instead of O(n^2)
VonAlphaBisZulu Jul 18, 2026
9002b71
refactor(gpr): pass solver name into extend_model_gpr instead of read…
VonAlphaBisZulu Jul 18, 2026
d71971e
refactor(gpr): always truncate over-long pseudo-reaction names, drop …
VonAlphaBisZulu Jul 18, 2026
a02e501
fix(fba): unbounded branch passed a bare float to add_eq_constraints …
VonAlphaBisZulu Jul 18, 2026
1b2ae8d
perf(enum): add k-sweep enumeration loop; default it for CPLEX (~2x, …
VonAlphaBisZulu Jul 19, 2026
9ce37ee
fix(compress): keep compressed model portable — Fraction-only coeffs …
VonAlphaBisZulu Jul 20, 2026
83f6656
fix(compress): prune stale group members in compress_cobra_model too …
VonAlphaBisZulu Jul 20, 2026
bd486ff
perf(compress): pre-tighten reaction reversibility before compress #1
VonAlphaBisZulu Jul 21, 2026
78f144d
feat(gpr): monotone GPR-rule minimizer to shrink the gadget in gene-b…
VonAlphaBisZulu Jul 21, 2026
287f9da
perf(SDProblem): drop solver/optlang + FVA deps in construction; fix …
VonAlphaBisZulu Jul 22, 2026
5cd9a1e
fix(compression): make compress_model_coupled stub-solver safe
VonAlphaBisZulu Jul 22, 2026
e96072f
fix(enum): guard k-sweep against non-integer intervention costs
VonAlphaBisZulu Jul 22, 2026
df775fb
change(enum): stop defaulting CPLEX to k-sweep; use populate for all …
VonAlphaBisZulu Jul 22, 2026
3e5af6c
style(comments): describe usage and intent, not change history
VonAlphaBisZulu Jul 22, 2026
190c5fb
refactor(compression): prune stale groups in suppress_lp_context; dro…
VonAlphaBisZulu Jul 22, 2026
1277b9f
test(gpr): cover the ast-based GPR helpers; use cobra as_symbolic for…
VonAlphaBisZulu Jul 22, 2026
cb0cdeb
Merge main into perf-remove-boundm-lp-main (draft-PR CI skip)
VonAlphaBisZulu Jul 22, 2026
f70a11f
refactor(compression): one GPR-combine entry point; inline stale-grou…
VonAlphaBisZulu Jul 22, 2026
b7e43fe
chore: untrack perf-test result artefacts
VonAlphaBisZulu Jul 22, 2026
d6a9136
refactor: disable the k-sweep enumeration path; fold the cheap model …
VonAlphaBisZulu Jul 22, 2026
f73f262
fix(compression): keep lumped reactions in their most-detailed member…
VonAlphaBisZulu Jul 22, 2026
cad2994
fix(compression): prefer preserving a small finite bound when rescali…
VonAlphaBisZulu Jul 23, 2026
e1f94d3
refactor(gpr): rename gpr_bitmask -> gpr_simplify, to_cover -> to_dnf
VonAlphaBisZulu Jul 23, 2026
bcfffb0
docs/naming: address PR #69 review comments (comments, docstrings, to…
VonAlphaBisZulu Jul 23, 2026
762b47d
docs: update renamed symbol references to *_to_fraction in developers…
VonAlphaBisZulu Jul 23, 2026
6558f45
refactor(compression): co-locate nnz and small-bound scale-member choice
VonAlphaBisZulu Jul 23, 2026
0b44192
refactor(gpr): run simplify before gpr count log + report elapsed time
VonAlphaBisZulu Jul 23, 2026
e23dc79
test(preprocessing): group per-case GPR helper tests via parametrize
VonAlphaBisZulu Jul 23, 2026
971d2d9
refactor(speedy_fva): hoist degeneracy-guard tolerance to _DEGEN_TOL
VonAlphaBisZulu Jul 24, 2026
33535e2
perf(suppress): drop live solver backend from suppressed model copies
VonAlphaBisZulu Jul 24, 2026
f132475
refactor(override): _region_fva_override -> _region_bound_override (g…
VonAlphaBisZulu Jul 24, 2026
62e0af2
refactor(override): _region_bound_override -> _module_bound_override,…
VonAlphaBisZulu Jul 24, 2026
cabea0a
refactor(gpr): move GPR simplification into compression.py + run it i…
VonAlphaBisZulu Jul 24, 2026
6bfaaeb
refactor(gpr): move reduce_gpr -> reduce_model_gprs into the pipeline…
VonAlphaBisZulu Jul 24, 2026
639a8e8
refactor(gpr): (b) reduce_model_gprs delegates boolean simplification…
VonAlphaBisZulu Jul 24, 2026
639c9df
perf(preprocessing): fold single-module FVA passes
VonAlphaBisZulu Jul 24, 2026
38d00bd
style(compression): simplify section comments
VonAlphaBisZulu Jul 24, 2026
0d1f170
docs(guide): rewrite developer's guide for the current pipeline
VonAlphaBisZulu Jul 24, 2026
5642a24
fix(reversibility): decide directions on exact signs, never on an uns…
VonAlphaBisZulu Jul 24, 2026
3f90de7
fix(override): require a real margin before fixing a module bound on …
VonAlphaBisZulu Jul 24, 2026
9c1b890
fix(compression): compare backends up to lump scale, warn on efmtool_…
VonAlphaBisZulu Jul 24, 2026
53289f9
refactor(preprocessing): give the module essentiality rule a single home
VonAlphaBisZulu Jul 24, 2026
219305b
fix(preprocessing): lift the essentiality margin above solver feasibi…
VonAlphaBisZulu Jul 24, 2026
03fbb0a
docs(guide): cite code by symbol, and correct claims that contradict …
VonAlphaBisZulu Jul 24, 2026
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,6 @@ efmtool_port/
benchmark_compression.py
benchmark_simple.py
profile_compression.py
compression_benchmark.png
compression_benchmark.png
# perf-test artefacts
tests/perf_results/
2,682 changes: 758 additions & 1,924 deletions docs/source/developers_guide.md

Large diffs are not rendered by default.

634 changes: 439 additions & 195 deletions straindesign/compression.py

Large diffs are not rendered by default.

326 changes: 298 additions & 28 deletions straindesign/compute_strain_designs.py

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions straindesign/efmtool_cmp_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ def jBigFraction2sympyRat(val):
return jBigIntegerPair2sympyRat(val.getNumerator(), val.getDenominator())


def jBigFraction2fraction(val):
"""Convert Java BigFraction to fractions.Fraction."""
from fractions import Fraction
r = jBigIntegerPair2sympyRat(val.getNumerator(), val.getDenominator())
return Fraction(int(r.p), int(r.q))


def jBigIntegerPair2sympyRat(numer, denom):
"""Convert Java BigInteger pair to sympy Rational (requires sympy)."""
import sympy
Expand Down Expand Up @@ -378,13 +385,13 @@ def compress_model_java(model, suppressed_reactions=set()):
dict: Reaction map from compressed to original reactions with scaling factors
"""
import jpype
from .networktools import stoichmat_coeff2rational
from .networktools import stoichmat_coeff_to_fraction

# Initialize Java if not already done
_init_java()

# Convert to rational coefficients for Java
stoichmat_coeff2rational(model)
stoichmat_coeff_to_fraction(model)

for r in model.reactions:
r.gene_reaction_rule = ''
Expand Down Expand Up @@ -442,7 +449,7 @@ def compress_model_java(model, suppressed_reactions=set()):
model.reactions[r0_mi].subset_stoich = []
for ai in rxn_ai:
mi = active_to_model[ai]
factor = jBigFraction2sympyRat(comprec.post.getBigFractionValueAt(ai, j))
factor = jBigFraction2fraction(comprec.post.getBigFractionValueAt(ai, j))
model.reactions[mi] *= factor
if model.reactions[mi].lower_bound not in (0, -float('inf')):
model.reactions[mi].lower_bound /= abs(subset_matrix[ai, j])
Expand Down Expand Up @@ -472,7 +479,7 @@ def compress_model_java(model, suppressed_reactions=set()):
merged_obj = 0.0
for ai in rxn_ai:
mi = active_to_model[ai]
factor = jBigFraction2sympyRat(comprec.post.getBigFractionValueAt(ai, j))
factor = jBigFraction2fraction(comprec.post.getBigFractionValueAt(ai, j))
merged_obj += _obj.pop(old_reac_ids[mi], 0.0) * float(factor)
if merged_obj != 0:
_obj[model.reactions[r0_mi].id] = merged_obj
Expand Down
2 changes: 1 addition & 1 deletion straindesign/lptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def fba(model, **kwargs) -> Solution:
if min_cx <= 0 or isnan(min_cx):
num_prob.add_eq_constraints(c, [-1.0])
else:
num_prob.add_eq_constraints(c, min_cx)
num_prob.add_eq_constraints(c, [-min_cx])
x, _, _ = num_prob.solve()
elif status not in [OPTIMAL, UNBOUNDED]:
status = INFEASIBLE
Expand Down
Loading
Loading