diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2aed505..09c5235 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: tag: ${{ steps.tag_label.outputs.tag }} changelog: ${{ steps.tag_raw.outputs.changelog }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 @@ -36,7 +36,7 @@ jobs: Changelog: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 @@ -57,7 +57,7 @@ jobs: echo "$USER $PROJECT" github_changelog_generator --user "$USER" --project "$PROJECT" --no-unreleased - name: 'Upload Artifact Changelog' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: changelog-artifact path: CHANGELOG.md @@ -70,7 +70,7 @@ jobs: version_path: ${{ steps.update_version.outputs.version_path }} version_dir: ${{ steps.update_version.outputs.version_dir }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Update _version.py' id: update_version env: @@ -82,7 +82,7 @@ jobs: echo "version_path=$VERSION_PATH" >> "$GITHUB_OUTPUT" echo "version_dir=$VERSION_DIR" >> "$GITHUB_OUTPUT" - name: 'Upload Artifact Version' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: version-artifact path: ${{ steps.update_version.outputs.version_path }} @@ -93,17 +93,17 @@ jobs: steps: # Get Data - name: 'Checkout' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 - name: 'Download Artifact Version' - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: version-artifact path: ${{ needs.Version.outputs.version_dir }} - name: 'Download Artifact Changelog' - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: changelog-artifact # Commit @@ -133,7 +133,7 @@ jobs: needs: [Commit, TagRaw] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 @@ -158,9 +158,9 @@ jobs: shell: bash -l {0} # activate env conda steps: - name: 'Checkout' - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: 'Deploying miniconda' - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" environment-file: recipes/workflow.yaml @@ -178,7 +178,7 @@ jobs: filename=$(find ${{ env.dirbuild }} | head -n 1) echo "asset=$filename" >> "$GITHUB_OUTPUT" - name: 'Upload Artifact Package' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: package-conda-artifact path: ${{ steps.identify_asset.outputs.asset }} @@ -190,7 +190,7 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Download Artifact Package - Pip' - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: package-conda-artifact - name: 'Create Release' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7bd0e3f..24b2710 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} fetch-depth: 0 - name: Lint Code Base - uses: github/super-linter@v4 + uses: github/super-linter@v5 env: VALIDATE_ALL_CODEBASE: false VALIDATE_YAML: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 815ea8f..3bab06b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,8 @@ on: pull_request: branches: - main + schedule: + - cron: '0 0 * * 1' jobs: @@ -17,11 +19,11 @@ jobs: shell: bash -l {0} steps: - name: 'Checkout' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: 'Deploying miniconda' - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" environment-file: recipes/workflow.yaml @@ -44,11 +46,11 @@ jobs: shell: bash -l {0} steps: - name: 'Checkout' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: 'Deploying miniconda' - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" environment-file: recipes/workflow.yaml @@ -70,11 +72,11 @@ jobs: shell: bash -l {0} steps: - name: 'Checkout' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: 'Deploying miniconda' - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: miniconda-version: "latest" environment-file: recipes/workflow.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a11f1d..fa27b2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [3.2.1](https://github.com/brsynth/straindesign/tree/3.2.1) (2023-01-23) + +[Full Changelog](https://github.com/brsynth/straindesign/compare/3.2.0...3.2.1) + +**Merged pull requests:** + +- chore\(deps\): bump mathieudutour/github-tag-action from 6.0 to 6.1 [\#6](https://github.com/brsynth/straindesign/pull/6) ([dependabot[bot]](https://github.com/apps/dependabot)) +- chore\(deps\): bump actions/upload-artifact from 2 to 3 [\#5](https://github.com/brsynth/straindesign/pull/5) ([dependabot[bot]](https://github.com/apps/dependabot)) + ## [3.2.0](https://github.com/brsynth/straindesign/tree/3.2.0) (2023-01-05) [Full Changelog](https://github.com/brsynth/straindesign/compare/3.1.0...3.2.0) 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/src/straindesign/_version.py b/src/straindesign/_version.py index ea328e1..c5afb20 100644 --- a/src/straindesign/_version.py +++ b/src/straindesign/_version.py @@ -1,2 +1,2 @@ __app_name__ = "straindesign" -__version__ = "3.2.1" +__version__ = "3.2.2" 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