diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 56c7fd4..80b65d1 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = '0.0.8' %} +{% set version = '0.0.9' %} package: name: optlang_enumerator @@ -19,6 +19,7 @@ requirements: - optlang - cobra - efmtool_link + - sympy>=1.12 build: diff --git a/optlang_enumerator/mcs_computation.py b/optlang_enumerator/mcs_computation.py index c28f319..c8ebb46 100644 --- a/optlang_enumerator/mcs_computation.py +++ b/optlang_enumerator/mcs_computation.py @@ -155,14 +155,14 @@ def parse_relation(lhs : str, rhs : float, reac_id_symbols=None): denominator = lhs[slash+1:] numerator = lhs[0:slash] denominator = parse_expr(denominator, transformations=transformations, evaluate=False, local_dict=reac_id_symbols) - denominator = sympy.collect(denominator, denominator.free_symbols) + denominator = sympy.collect(sympy.expand(denominator), denominator.free_symbols) numerator = parse_expr(numerator, transformations=transformations, evaluate=False, local_dict=reac_id_symbols) - numerator = sympy.collect(numerator, numerator.free_symbols) + numerator = sympy.collect(sympy.expand(numerator), numerator.free_symbols) lhs = numerator - rhs*denominator rhs = 0 else: lhs = parse_expr(lhs, transformations=transformations, evaluate=False, local_dict=reac_id_symbols) - lhs = sympy.collect(lhs, lhs.free_symbols, evaluate=False) + lhs = sympy.collect(sympy.expand(lhs), lhs.free_symbols, evaluate=False) return lhs, rhs diff --git a/setup.py b/setup.py index cda86c2..b7dcd52 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,12 @@ from setuptools import setup setup(name='optlang_enumerator', - version='0.0.8', + version='0.0.9', description='Enumeration of multiple solutions to a MILP with optlang.', url='https://github.com/cnapy-org/optlang_enumerator.git', author='Axel von Kamp', author_email='axelk1@gmx.de', license='Apache License 2.0', packages=['optlang_enumerator'], - install_requires=['numpy<1.24', 'scipy', 'cobra', 'optlang', 'efmtool_link', 'sympy', 'swiglpk'], + install_requires=['numpy<1.24', 'scipy', 'cobra', 'optlang', 'efmtool_link', 'sympy>=1.12', 'swiglpk'], zip_safe=False)