From 09a00fd74fbbae3f1037c74cda0ab46a79dce0fe Mon Sep 17 00:00:00 2001 From: GuillaumeG Date: Mon, 4 Mar 2024 14:25:16 +0100 Subject: [PATCH] fix(deps): update libs (#13) * fix(deps): update libs * styles(cameobrs): super-linter * chore(github): update deps --- recipes/meta.yaml | 12 ++++-------- recipes/workflow.yaml | 7 +++---- .../deterministic/flux_variability_based.py | 12 +++--------- .../unit/test_strain_design_deterministic.py | 4 ++-- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/recipes/meta.yaml b/recipes/meta.yaml index 571176d..71418dd 100644 --- a/recipes/meta.yaml +++ b/recipes/meta.yaml @@ -1,5 +1,5 @@ {% set name = "straindesign" %} -{% set version = "3.1.0" %} +{% set version = "3.2.3" %} package: name: {{ name }} @@ -16,14 +16,13 @@ build: requirements: build: - pip - - python + - python>=3.8 - pyyaml - setuptools run: - biopython - blessings - - click - - cobra>=0.24 + - cobra>=0.29 - escher - future - gnomic @@ -31,14 +30,11 @@ requirements: - IProgress - lazy-object-proxy - plotly - - python - - markupsafe + - python>=3.8 - networkx - numexpr - - numpy<1.24 # Related to https://github.com/numpy/numpy/pull/22607 - openbabel - openpyxl - - optlang - ordered-set - palettable - pandas diff --git a/recipes/workflow.yaml b/recipes/workflow.yaml index 36d477e..b30dc54 100644 --- a/recipes/workflow.yaml +++ b/recipes/workflow.yaml @@ -1,4 +1,4 @@ -name: test +name: straindesign-local channels: - conda-forge - plotly @@ -8,7 +8,7 @@ dependencies: - biopython - blessings - click - - cobra>=0.24 + - cobra - conda-build - escher - future @@ -20,10 +20,9 @@ dependencies: - markupsafe - networkx - numexpr - - numpy<1.24 # Related to https://github.com/numpy/numpy/pull/22607 + - numpy - openbabel - openpyxl - - optlang - ordered-set - palettable - pandas diff --git a/src/cameobrs/strain_design/deterministic/flux_variability_based.py b/src/cameobrs/strain_design/deterministic/flux_variability_based.py index 1ab386a..69c832d 100644 --- a/src/cameobrs/strain_design/deterministic/flux_variability_based.py +++ b/src/cameobrs/strain_design/deterministic/flux_variability_based.py @@ -360,11 +360,7 @@ def run( ].values if self.normalize_ranges_by is not None: - logger.debug( - self.reference_flux_ranges.loc[ - self.normalize_ranges_by, - ] - ) + logger.debug(self.reference_flux_ranges.loc[self.normalize_ranges_by,]) # The most obvious flux to normalize by is the biomass reaction # flux. This is probably always greater than zero. Just in case # the model is defined differently or some other normalizing @@ -435,7 +431,7 @@ def run( results = list(view.map(func_obj, self.grid.iterrows())) solutions = dict( - (tuple(point.iteritems()), fva_result) for (point, fva_result) in results + (tuple(point.items()), fva_result) for (point, fva_result) in results ) for sol in solutions.values(): @@ -880,7 +876,7 @@ def _display_on_map_static(self, index, map_name, palette="RdYlBu", **kwargs): reaction_data[numpy.isposinf(reaction_data)] = reaction_data.max() reaction_data[numpy.isneginf(reaction_data)] = reaction_data.min() - reaction_data = dict(reaction_data.iteritems()) + reaction_data = dict(reaction_data.items()) reaction_data["max"] = numpy.abs(values).max() reaction_data["min"] = -reaction_data["max"] @@ -1114,7 +1110,6 @@ def run( exclude_ids.append(reaction) with TimeMachine() as tm: - tm(do=int, undo=partial(setattr, model, "objective", model.objective)) tm(do=int, undo=partial(setattr, target, "lower_bound", target.lower_bound)) tm(do=int, undo=partial(setattr, target, "upper_bound", target.upper_bound)) @@ -1228,7 +1223,6 @@ def __init__( *args, **kwargs, ): - super(FSEOFResult, self).__init__( self._generate_designs(reference, enforced_levels, reaction_results), *args, diff --git a/tests/cameobrs/unit/test_strain_design_deterministic.py b/tests/cameobrs/unit/test_strain_design_deterministic.py index 91347cc..bb02daf 100644 --- a/tests/cameobrs/unit/test_strain_design_deterministic.py +++ b/tests/cameobrs/unit/test_strain_design_deterministic.py @@ -207,11 +207,11 @@ def test_result_is_correct(self, glpk_growth_coupling_potential): fva = cameobrs.flux_variability_analysis( model, fraction_of_optimum=1, remove_cycles=False, reactions=["PFL"] ) - assert fva["lower_bound"][0] <= 0 <= fva["upper_bound"][0] + assert fva["lower_bound"].iloc[0] <= 0 <= fva["upper_bound"].iloc[0] with model: for knockout in knockouts: model.reactions.get_by_id(knockout).knock_out() fva = cameobrs.flux_variability_analysis( model, fraction_of_optimum=1, remove_cycles=False, reactions=["PFL"] ) - assert abs(fva["lower_bound"][0]) > 4 + assert abs(fva["lower_bound"].iloc[0]) > 4