From fe4200f32f9bca5075eb09449b9dcb3eb68c467b Mon Sep 17 00:00:00 2001 From: w-bonelli Date: Wed, 14 Dec 2022 07:27:40 -0500 Subject: [PATCH] ci: refactor release scripts/docs, add release workflow --- .github/workflows/release.yml | 391 +++++++++++++++++ autotest/regression/test_lgr.py | 2 +- autotest/test_export.py | 6 +- autotest/test_get_modflow.py | 41 +- cliff.toml | 45 ++ docs/make_release.md | 169 ++++---- docs/version_changes.md | 696 +++++++++++++++--------------- etc/environment.yml | 4 +- examples/common/notebook_utils.py | 1 + flopy/utils/get_modflow.py | 29 +- scripts/README.md | 41 ++ scripts/make-release.py | 378 ---------------- scripts/update-version_changes.py | 247 ----------- scripts/update_version.py | 425 ++++++++++++++++++ setup.cfg | 1 + version.txt | 1 + 16 files changed, 1366 insertions(+), 1111 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 cliff.toml create mode 100644 scripts/README.md delete mode 100755 scripts/make-release.py delete mode 100644 scripts/update-version_changes.py create mode 100644 scripts/update_version.py create mode 100644 version.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..8eb618dfa8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,391 @@ +name: FloPy release +on: + push: + branches: + - master + - v* + release: + types: + - published +jobs: + prep: + name: Prepare release + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.ref_name != 'master' }} + permissions: + contents: write + defaults: + run: + shell: bash + steps: + + - name: Checkout release branch + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.7 + cache: 'pip' + cache-dependency-path: setup.cfg + + - name: Install Python dependencies + run: | + pip install --upgrade pip + pip install build twine + pip install . + pip install ".[lint, test, optional]" + + - name: Install MODFLOW + run: | + mkdir -p ~/.local/bin + get-modflow ~/.local/bin + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update FloPy version + id: version + run: | + # extract version from branch name + ref="${{ github.ref_name }}" + ver="${ref#"v"}" + + # update version files + if [[ "$ver" == *"rc"* ]]; then + python scripts/update_version.py -v "${ref%"rc"}" + else + python scripts/update_version.py -v "$ver" --approve + fi + + # show version and set output + python -c "import flopy; print(f'FloPy version: {flopy.__version__}')" + echo "version=${ver#"v"}" >> $GITHUB_OUTPUT + + - name: Update FloPy plugins + run: python -c 'import flopy; flopy.mf6.utils.generate_classes(branch="master", backup=False)' + + - name: Lint Python files + run: python scripts/pull_request_prepare.py + + - name: Run tests + working-directory: autotest + run: pytest -v -m="not example and not regression" -n=auto --durations=0 --keep-failed=.failed + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload failed test outputs + uses: actions/upload-artifact@v2 + if: failure() + with: + name: failed-${{ matrix.os }}-${{ matrix.python-version }} + path: | + ./autotest/.failed/** + + - name: Run notebooks + working-directory: scripts + run: python run_notebooks.py + + - name: Generate changelog + id: cliff + uses: orhun/git-cliff-action@v1 + with: + config: cliff.toml + args: --verbose --unreleased --tag ${{ steps.version.outputs.version }} + env: + OUTPUT: CHANGELOG.md + + - name: Update changelog + run: | + # move changelog + sudo cp ${{ steps.cliff.outputs.changelog }} CHANGELOG.md + + # show changelog + cat CHANGELOG.md + + # substitute full group names + sed -i 's/#### Ci/#### Continuous integration/' CHANGELOG.md + sed -i 's/#### Feat/#### New features/' CHANGELOG.md + sed -i 's/#### Fix/#### Bug fixes/' CHANGELOG.md + sed -i 's/#### Refactor/#### Refactoring/' CHANGELOG.md + sed -i 's/#### Test/#### Testing/' CHANGELOG.md + + # prepend changelog to docs/version_changes.md + cat CHANGELOG.md | cat - docs/version_changes.md | tee docs/version_changes.md + + - name: Upload changelog + uses: actions/upload-artifact@v3 + with: + name: changelog + path: CHANGELOG.md + + - name: Push release branch + run: | + git config core.sharedRepository true + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -A + git commit -m "ci(release): set version to ${{ steps.version.outputs.version }}, update plugins from DFN files, update changelog" + git push origin "${{ github.ref_name }}" + + pr: + name: Draft release PR + needs: prep + if: ${{ github.event_name == 'push' && !(contains(github.ref_name, 'rc')) }} + runs-on: ubuntu-22.04 + permissions: + contents: write + pull-requests: write + defaults: + run: + shell: bash -l {0} + steps: + + - name: Checkout release branch + uses: actions/checkout@v3 + with: + ref: ${{ github.ref_name }} + + - name: Draft pull request + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + ref="${{ github.ref_name }}" + ver="${ref#"v"}" + title="Release $ver" + body=' + # FloPy '$ver' + + The release can be approved by merging this pull request into `master`. This will trigger a final job to publish the release to PyPI and open a PR to update the [Conda feedstock](https://github.com/jdhughes-usgs/flopy-feedstock). + ' + gh pr create -B "master" -H "$ref" --title "$title" --draft --body "$body" + + release: + name: Draft release + # runs only when changes are merged to master + if: ${{ github.event_name == 'push' && github.ref_name == 'master' }} + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + + - name: Checkout master branch + uses: actions/checkout@v3 + with: + ref: master + + # actions/download-artifact won't look at previous workflow runs but we need to in order to get changelog + - name: Download artifacts + uses: dawidd6/action-download-artifact@v2 + + - name: Draft release + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + version=$(cat version.txt) + title="FloPy $version" + notes=$(cat changelog/CHANGELOG.md) + gh release create "$version" \ + --target master \ + --title "$title" \ + --notes "$notes" \ + --draft \ + --latest + + publish: + name: Publish package + # runs only after release is published (manually promoted from draft) + if: ${{ github.event_name == 'release' }} + runs-on: ubuntu-22.04 + permissions: + contents: write + pull-requests: write + steps: + + - name: Checkout master branch + uses: actions/checkout@v3 + with: + ref: master + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.7 + cache: 'pip' + cache-dependency-path: setup.cfg + + - name: Install Python dependencies + run: | + pip install --upgrade pip + pip install build twine + pip install . + pip install ".[lint, test, optional]" + + - name: Build package + run: python -m build + + - name: Check package + run: twine check --strict dist/* + + - name: Upload package + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist + + - name: Publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: python -m twine upload dist/* + + # TODO: only need if regro-cf-autotick-bot doesn't autodetect release and open PR on conda-forge/flopy-feedstock + + # - name: Setup Micromamba + # uses: mamba-org/provision-with-micromamba@main + # with: + # environment-file: flopy/etc/environment.yml + # cache-downloads: true + # cache-env: true + + # - name: Install dependencies + # run: | + # conda install -c conda-forge conda-smithy + # pip install --upgrade pip + # pip install build twine + + # - name: Download release assets + # uses: robinraju/release-downloader@v1.6 + # with: + # latest: true + # tarBall: true + # zipBall: false + + # - name: Calculate checksum + # id: checksum + # run: | + # sha256=$(openssl sha256 "Source code (tar.gz).tar.gz") + # echo "SHA256: $sha256" + # echo "sha256=$sha256" >> $GITHUB_OUTPUT + + # - name: Checkout feedstock + # uses: actions/checkout@v3 + # with: + # repository: w-bonelli/flopy-feedstock + # path: flopy-feedstock + # ref: master + + # - name: Get version + # working-directory: flopy + # id: version + # run: | + # version=$(python scripts/update_version.py --get) + # echo "version: $version" + # echo "version=$version" >> $GITHUB_OUTPUT + + # - name: Update feedstock + # working-directory: flopy-feedstock + # run: | + # git remote add upstream https://github.com/conda-forge/flopy-feedstock.git + # git fetch upstream + # git checkout master + # git reset --hard upstream/master + # # git push origin master --force + # git switch -c "v${{ steps.version.outputs.version }}-update-conda" + + # - name: Rerender feedstock + # working-directory: flopy-feedstock + # run: | + # conda smithy rerender + + # - name: Update feedstock recipe + # working-directory: flopy-feedstock + # run: | + # sed -i '1s/.*/{% set version = "'${{ steps.version.outputs.version }}'" %}/' recipe/meta.yaml + # sed -i 's/sha256:.*/sha256: ${{ steps.checksum.outputs.sha256 }}/g' recipe/meta.yaml + # git add recipe/meta.yaml + # git commit -m "ci(release): update recipe" + # # git push -u origin "v${{ steps.version.outputs.version }}-update-conda" + + # - name: Draft feedstock PR + # working-directory: flopy-feedstock + # env: + # GITHUB_TOKEN: ${{ github.token }} + # run: | + # body=' + # # FloPy '$ver' release + # + # This release can be approved by merging this pull request into `master`. This will trigger a final job to publish the release to PyPI and open a PR to update the [Conda feedstock](https://github.com/jdhughes-usgs/flopy-feedstock). + # ' + # gh pr create -B "master" -H "$ref" --title "Release version $ver" --draft --latest --body "$body" + + reset: + name: Draft reset PR + if: ${{ github.event_name == 'release' }} + runs-on: ubuntu-22.04 + permissions: + contents: write + pull-requests: write + defaults: + run: + shell: bash -l {0} + steps: + + - name: Checkout master branch + uses: actions/checkout@v3 + with: + ref: master + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.7 + cache: 'pip' + cache-dependency-path: setup.cfg + + - name: Install Python dependencies + run: | + pip install --upgrade pip + pip install build twine + pip install . + pip install ".[lint, test, optional]" + + - name: Get release tag + uses: oprypin/find-latest-tag@v1 + id: latest_tag + with: + repository: ${{ github.repository }} + releases-only: true + + - name: Draft pull request + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + # create reset branch from master + reset_branch="post-release-${{ steps.latest_tag.outputs.tag }}-reset" + git switch -c $reset_branch + + # increment minor version and reset IDEVELOPMODE to 1 + major_version=$(echo "${{ steps.latest_tag.outputs.tag }}" | cut -d. -f1) + minor_version=$(echo "${{ steps.latest_tag.outputs.tag }}" | cut -d. -f2) + patch_version=$(echo "${{ steps.latest_tag.outputs.tag }}" | cut -d. -f3) + version="$major_version.$minor_version.$((patch_version + 1))" + python scripts/update_version.py -v "$version" + + # commit and push reset branch + git config core.sharedRepository true + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -A + git commit -m "ci(release): update to development version $version" + git push -u origin $reset_branch + + # create PR into develop + body=' + # Reinitialize for development + + Updates the `develop` branch from `master` following a successful release. Increments the patch version number. + ' + gh pr create -B "develop" -H "$reset_branch" --title "Reinitialize develop branch" --draft --body "$body" \ No newline at end of file diff --git a/autotest/regression/test_lgr.py b/autotest/regression/test_lgr.py index 965a4f247b..98c31c0ef5 100644 --- a/autotest/regression/test_lgr.py +++ b/autotest/regression/test_lgr.py @@ -2,9 +2,9 @@ from os.path import dirname, join from pathlib import Path -from flaky import flaky import pytest from autotest.conftest import requires_exe, requires_pkg +from flaky import flaky import flopy diff --git a/autotest/test_export.py b/autotest/test_export.py index e004f87e35..3ef0c3fb37 100644 --- a/autotest/test_export.py +++ b/autotest/test_export.py @@ -632,8 +632,9 @@ def test_export_contourf(tmpdir, example_data_path): with Reader(filename) as r: shapes = r.shapes() # expect 65 with standard mpl contours (structured grids), 86 with tricontours - assert len(shapes) >= 65, "multipolygons were skipped in contourf routine" - + assert ( + len(shapes) >= 65 + ), "multipolygons were skipped in contourf routine" @pytest.mark.mf6 @@ -665,7 +666,6 @@ def test_export_contours(tmpdir, example_data_path): assert len(shapes) >= 65 - @pytest.mark.mf6 @requires_pkg("shapely") def test_mf6_grid_shp_export(tmpdir): diff --git a/autotest/test_get_modflow.py b/autotest/test_get_modflow.py index c2f4a49c7c..11ede86138 100644 --- a/autotest/test_get_modflow.py +++ b/autotest/test_get_modflow.py @@ -162,21 +162,19 @@ def test_script_help(): @flaky @requires_github @pytest.mark.slow -def test_script_options(tmpdir, downloads_dir): +def test_script_invalid_options(tmpdir, downloads_dir): + # try with bindir that doesn't exist bindir = tmpdir / "bin1" assert not bindir.exists() - stdout, stderr, returncode = run_get_modflow_script(bindir) if rate_limit_msg in stderr: pytest.skip(f"GitHub {rate_limit_msg}") assert "does not exist" in stderr assert returncode == 1 - # ensure extraction directory exists + # attempt to fetch a non-existing release-id bindir.mkdir() assert bindir.exists() - - # attempt to fetch a non-existing release-id stdout, stderr, returncode = run_get_modflow_script( bindir, "--release-id", "1.9", "--downloads-dir", downloads_dir ) @@ -185,7 +183,25 @@ def test_script_options(tmpdir, downloads_dir): assert "Release 1.9 not found" in stderr assert returncode == 1 + # try to select an invalid --subset + bindir = tmpdir / "bin2" + bindir.mkdir() + stdout, stderr, returncode = run_get_modflow_script( + bindir, "--subset", "mfnwt,mpx", "--downloads-dir", downloads_dir + ) + if rate_limit_msg in stderr: + pytest.skip(f"GitHub {rate_limit_msg}") + assert "subset item not found: mpx" in stderr + assert returncode == 1 + + +@flaky +@requires_github +@pytest.mark.slow +def test_script_valid_options(tmpdir, downloads_dir): # fetch latest + bindir = tmpdir / "bin1" + bindir.mkdir() stdout, stderr, returncode = run_get_modflow_script( bindir, "--downloads-dir", downloads_dir ) @@ -195,17 +211,9 @@ def test_script_options(tmpdir, downloads_dir): files = [item.name for item in bindir.iterdir() if item.is_file()] assert len(files) > 20 - # take only a few files using --subset, starting with invalid + # valid subset bindir = tmpdir / "bin2" bindir.mkdir() - stdout, stderr, returncode = run_get_modflow_script( - bindir, "--subset", "mfnwt,mpx", "--downloads-dir", downloads_dir - ) - if rate_limit_msg in stderr: - pytest.skip(f"GitHub {rate_limit_msg}") - assert "subset item not found: mpx" in stderr - assert returncode == 1 - # now valid subset stdout, stderr, returncode = run_get_modflow_script( bindir, "--subset", "mfnwt,mp6", "--downloads-dir", downloads_dir ) @@ -213,12 +221,11 @@ def test_script_options(tmpdir, downloads_dir): pytest.skip(f"GitHub {rate_limit_msg}") assert len(stderr) == returncode == 0 files = [item.stem for item in bindir.iterdir() if item.is_file()] - assert sorted(files) == ["mfnwt", "mp6"] + assert sorted(files) == ["mfnwt", "mfnwtdbl", "mp6"] # similar as before, but also specify a ostag bindir = tmpdir / "bin3" bindir.mkdir() - stdout, stderr, returncode = run_get_modflow_script( bindir, "--subset", @@ -234,7 +241,7 @@ def test_script_options(tmpdir, downloads_dir): pytest.skip(f"GitHub {rate_limit_msg}") assert len(stderr) == returncode == 0 files = [item.name for item in bindir.iterdir() if item.is_file()] - assert sorted(files) == ["mfnwt.exe"] + assert sorted(files) == ["mfnwt.exe", "mfnwtdbl.exe"] @flaky diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000000..9d5ca0d7bd --- /dev/null +++ b/cliff.toml @@ -0,0 +1,45 @@ +# configuration file for git-cliff (0.1.0) + +[changelog] +body = """ +{% if version %}\ + ### Version {{ version | trim_start_matches(pat="v") }} +{% else %}\ + ### [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + #### {{ group | upper_first }} + {% for commit in commits %} + * [{{ commit.group }}{% if commit.scope %}({{ commit.scope }}){% endif %}](https://github.com/modflowpy/flopy/commit/{{ commit.id }}): {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}. Committed by {{ commit.author.name }} on {{ commit.author.timestamp | date(format="%Y-%m-%d") }}.\ + {% endfor %} +{% endfor %}\n +""" +trim = true + +[git] +conventional_commits = true +filter_unconventional = true +split_commits = false +commit_parsers = [ + { message = "^[fF]eat", group = "feat"}, + { message = "^[fF]ix", group = "fix"}, + { message = "^[bB]ug", group = "fix"}, + { message = "^[pP]erf", group = "perf"}, + { message = "^[rR]efactor", group = "refactor"}, + { message = "^[uU]pdate", group = "refactor"}, + { message = "^[dD]oc.*", group = "docs", skip = true}, + { message = "^[bB]inder", group = "docs", skip = true}, + { message = "^[nN]otebook.*", group = "docs", skip = true}, + { message = "^[rR][eE][aA][dD].*", group = "docs", skip = true}, + { message = "^[sS]tyl.*", group = "style", skip = true}, + { message = "^[tT]est.*", group = "test", skip = true}, + { message = "^[cC][iI]", skip = true}, + { message = "^[cC][iI]\\(release\\):", skip = true}, + { message = "^[rR]elease", skip = true}, + { message = "^[cC]hore", group = "chore", skip = true}, +] +protect_breaking_commits = false +filter_commits = false +tag_pattern = "[0-9].[0-9].[0-9]" +ignore_tags = "" +sort_commits = "oldest" diff --git a/docs/make_release.md b/docs/make_release.md index 7f12f997fb..3b75a9d38e 100644 --- a/docs/make_release.md +++ b/docs/make_release.md @@ -1,96 +1,111 @@ -Instructions for making a FloPy release ------------------------------------------------ +# Releasing FloPy -## Make a release branch from develop + + -1. Make a release branch from develop (*e.g.* `release3.2.10`) - -2. If the flopy release coincides with a new MODFLOW 6 release - - 1. Update `usgsprograms.txt` in the [GitHub pymake repository](https://github.com/modflowpy/pymake) with the path to the new MODFLOW 6 release. Also update all other targets in `usgsprograms.txt` with the path to new releases. - - 2. Recompile all of the executables release on the [GitHub executables repository](https://github.com/MODFLOW-USGS/executables) using the `buildall.py` pymake script and Intel compilers for all operating systems. - - 3. Update the README.md on the [GitHub executables repository](https://github.com/MODFLOW-USGS/executables) with the information in the `code.md` file created by the `buildall.py` pymake script. - - 4. Make a new release on the [GitHub executables repository](https://github.com/MODFLOW-USGS/executables) and add all of the operating system specific zip files containing the compiled executables (`linux.zip`, `mac.zip`, `win64.zip`, `win32.zip`). Publish the new release. +- [Release automation](#release-automation) +- [Release procedure](#release-procedure) + - [Release from master branch](#release-from-master-branch) + - [Reinitialize develop branch](#reinitialize-develop-branch) + - [Publish the release](#publish-the-release) + - [PyPI](#pypi) + - [Conda forge](#conda-forge) + + + +## Release automation + +The FloPy release procedure is mostly automated with GitHub Actions in [`release.yml`](../.github/workflows/release.yml). There are a few manual steps that need to be performed, however: - 5. Update MODFLOW 6 dfn files in the repository and MODFLOW 6 package classes by running: +1. Update `usgsprograms.txt` in the [GitHub pymake repository](https://github.com/modflowpy/pymake) with the path to the new MODFLOW 6 release. Also update all other targets in `usgsprograms.txt` with the path to new releases. - ``` - python -c 'import flopy; flopy.mf6.utils.generate_classes(branch="master", backup=False)' - ``` - 6. Run `isort` on the updated MODFLOW 6 package classes by running the following from the root directory: +2. Recompile all of the executables released on the [GitHub executables repository](https://github.com/MODFLOW-USGS/executables) using the `buildall.py` pymake script and Intel compilers for all operating systems. - ``` - isort . - ``` - 7. Run `black` on the updated MODFLOW 6 package classes by running the following from the root directory: +3. Update the README.md on the [GitHub executables repository](https://github.com/MODFLOW-USGS/executables) with the information in the `code.md` file created by the `buildall.py` pymake script. - ``` - black . - ``` +4. Make a new release on the [GitHub executables repository](https://github.com/MODFLOW-USGS/executables) and add all of the operating system specific zip files containing the compiled executables (`linux.zip`, `mac.zip`, `win64.zip`, `win32.zip`). Publish the new release. +5. Update the authors in `CITATION.cff` for the Software/Code citation for FloPy, if required. + + +Next, make a release branch from develop (*e.g.* `v3.3.6`). The branch name should be the version number with a `v` prefix. Pushing this branch to GitHub will trigger the release workflow, detailed below. If the branch name ends with `rc` it is considered a release candidate and the workflow is a dry run, stopping after updating version info & plugin classes and running tests and notebooks. If the branch name does not end with `rc` the release is considered approved and the full procedure runs. +After updating version information, regenerating plugin classes, and generating a changelog, the approved release workflow creates a draft pull request from the release branch into `master`. Merging this pull request triggers another job to create a draft release. Promoting this draft release to a full release will trigger a final job to publish the release to PyPI and reset the `develop` branch from `master`, incrementing the patch version number on `develop`. -## Update the release version number -1. Increment `major`, `minor`, and/or `micro` numbers in `flopy/version.py`, as appropriate. +## Release procedure +This procedure runs automatically in `release.yml` after a release branch is pushed to GitHub, except for the final step (updating the `conda-forge/flopy-feedstock` repository — there is a bot which will [automatically detect changes and create a PR](https://github.com/conda-forge/flopy-feedstock/pull/47) to do so). -## Update the Software/Code citation for FloPy -1. Update the authors in `CITATION.cff` for the Software/Code citation for FloPy, if required. +### Release from master branch +- Update MODFLOW 6 dfn files in the repository and MODFLOW 6 package classes by running `python -c 'import flopy; flopy.mf6.utils.generate_classes(branch="master", backup=False)'` + +- Run `isort` and `black` on the updated MODFLOW 6 package classes. This can be achieved by running `python scripts/pull_request_prepare.py` from the project root. The commands `isort .` and `black .` can also be run individually instead. -## Build USGS release notes +- Run `python scripts/update_version.py -v ` to update the version number stored in `version.txt` and `flopy/version.py`. For an approved release use the `--approve` flag. -1. Manually run `make-release.py` in the `scripts/` directory to update version information using: +- Use `run_notebooks.py` in the `scripts` directory to rerun all of the notebooks in: - ``` - python make-release.py - ``` + - `examples\Notebooks` directory. + - `examples\Notebooks\groundwater_paper` directory. + - `examples\Notebooks\FAQ` directory. -2. Manually run `update-version_changes.py` in the `scripts/` directory to update version changes information using: +- Generate a changelog with [git cliff](https://github.com/orhun/git-cliff): `git cliff --unreleased --tag=`. - ``` - python update-version_changes.py - ``` +- Commit the changes to the release branch and push the commit to the [upstream GitHub repository](https://github.com/modflowpy/flopy). + +- Build and check the package with: + +```shell +python -m build +twine check --strict dist/* +``` + +- Update master branch from the release branch, e.g. by opening and merging a pull request into `master`. The pull request should be merged, *not* squashed, in order to preserve the project's commit history. + +- Tag the merge commit to `master` with the version number. Don't forget to commit the tag. Push the commit and tag to GitHub. +- Make a release on [GitHub website](https://github.com/modflowpy/flopy/releases). Add version changes for [current release](https://github.com/modflowpy/flopy/blob/develop/docs/version_changes.md) from to release text. Publish release. -## Update the example notebooks -Use `run_notebooks.py` in the `release` directory to rerun all of the notebooks in: +### Reinitialize develop branch -1. `examples\Notebooks` directory. -2. `examples\Notebooks\groundwater_paper` directory. -2. `examples\Notebooks\FAQ` directory. +1. Merge the `master` branch into the `develop` branch. + +2. Set the version as appropriate: `python scripts/update_version.py -v `. +3. Commit and push the updated `develop` branch. -## Commit the release branch -1. Commit the changes to the release (*e.g.* `release3.2.10`) branch. -2. Push the commit to the [upstream GitHub repository](https://github.com/modflowpy/flopy). -3. Wait until the commit successfully runs on [GitHub Actions](https://github.com/modflowpy/flopy/actions). +### Publish the release +#### PyPI -## Update master branch +1. Make sure the latest `build` and `twine` tools are installed using: -1. Change to the `master` branch in SourceTree. -2. Merge the release branch (*e.g.* `release3.2.10`) branch into the `master` branch. -3. Commit changes to `master` branch and push the commit to GitHub. + ``` + pip install --upgrade build twine + ``` +2. Create the source and wheel packages with: -## Finalizing the release + ``` + rm -rf dist + python -m build + ``` -1. Tag the commit with the `__version__` number using SourceTree (don't forget to commit the tag). -2. Push the commit and tag to the GitHub website. -3. Make release on [GitHub website](https://github.com/modflowpy/flopy/releases). Add version changes for [current release](https://github.com/modflowpy/flopy/blob/develop/docs/version_changes.md) from to release text. Publish release. +3. Check and upload the release to PyPI using: + ``` + twine check --strict dist/* + twine upload dist/* + ``` -## Update flopy-feedstock for conda install +#### Conda forge -1. Download the `*.tar.gz` file for the current release from the [GitHub website](https://github.com/modflowpy/flopy/releases). +1. Download the `*.tar.gz` file for the just-created release from the [GitHub website](https://github.com/modflowpy/flopy/releases). 2. Calculate the sha256 checksum for the `*.tar.gz` using: @@ -121,41 +136,3 @@ Use `run_notebooks.py` in the `release` directory to rerun all of the notebooks 5. Commit changes and push to [flopy-feedstock fork](https://github.com/jdhughes-usgs/flopy-feedstock). 6. Make pull request to [flopy-feedstock](https://github.com/conda-forge/flopy-feedstock) - - -## Update PyPI - -1. Make sure the latest `build` and `twine` tools are installed using: - - ``` - pip install --upgrade build twine - ``` - -2. Create the source and wheel packages with: - - ``` - rm -rf dist - python -m build - ``` - -3. Check and upload the release to PyPI using: - - ``` - twine check --strict dist/* - twine upload dist/* - ``` - -## Sync develop and master branches - -1. Merge the `master` branch into the `develop` branch. - -2. Increment `major`, `minor`, and/or `micro` numbers in `flopy/version.py`, as appropriate. - -3. Manually run `make-release.py` in the `scripts/` directory to update version information using: - - ``` - python make-release.py - ``` -4. Commit and push the modified `develop` branch. - - diff --git a/docs/version_changes.md b/docs/version_changes.md index cd6f0be3bb..511fc366c1 100644 --- a/docs/version_changes.md +++ b/docs/version_changes.md @@ -1,222 +1,220 @@ -FloPy Changes ------------------------------------------------ ### Version 3.3.5 -* New features: - - * [feat(mvt)](https://github.com/modflowpy/flopy/commit/aa0baac73db0ef65ac975511f6182148708e75be): Add simulation-level support for mover transport (#1357). Committed by langevin-usgs on 2022-02-18. - * [feat(gwtgwt-mvt)](https://github.com/modflowpy/flopy/commit/8663a3474dd42211be2b8124316f16ea2ae8de18): Add support for gwt-gwt with mover transport (#1356). Committed by langevin-usgs on 2022-02-18. - * [feat(inspect cells)](https://github.com/modflowpy/flopy/commit/ee009fd2826c15bd91b81b84d1b7daaba0b8fde3): New feature that returns model data associated with specified model cells (#1140) (#1325). Committed by spaulins-usgs on 2022-01-11. - * [feat(multiple package instances)](https://github.com/modflowpy/flopy/commit/2eeaf1db72150806bf0cee0aa30c813e02256741): Flopy support for multiple instances of the same package stored in dfn files (#1239) (#1321). Committed by spaulins-usgs on 2022-01-07. - * [feat(Gridintersect)](https://github.com/modflowpy/flopy/commit/806d60149c4b3d821fa409d71dd0592a94070c51): Add shapetype kwarg (#1301). Committed by Davíd Brakenhoff on 2021-12-03. - * [feat(get_ts)](https://github.com/modflowpy/flopy/commit/376b3234a7931785518e478b422c4987b2d8fd52): Added support to get_ts for headufile (#1260). Committed by Ross Kushnereit on 2021-10-09. - * [feat(CellBudget)](https://github.com/modflowpy/flopy/commit/45df13abfd0611cc423b01bff341b450064e3b01): Add support for full3d keyword (#1254). Committed by jdhughes-usgs on 2021-10-05. - * [feat(mf6)](https://github.com/modflowpy/flopy/commit/6c0df005bd1f61d7ce54f160fea82cc34916165b): Allow multi-package for stress package concentrations (spc) (#1242). Committed by langevin-usgs on 2021-09-16. - * [feat(lak6)](https://github.com/modflowpy/flopy/commit/5974d8044f404a5221960e837dcce73d0db140d2): Support none lake bedleak values (#1189). Committed by jdhughes-usgs on 2021-08-16. - - -* Bug fixes: - - * [fix(exchange obs)](https://github.com/modflowpy/flopy/commit/14d461588e1dbdb7bbe396e89e2a9cfc9366c8f3): Fixed building of obs package for exchange packages (through mfsimulation) (#1363). Committed by spaulins-usgs on 2022-02-28. - * [fix(tab files)](https://github.com/modflowpy/flopy/commit/b59f1fef153a235b0e11d40107c1e30d5eae4f84): Fixed searching for tab file packages (#1337) (#1344). Committed by scottrp on 2022-02-16. - * [fix(ModflowUtllaktab)](https://github.com/modflowpy/flopy/commit/0ee7c8849a14bc1a0736d5680c761b887b9c04db): Utl-lak-tab.dfn is redundant to utl-laktab.dfn (#1339). Committed by Mike Taves on 2022-01-27. - * [fix(cellid)](https://github.com/modflowpy/flopy/commit/33e61b8ccd2556b65d33d25c5a3fb27114f5ff25): Fixes some issues with flopy properly identifying cell ids (#1335) (#1336). Committed by spaulins-usgs on 2022-01-25. - * [fix(postprocessing)](https://github.com/modflowpy/flopy/commit/0616db5f158a97d1b38544d993d866c19a672a80): Get_structured_faceflows fix to support 3d models (#1333). Committed by langevin-usgs on 2022-01-21. - * [fix(Raster)](https://github.com/modflowpy/flopy/commit/dced106e5f9bd9a5234a2cbcd74c67b959ca950c): Resample_to_grid failure no data masking failure with int dtype (#1328). Committed by Joshua Larsen on 2022-01-21. - * [fix(voronoi)](https://github.com/modflowpy/flopy/commit/24f142ab4e02ba96e04d9c5040c87cea35ad8fd9): Clean up voronoi examples and add error check (#1323). Committed by langevin-usgs on 2022-01-03. - * [fix(filenames)](https://github.com/modflowpy/flopy/commit/fb0955c174cd47e41cd15eac6b2fc5e4cc587935): Fixed how spaces in filenames are handled (#1236) (#1318). Committed by spaulins-usgs on 2021-12-16. - * [fix(paths)](https://github.com/modflowpy/flopy/commit/0432ce96a0a5eec4d20adb4d384505632a2db3dc): Path code made more robust so that non-standard model folder structures are supported (#1311) (#1316). Committed by scottrp on 2021-12-09. - * [fix(UnstructuredGrid)](https://github.com/modflowpy/flopy/commit/8ab2e8d1a869de14ee76b11d0c53f439560c7a72): Load vertices for unstructured grids (#1312). Committed by Chris Nicol on 2021-12-09. - * [fix(array)](https://github.com/modflowpy/flopy/commit/fad091540e3f75efa38668e74a304e6d7f6b715f): Getting array data (#1028) (#1290). Committed by spaulins-usgs on 2021-12-03. - * [fix(plot_pathline)](https://github.com/modflowpy/flopy/commit/849f68e96c151e64b63a351b50955d0d5e01f1f7): Sort projected pathline points by travel time instead of cell order (#1304). Committed by Joshua Larsen on 2021-12-03. - * [fix(autotests)](https://github.com/modflowpy/flopy/commit/bbdf0082749d04805af470bc1b0f197d73202e21): Added pytest.ini to declare test naming convention (#1307). Committed by Joshua Larsen on 2021-12-03. - * [fix(geospatial_utils.py)](https://github.com/modflowpy/flopy/commit/976ad8130614374392345ce8ee3adb766d378797): Added pyshp and shapely imports check to geospatial_utils.py (#1305). Committed by Joshua Larsen on 2021-12-03. - * [fix(path)](https://github.com/modflowpy/flopy/commit/220974ae98c8fbc9a278ce02eec71378fd84dc1a): Fix subdirectory path issues (#1298). Committed by Brioch Hemmings on 2021-11-18. - * [fix()](https://github.com/modflowpy/flopy/commit/0bf5a5e5fc7105651d0b661ec60667094bb84267): fix(mfusg/str) (#1296). Committed by Chris Nicol on 2021-11-11. - * [fix(io)](https://github.com/modflowpy/flopy/commit/1fa24026d890abc4508a39eddf9049399c1e4d3f): Read comma separated list (#1285). Committed by Michael Ou on 2021-11-02. - * [fixes(1247)](https://github.com/modflowpy/flopy/commit/71f6cc6b6391a460dd01e58b739372b35899f09c): Make flopy buildable with pyinstaller (#1248). Committed by Tim Mitchell on 2021-10-20. - * [fix(keystring records)](https://github.com/modflowpy/flopy/commit/0d21b925ebd4e2f31413ea67d28591d77a02d8c1): Fixed problem with keystring records containing multiple keywords (#1266). Committed by spaulins-usgs on 2021-10-15. - * [fix(ModflowFhb)](https://github.com/modflowpy/flopy/commit/fc094353a375b26f5afd6befb1bcdfef407c3a64): Update datasets 4, 5, 6, 7, 8 loading routine for multiline records (#1264). Committed by Joshua Larsen on 2021-10-15. - * [fix(MFFileMgmt.string_to_file_path)](https://github.com/modflowpy/flopy/commit/459aacbc0ead623c79bc4701b4c23666a280fbe8): Updated to support unc paths (#1256). Committed by Joshua Larsen on 2021-10-06. - * [fix(_mg_resync)](https://github.com/modflowpy/flopy/commit/fe913fe6e364501832194c87deb962d913a22a35): Added checks to reset the modelgrid resync (#1258). Committed by Joshua Larsen on 2021-10-06. - * [fix(MFPackage)](https://github.com/modflowpy/flopy/commit/658bf2ccbc9c6baeec4184e7c08aeb452f83c4ea): Fix mfsim.nam relative paths (#1252). Committed by Joshua Larsen on 2021-10-01. - * [fix(voronoi)](https://github.com/modflowpy/flopy/commit/ccdb36a8dd00347889e6048f7e6ddb7538e6308f): Voronoigrid class upgraded to better support irregular domains (#1253). Committed by langevin-usgs on 2021-10-01. - * [fix(writing tas)](https://github.com/modflowpy/flopy/commit/047c9e6fdb345c373b48b07fe0b81bc88105a543): Fixed writing non-constant tas (#1244) (#1245). Committed by spaulins-usgs on 2021-09-22. - * [fix(numpy elementwise comparison)](https://github.com/modflowpy/flopy/commit/779aa50afd9fb8105d0684b0ab50c64e0bc347de): Fixed numpy futurewarning. no elementwise compare is needed if user passes in a numpy recarray, this is only necessary for dictionaries. (#1235). Committed by spaulins-usgs on 2021-09-13. - * [fix()](https://github.com/modflowpy/flopy/commit/722224c4b438116528b83a77338e34d6f9807ef7): fix(shapefile_utils) unstructured shapefile export (#1220) (#1222). Committed by Chris Nicol on 2021-09-03. - * [fix(rename and comments)](https://github.com/modflowpy/flopy/commit/c2a01df3d49b0e06a21aa6aec532125b03992048): Package rename code and comment propagation (#1226). Committed by spaulins-usgs on 2021-09-03. - * [fix(numpy)](https://github.com/modflowpy/flopy/commit/8ec8d096afb63080d754a11d7d477ac4133c0cf6): Handle deprecation warnings from numpy 1.21 (#1211). Committed by Mike Taves on 2021-08-23. - * [fix(Grid.saturated_thick)](https://github.com/modflowpy/flopy/commit/e9dff6136c19631532de4a2f714092037fb81c98): Update saturated_thick to filter confining bed layers (#1197). Committed by Joshua Larsen on 2021-08-18. - * [fix()](https://github.com/modflowpy/flopy/commit/41b038c7e64e7c8fa05c0eeb4e1b7b147b2deb7f): fix(pakbase) unstructured storage check (#1187) (#1194). Committed by Chris Nicol on 2021-08-17. - * [fix(MF6Output)](https://github.com/modflowpy/flopy/commit/0d9faa34974c1e9cf32b9897e9a2a68f695b0936): Fix add new obs package issue (#1193). Committed by Joshua Larsen on 2021-08-17. - * [fix()](https://github.com/modflowpy/flopy/commit/e523256cfe7d2f17e0c16e377551601fa62aae38): fix(plot/plot_bc) plot_bc fails with unstructured models (#1185). Committed by Chris Nicol on 2021-08-16. - * [fix()](https://github.com/modflowpy/flopy/commit/a126f70797af14dff65951312f2c925ae5407b0a): fix(modflow/mfriv) unstructured mfusg RIV package load check fix (#1184). Committed by Chris Nicol on 2021-08-16. - * [fix(pakbase)](https://github.com/modflowpy/flopy/commit/74289dc397a3cd41861ddbf2001726d8489ba6af): Specify dtype=bool for 0-d active array used for usg (#1188). Committed by Mike Taves on 2021-08-16. - * [fix(raster)](https://github.com/modflowpy/flopy/commit/b893017995e01dd5c6dda5eb4347ebb707a16ece): Rework raster threads to work on osx (#1180). Committed by jdhughes-usgs on 2021-08-10. - * [fix()](https://github.com/modflowpy/flopy/commit/6d4e3b7358ffb29f321f7c7cf0b6736cfa157a40): fix(loading mflist from file) (#1179). Committed by J Dub on 2021-08-09. - * [fix(grid, plotting)](https://github.com/modflowpy/flopy/commit/fdc4608498884526d11079ecbd3c0c3548b11a61): Bugfixes for all grid instances and plotting code (#1174). Committed by Joshua Larsen on 2021-08-09. +#### New features + +* [feat(mvt)](https://github.com/modflowpy/flopy/commit/aa0baac73db0ef65ac975511f6182148708e75be): Add simulation-level support for mover transport (#1357). Committed by langevin-usgs on 2022-02-18. +* [feat(gwtgwt-mvt)](https://github.com/modflowpy/flopy/commit/8663a3474dd42211be2b8124316f16ea2ae8de18): Add support for gwt-gwt with mover transport (#1356). Committed by langevin-usgs on 2022-02-18. +* [feat(inspect cells)](https://github.com/modflowpy/flopy/commit/ee009fd2826c15bd91b81b84d1b7daaba0b8fde3): New feature that returns model data associated with specified model cells (#1140) (#1325). Committed by spaulins-usgs on 2022-01-11. +* [feat(multiple package instances)](https://github.com/modflowpy/flopy/commit/2eeaf1db72150806bf0cee0aa30c813e02256741): Flopy support for multiple instances of the same package stored in dfn files (#1239) (#1321). Committed by spaulins-usgs on 2022-01-07. +* [feat(Gridintersect)](https://github.com/modflowpy/flopy/commit/806d60149c4b3d821fa409d71dd0592a94070c51): Add shapetype kwarg (#1301). Committed by Davíd Brakenhoff on 2021-12-03. +* [feat(get_ts)](https://github.com/modflowpy/flopy/commit/376b3234a7931785518e478b422c4987b2d8fd52): Added support to get_ts for headufile (#1260). Committed by Ross Kushnereit on 2021-10-09. +* [feat(CellBudget)](https://github.com/modflowpy/flopy/commit/45df13abfd0611cc423b01bff341b450064e3b01): Add support for full3d keyword (#1254). Committed by jdhughes-usgs on 2021-10-05. +* [feat(mf6)](https://github.com/modflowpy/flopy/commit/6c0df005bd1f61d7ce54f160fea82cc34916165b): Allow multi-package for stress package concentrations (spc) (#1242). Committed by langevin-usgs on 2021-09-16. +* [feat(lak6)](https://github.com/modflowpy/flopy/commit/5974d8044f404a5221960e837dcce73d0db140d2): Support none lake bedleak values (#1189). Committed by jdhughes-usgs on 2021-08-16. + + +#### Bug fixes + +* [fix(exchange obs)](https://github.com/modflowpy/flopy/commit/14d461588e1dbdb7bbe396e89e2a9cfc9366c8f3): Fixed building of obs package for exchange packages (through mfsimulation) (#1363). Committed by spaulins-usgs on 2022-02-28. +* [fix(tab files)](https://github.com/modflowpy/flopy/commit/b59f1fef153a235b0e11d40107c1e30d5eae4f84): Fixed searching for tab file packages (#1337) (#1344). Committed by scottrp on 2022-02-16. +* [fix(ModflowUtllaktab)](https://github.com/modflowpy/flopy/commit/0ee7c8849a14bc1a0736d5680c761b887b9c04db): Utl-lak-tab.dfn is redundant to utl-laktab.dfn (#1339). Committed by Mike Taves on 2022-01-27. +* [fix(cellid)](https://github.com/modflowpy/flopy/commit/33e61b8ccd2556b65d33d25c5a3fb27114f5ff25): Fixes some issues with flopy properly identifying cell ids (#1335) (#1336). Committed by spaulins-usgs on 2022-01-25. +* [fix(postprocessing)](https://github.com/modflowpy/flopy/commit/0616db5f158a97d1b38544d993d866c19a672a80): Get_structured_faceflows fix to support 3d models (#1333). Committed by langevin-usgs on 2022-01-21. +* [fix(Raster)](https://github.com/modflowpy/flopy/commit/dced106e5f9bd9a5234a2cbcd74c67b959ca950c): Resample_to_grid failure no data masking failure with int dtype (#1328). Committed by Joshua Larsen on 2022-01-21. +* [fix(voronoi)](https://github.com/modflowpy/flopy/commit/24f142ab4e02ba96e04d9c5040c87cea35ad8fd9): Clean up voronoi examples and add error check (#1323). Committed by langevin-usgs on 2022-01-03. +* [fix(filenames)](https://github.com/modflowpy/flopy/commit/fb0955c174cd47e41cd15eac6b2fc5e4cc587935): Fixed how spaces in filenames are handled (#1236) (#1318). Committed by spaulins-usgs on 2021-12-16. +* [fix(paths)](https://github.com/modflowpy/flopy/commit/0432ce96a0a5eec4d20adb4d384505632a2db3dc): Path code made more robust so that non-standard model folder structures are supported (#1311) (#1316). Committed by scottrp on 2021-12-09. +* [fix(UnstructuredGrid)](https://github.com/modflowpy/flopy/commit/8ab2e8d1a869de14ee76b11d0c53f439560c7a72): Load vertices for unstructured grids (#1312). Committed by Chris Nicol on 2021-12-09. +* [fix(array)](https://github.com/modflowpy/flopy/commit/fad091540e3f75efa38668e74a304e6d7f6b715f): Getting array data (#1028) (#1290). Committed by spaulins-usgs on 2021-12-03. +* [fix(plot_pathline)](https://github.com/modflowpy/flopy/commit/849f68e96c151e64b63a351b50955d0d5e01f1f7): Sort projected pathline points by travel time instead of cell order (#1304). Committed by Joshua Larsen on 2021-12-03. +* [fix(autotests)](https://github.com/modflowpy/flopy/commit/bbdf0082749d04805af470bc1b0f197d73202e21): Added pytest.ini to declare test naming convention (#1307). Committed by Joshua Larsen on 2021-12-03. +* [fix(geospatial_utils.py)](https://github.com/modflowpy/flopy/commit/976ad8130614374392345ce8ee3adb766d378797): Added pyshp and shapely imports check to geospatial_utils.py (#1305). Committed by Joshua Larsen on 2021-12-03. +* [fix(path)](https://github.com/modflowpy/flopy/commit/220974ae98c8fbc9a278ce02eec71378fd84dc1a): Fix subdirectory path issues (#1298). Committed by Brioch Hemmings on 2021-11-18. +* [fix()](https://github.com/modflowpy/flopy/commit/0bf5a5e5fc7105651d0b661ec60667094bb84267): fix(mfusg/str) (#1296). Committed by Chris Nicol on 2021-11-11. +* [fix(io)](https://github.com/modflowpy/flopy/commit/1fa24026d890abc4508a39eddf9049399c1e4d3f): Read comma separated list (#1285). Committed by Michael Ou on 2021-11-02. +* [fixes(1247)](https://github.com/modflowpy/flopy/commit/71f6cc6b6391a460dd01e58b739372b35899f09c): Make flopy buildable with pyinstaller (#1248). Committed by Tim Mitchell on 2021-10-20. +* [fix(keystring records)](https://github.com/modflowpy/flopy/commit/0d21b925ebd4e2f31413ea67d28591d77a02d8c1): Fixed problem with keystring records containing multiple keywords (#1266). Committed by spaulins-usgs on 2021-10-15. +* [fix(ModflowFhb)](https://github.com/modflowpy/flopy/commit/fc094353a375b26f5afd6befb1bcdfef407c3a64): Update datasets 4, 5, 6, 7, 8 loading routine for multiline records (#1264). Committed by Joshua Larsen on 2021-10-15. +* [fix(MFFileMgmt.string_to_file_path)](https://github.com/modflowpy/flopy/commit/459aacbc0ead623c79bc4701b4c23666a280fbe8): Updated to support unc paths (#1256). Committed by Joshua Larsen on 2021-10-06. +* [fix(_mg_resync)](https://github.com/modflowpy/flopy/commit/fe913fe6e364501832194c87deb962d913a22a35): Added checks to reset the modelgrid resync (#1258). Committed by Joshua Larsen on 2021-10-06. +* [fix(MFPackage)](https://github.com/modflowpy/flopy/commit/658bf2ccbc9c6baeec4184e7c08aeb452f83c4ea): Fix mfsim.nam relative paths (#1252). Committed by Joshua Larsen on 2021-10-01. +* [fix(voronoi)](https://github.com/modflowpy/flopy/commit/ccdb36a8dd00347889e6048f7e6ddb7538e6308f): Voronoigrid class upgraded to better support irregular domains (#1253). Committed by langevin-usgs on 2021-10-01. +* [fix(writing tas)](https://github.com/modflowpy/flopy/commit/047c9e6fdb345c373b48b07fe0b81bc88105a543): Fixed writing non-constant tas (#1244) (#1245). Committed by spaulins-usgs on 2021-09-22. +* [fix(numpy elementwise comparison)](https://github.com/modflowpy/flopy/commit/779aa50afd9fb8105d0684b0ab50c64e0bc347de): Fixed numpy futurewarning. no elementwise compare is needed if user passes in a numpy recarray, this is only necessary for dictionaries. (#1235). Committed by spaulins-usgs on 2021-09-13. +* [fix()](https://github.com/modflowpy/flopy/commit/722224c4b438116528b83a77338e34d6f9807ef7): fix(shapefile_utils) unstructured shapefile export (#1220) (#1222). Committed by Chris Nicol on 2021-09-03. +* [fix(rename and comments)](https://github.com/modflowpy/flopy/commit/c2a01df3d49b0e06a21aa6aec532125b03992048): Package rename code and comment propagation (#1226). Committed by spaulins-usgs on 2021-09-03. +* [fix(numpy)](https://github.com/modflowpy/flopy/commit/8ec8d096afb63080d754a11d7d477ac4133c0cf6): Handle deprecation warnings from numpy 1.21 (#1211). Committed by Mike Taves on 2021-08-23. +* [fix(Grid.saturated_thick)](https://github.com/modflowpy/flopy/commit/e9dff6136c19631532de4a2f714092037fb81c98): Update saturated_thick to filter confining bed layers (#1197). Committed by Joshua Larsen on 2021-08-18. +* [fix()](https://github.com/modflowpy/flopy/commit/41b038c7e64e7c8fa05c0eeb4e1b7b147b2deb7f): fix(pakbase) unstructured storage check (#1187) (#1194). Committed by Chris Nicol on 2021-08-17. +* [fix(MF6Output)](https://github.com/modflowpy/flopy/commit/0d9faa34974c1e9cf32b9897e9a2a68f695b0936): Fix add new obs package issue (#1193). Committed by Joshua Larsen on 2021-08-17. +* [fix()](https://github.com/modflowpy/flopy/commit/e523256cfe7d2f17e0c16e377551601fa62aae38): fix(plot/plot_bc) plot_bc fails with unstructured models (#1185). Committed by Chris Nicol on 2021-08-16. +* [fix()](https://github.com/modflowpy/flopy/commit/a126f70797af14dff65951312f2c925ae5407b0a): fix(modflow/mfriv) unstructured mfusg RIV package load check fix (#1184). Committed by Chris Nicol on 2021-08-16. +* [fix(pakbase)](https://github.com/modflowpy/flopy/commit/74289dc397a3cd41861ddbf2001726d8489ba6af): Specify dtype=bool for 0-d active array used for usg (#1188). Committed by Mike Taves on 2021-08-16. +* [fix(raster)](https://github.com/modflowpy/flopy/commit/b893017995e01dd5c6dda5eb4347ebb707a16ece): Rework raster threads to work on osx (#1180). Committed by jdhughes-usgs on 2021-08-10. +* [fix()](https://github.com/modflowpy/flopy/commit/6d4e3b7358ffb29f321f7c7cf0b6736cfa157a40): fix(loading mflist from file) (#1179). Committed by J Dub on 2021-08-09. +* [fix(grid, plotting)](https://github.com/modflowpy/flopy/commit/fdc4608498884526d11079ecbd3c0c3548b11a61): Bugfixes for all grid instances and plotting code (#1174). Committed by Joshua Larsen on 2021-08-09. ### Version 3.3.4 -* New features: - - * [feat(mf6-lake)](https://github.com/modflowpy/flopy/commit/73a44059d18ee37f16d8e8fc90c231a0c9b16cf7): Add helper function to create lake connections (#1163). Committed by jdhughes-usgs on 2021-08-04. - * [feat(data storage)](https://github.com/modflowpy/flopy/commit/08b95ea0b4b582567bbc99ff89f9923910a33d70): Data automatically stored internally when simulation or model relative path changed (#1126) (#1157). Committed by spaulins-usgs on 2021-07-29. - * [feat(get_reduced_pumping)](https://github.com/modflowpy/flopy/commit/86b270d2cc085f92373c1623cb61a23d2befc70e): Update to read external pumping reduction files (#1162). Committed by Joshua Larsen on 2021-07-29. - * [feat(raster)](https://github.com/modflowpy/flopy/commit/3ffedb45c4fa017ff64a4d579314c12386696068): Add option to extrapolate using ``nearest`` method (#1159). Committed by jdhughes-usgs on 2021-07-26. - * [Feat(ZoneBudget6)](https://github.com/modflowpy/flopy/commit/04fe7e4a3c67cb068de444a2979a3528ccbc3e60): Added zonebudget6 class to zonbud.py (#1149). Committed by Joshua Larsen on 2021-07-12. - * [feat(grid)](https://github.com/modflowpy/flopy/commit/0560a4d444c1f0ecd90319c41a6942c8e78dac26): Add thickness method for all grid types (#1138). Committed by jdhughes-usgs on 2021-06-25. - * [feat(flopy for mf6 docs)](https://github.com/modflowpy/flopy/commit/fbba027a6c6c59553b0030f6bac2b9f68a14198c): Documentation added and improved for flopy (#1121). Committed by spaulins-usgs on 2021-06-01. - * [Feat(.output)](https://github.com/modflowpy/flopy/commit/df843e00dc9df208e5b16e7a0523456f1e80c004): Added output property method to mf6 packages and models (#1100). Committed by Joshua Larsen on 2021-04-23. - - -* Bug fixes: - - * [fix(flopy_io)](https://github.com/modflowpy/flopy/commit/5098c56085ee8498654ecf76aa5c71f1067466b6): Limit fixed point format string to fixed column widths (#1172). Committed by jdhughes-usgs on 2021-08-06. - * [fix(modpath7)](https://github.com/modflowpy/flopy/commit/9020bf362ea6418a39c12def5c74eb98ecc51746): Address #993 and #1053 (#1170). Committed by jdhughes-usgs on 2021-08-05. - * [fix(lakpak_utils)](https://github.com/modflowpy/flopy/commit/08dfff9420a50e66994575344cfd75a9fb7b1173): Fix telev and belev for horizontal connections (#1168). Committed by jdhughes-usgs on 2021-08-05. - * [fix(mfsfr2.check)](https://github.com/modflowpy/flopy/commit/cf5ee1c885da2294a385cc3e436aa7a9c68cd143): Make reach_connection_gaps.chk.csv a normal csv file (#1151). Committed by Mike Taves on 2021-07-27. - * [fix(modflow/mfrch,mfevt)](https://github.com/modflowpy/flopy/commit/b780bfb9721156fbdd9a96d99cf7b084d99ab452): Mfusg rch,evt load and write fixes (#1148). Committed by Chris Nicol on 2021-07-13. - * [fix(Raster)](https://github.com/modflowpy/flopy/commit/679c8844704a4e9b337af06c1826984c2715371f): Update default dtypes to include unsigned integers (#1147). Committed by Joshua Larsen on 2021-07-12. - * [fix(utils/check)](https://github.com/modflowpy/flopy/commit/345e0fbfdc007b688982c09bfa82841d56ac5cf7): File check for mfusg unstructured models (#1145). Committed by Chris Nicol on 2021-07-09. - * [fix(list parsing)](https://github.com/modflowpy/flopy/commit/148087e2b6f989d8625a2d345fbe1069b58bd99b): Fixed errors caused by parsing certain lists with keywords in the middle (#1135). Committed by spaulins-usgs on 2021-06-25. - * [fix(plotutil.py, grid.py)](https://github.com/modflowpy/flopy/commit/e566845172380e3eae06981ca180923d2362ee56): Fix .plot() method using mflay parameter (#1134). Committed by Joshua Larsen on 2021-06-16. - * [fix(map.py)](https://github.com/modflowpy/flopy/commit/4cfb11db25c17f70708b47bec79f88479d35a3fe): Fix slow plotting routines (#1118). Committed by Joshua Larsen on 2021-06-11. - * [fix(plot_pathline)](https://github.com/modflowpy/flopy/commit/fa98069de665fcbd45c4b468bef9ac484833c2f9): Update modpath intersection routines (#1112). Committed by Joshua Larsen on 2021-06-11. - * [fix(gridgen)](https://github.com/modflowpy/flopy/commit/ce5dcf9254bc5714d3b4bd5e888bdf4860cd5ecb): Mfusg helper function not indexing correctly (#1124). Committed by langevin-usgs on 2021-05-28. - * [fix(numpy)](https://github.com/modflowpy/flopy/commit/6c328e1d57a07b452b08575806c1ef78c1277fe4): Aliases of builtin types is deprecated (#1105). Committed by Mike Taves on 2021-05-07. - * [fix(mfsfr2.py)](https://github.com/modflowpy/flopy/commit/870c5773307761af977934a0b6fdfa84e7f30e72): Dataset 6b and 6c write routine, remove blank lines (#1101). Committed by Joshua Larsen on 2021-04-26. - * [fix(performance)](https://github.com/modflowpy/flopy/commit/4104cf5e6a35e2a1fd6183442962ae5cb258fa7a): Implemented performance improvements including improvements suggested by @briochh (#1092) (#1097). Committed by spaulins-usgs on 2021-04-12. - * [fix(package write)](https://github.com/modflowpy/flopy/commit/58cb48e7a6240d2a01039b5a5ab3c67c5111662c): Allow user to define and write empty stress period blocks to package files (#1091) (#1093). Committed by scottrp on 2021-04-08. - * [fix(imports)](https://github.com/modflowpy/flopy/commit/36426534fae226570884f82a93a42374bd0019da): Fix shapely and geojson imports (#1083). Committed by jdhughes-usgs on 2021-03-20. - * [fix(shapely)](https://github.com/modflowpy/flopy/commit/ff7b8223a9184ffbe6460ae857be45533d5c874a): Handle deprecation warnings from shapely 1.8 (#1069). Committed by Mike Taves on 2021-03-19. - * [fix(mp7particledata)](https://github.com/modflowpy/flopy/commit/44ebec2cd6a4a79a2f3f7165eae8ced7da0340c8): Update dtype comparison for unstructured partlocs (#1071). Committed by rodrperezi on 2021-03-19. - * [fix(get_file_entry)](https://github.com/modflowpy/flopy/commit/5604ef78fb8b2366fc7d5d827e68413ac602c7fa): None text removed from empty stress period data with aux variable (#1080) (#1081). Committed by scottrp on 2021-03-19. - * [fix(data check)](https://github.com/modflowpy/flopy/commit/179fc4e06b6317f12adcc826597f9586317fc7c0): Minimum number of data columns check fixed (#1062) (#1067). Committed by spaulins-usgs on 2021-03-17. - * [fix(plotutil)](https://github.com/modflowpy/flopy/commit/605366bba794a7ca75b67ef956dc232e20c79c48): Number of plottable layers should be from util3d.shape[0] (#1077). Committed by Mike Taves on 2021-03-15. - * [fix(data check)](https://github.com/modflowpy/flopy/commit/cb04f9d2ac55f3cbc320ef212945f69045222366): Minimum number of data columns check fixed (#1062) (#1065). Committed by spaulins-usgs on 2021-02-19. +#### New features + +* [feat(mf6-lake)](https://github.com/modflowpy/flopy/commit/73a44059d18ee37f16d8e8fc90c231a0c9b16cf7): Add helper function to create lake connections (#1163). Committed by jdhughes-usgs on 2021-08-04. +* [feat(data storage)](https://github.com/modflowpy/flopy/commit/08b95ea0b4b582567bbc99ff89f9923910a33d70): Data automatically stored internally when simulation or model relative path changed (#1126) (#1157). Committed by spaulins-usgs on 2021-07-29. +* [feat(get_reduced_pumping)](https://github.com/modflowpy/flopy/commit/86b270d2cc085f92373c1623cb61a23d2befc70e): Update to read external pumping reduction files (#1162). Committed by Joshua Larsen on 2021-07-29. +* [feat(raster)](https://github.com/modflowpy/flopy/commit/3ffedb45c4fa017ff64a4d579314c12386696068): Add option to extrapolate using ``nearest`` method (#1159). Committed by jdhughes-usgs on 2021-07-26. +* [Feat(ZoneBudget6)](https://github.com/modflowpy/flopy/commit/04fe7e4a3c67cb068de444a2979a3528ccbc3e60): Added zonebudget6 class to zonbud.py (#1149). Committed by Joshua Larsen on 2021-07-12. +* [feat(grid)](https://github.com/modflowpy/flopy/commit/0560a4d444c1f0ecd90319c41a6942c8e78dac26): Add thickness method for all grid types (#1138). Committed by jdhughes-usgs on 2021-06-25. +* [feat(flopy for mf6 docs)](https://github.com/modflowpy/flopy/commit/fbba027a6c6c59553b0030f6bac2b9f68a14198c): Documentation added and improved for flopy (#1121). Committed by spaulins-usgs on 2021-06-01. +* [Feat(.output)](https://github.com/modflowpy/flopy/commit/df843e00dc9df208e5b16e7a0523456f1e80c004): Added output property method to mf6 packages and models (#1100). Committed by Joshua Larsen on 2021-04-23. + + +#### Bug fixes + +* [fix(flopy_io)](https://github.com/modflowpy/flopy/commit/5098c56085ee8498654ecf76aa5c71f1067466b6): Limit fixed point format string to fixed column widths (#1172). Committed by jdhughes-usgs on 2021-08-06. +* [fix(modpath7)](https://github.com/modflowpy/flopy/commit/9020bf362ea6418a39c12def5c74eb98ecc51746): Address #993 and #1053 (#1170). Committed by jdhughes-usgs on 2021-08-05. +* [fix(lakpak_utils)](https://github.com/modflowpy/flopy/commit/08dfff9420a50e66994575344cfd75a9fb7b1173): Fix telev and belev for horizontal connections (#1168). Committed by jdhughes-usgs on 2021-08-05. +* [fix(mfsfr2.check)](https://github.com/modflowpy/flopy/commit/cf5ee1c885da2294a385cc3e436aa7a9c68cd143): Make reach_connection_gaps.chk.csv a normal csv file (#1151). Committed by Mike Taves on 2021-07-27. +* [fix(modflow/mfrch,mfevt)](https://github.com/modflowpy/flopy/commit/b780bfb9721156fbdd9a96d99cf7b084d99ab452): Mfusg rch,evt load and write fixes (#1148). Committed by Chris Nicol on 2021-07-13. +* [fix(Raster)](https://github.com/modflowpy/flopy/commit/679c8844704a4e9b337af06c1826984c2715371f): Update default dtypes to include unsigned integers (#1147). Committed by Joshua Larsen on 2021-07-12. +* [fix(utils/check)](https://github.com/modflowpy/flopy/commit/345e0fbfdc007b688982c09bfa82841d56ac5cf7): File check for mfusg unstructured models (#1145). Committed by Chris Nicol on 2021-07-09. +* [fix(list parsing)](https://github.com/modflowpy/flopy/commit/148087e2b6f989d8625a2d345fbe1069b58bd99b): Fixed errors caused by parsing certain lists with keywords in the middle (#1135). Committed by spaulins-usgs on 2021-06-25. +* [fix(plotutil.py, grid.py)](https://github.com/modflowpy/flopy/commit/e566845172380e3eae06981ca180923d2362ee56): Fix .plot() method using mflay parameter (#1134). Committed by Joshua Larsen on 2021-06-16. +* [fix(map.py)](https://github.com/modflowpy/flopy/commit/4cfb11db25c17f70708b47bec79f88479d35a3fe): Fix slow plotting routines (#1118). Committed by Joshua Larsen on 2021-06-11. +* [fix(plot_pathline)](https://github.com/modflowpy/flopy/commit/fa98069de665fcbd45c4b468bef9ac484833c2f9): Update modpath intersection routines (#1112). Committed by Joshua Larsen on 2021-06-11. +* [fix(gridgen)](https://github.com/modflowpy/flopy/commit/ce5dcf9254bc5714d3b4bd5e888bdf4860cd5ecb): Mfusg helper function not indexing correctly (#1124). Committed by langevin-usgs on 2021-05-28. +* [fix(numpy)](https://github.com/modflowpy/flopy/commit/6c328e1d57a07b452b08575806c1ef78c1277fe4): Aliases of builtin types is deprecated (#1105). Committed by Mike Taves on 2021-05-07. +* [fix(mfsfr2.py)](https://github.com/modflowpy/flopy/commit/870c5773307761af977934a0b6fdfa84e7f30e72): Dataset 6b and 6c write routine, remove blank lines (#1101). Committed by Joshua Larsen on 2021-04-26. +* [fix(performance)](https://github.com/modflowpy/flopy/commit/4104cf5e6a35e2a1fd6183442962ae5cb258fa7a): Implemented performance improvements including improvements suggested by @briochh (#1092) (#1097). Committed by spaulins-usgs on 2021-04-12. +* [fix(package write)](https://github.com/modflowpy/flopy/commit/58cb48e7a6240d2a01039b5a5ab3c67c5111662c): Allow user to define and write empty stress period blocks to package files (#1091) (#1093). Committed by scottrp on 2021-04-08. +* [fix(imports)](https://github.com/modflowpy/flopy/commit/36426534fae226570884f82a93a42374bd0019da): Fix shapely and geojson imports (#1083). Committed by jdhughes-usgs on 2021-03-20. +* [fix(shapely)](https://github.com/modflowpy/flopy/commit/ff7b8223a9184ffbe6460ae857be45533d5c874a): Handle deprecation warnings from shapely 1.8 (#1069). Committed by Mike Taves on 2021-03-19. +* [fix(mp7particledata)](https://github.com/modflowpy/flopy/commit/44ebec2cd6a4a79a2f3f7165eae8ced7da0340c8): Update dtype comparison for unstructured partlocs (#1071). Committed by rodrperezi on 2021-03-19. +* [fix(get_file_entry)](https://github.com/modflowpy/flopy/commit/5604ef78fb8b2366fc7d5d827e68413ac602c7fa): None text removed from empty stress period data with aux variable (#1080) (#1081). Committed by scottrp on 2021-03-19. +* [fix(data check)](https://github.com/modflowpy/flopy/commit/179fc4e06b6317f12adcc826597f9586317fc7c0): Minimum number of data columns check fixed (#1062) (#1067). Committed by spaulins-usgs on 2021-03-17. +* [fix(plotutil)](https://github.com/modflowpy/flopy/commit/605366bba794a7ca75b67ef956dc232e20c79c48): Number of plottable layers should be from util3d.shape[0] (#1077). Committed by Mike Taves on 2021-03-15. +* [fix(data check)](https://github.com/modflowpy/flopy/commit/cb04f9d2ac55f3cbc320ef212945f69045222366): Minimum number of data columns check fixed (#1062) (#1065). Committed by spaulins-usgs on 2021-02-19. ### Version 3.3.3 -* New features: +#### New features - * [feat(voronoi)](https://github.com/modflowpy/flopy/commit/71162aef76ad025c42753e82ddee14bdeef1fd22): Add voronoigrid class (#1034). Committed by langevin-usgs on 2021-01-05. - * [feat(unstructured)](https://github.com/modflowpy/flopy/commit/0f7a0f033ba0bdff19621e824e721d032a6d1313): Improve unstructured grid support for modflow 6 and modflow-usg (#1021). Committed by langevin-usgs on 2020-11-27. +* [feat(voronoi)](https://github.com/modflowpy/flopy/commit/71162aef76ad025c42753e82ddee14bdeef1fd22): Add voronoigrid class (#1034). Committed by langevin-usgs on 2021-01-05. +* [feat(unstructured)](https://github.com/modflowpy/flopy/commit/0f7a0f033ba0bdff19621e824e721d032a6d1313): Improve unstructured grid support for modflow 6 and modflow-usg (#1021). Committed by langevin-usgs on 2020-11-27. -* Bug fixes: +#### Bug fixes - * [fix(createpackages)](https://github.com/modflowpy/flopy/commit/8a2cffb052d0c33a4699edb9554b039fa871f00f): Avoid creating invalid escape characters (#1055). Committed by Mike Taves on 2021-02-17. - * [fix(DeprecationWarning)](https://github.com/modflowpy/flopy/commit/7d36b1c7f67a9eddeda122644295cf23c0573c8d): Use collections.abc module instead of collections (#1057). Committed by Mike Taves on 2021-02-15. - * [fix(DeprecationWarning)](https://github.com/modflowpy/flopy/commit/39c0ecba20bd54f2eafd8350151e60efbcc5c162): Related to numpy (#1058). Committed by Mike Taves on 2021-02-15. - * [fix(numpy)](https://github.com/modflowpy/flopy/commit/943ace46c686cbdbfdc327a3016da5942211ab7e): Aliases of builtin types is deprecated as of numpy 1.20 (#1052). Committed by Mike Taves on 2021-02-11. - * [fix()](https://github.com/modflowpy/flopy/commit/3ccdd57e390b94c4f23daa3d46554efd39e8ec9d): fix(get_active) include the cbd layers when checking layer thickness before BAS is loaded (#1051). Committed by Michael Ou on 2021-02-08. - * [fix(dis)](https://github.com/modflowpy/flopy/commit/5bfdf715514bbefd3f9d9a2e79d5c486e48f1896): Fix for dis.get_lrc() and dis.get_node() (#1049). Committed by langevin-usgs on 2021-02-04. - * [fix()](https://github.com/modflowpy/flopy/commit/3088e51bb546afc5a68103a81821c750480263b7): fix(modflow/mflpf) mfusg unstructured lpf ikcflag addition (#1044). Committed by Chris Nicol on 2021-02-01. - * [fix(print MFArray)](https://github.com/modflowpy/flopy/commit/b8322ddc52241d3c2a49c4ebdf2e8865c6f36bb9): Fixed printing of layered arrays - issue #1043 (#1045). Committed by spaulins-usgs on 2021-01-29. - * [fix(GridIntersect)](https://github.com/modflowpy/flopy/commit/369942c7ed3171927f50a20c27b951ed062eb0e1): Fix vertices for offset grids (#1037). Committed by Davíd Brakenhoff on 2021-01-13. - * [fix(PlotMapView.plot_array())](https://github.com/modflowpy/flopy/commit/7cb429f81a9206fa450cceff21c695faf01fce41): Fix value masking code for masked_values parameter (#1026). Committed by Joshua Larsen on 2020-12-03. - * [fix(sfr ic option)](https://github.com/modflowpy/flopy/commit/0ab929e01fdf2a2205d268e51364630d9bbaf9c5): Made ic optional and updated description (#1020). Committed by spaulins-usgs on 2020-11-27. +* [fix(createpackages)](https://github.com/modflowpy/flopy/commit/8a2cffb052d0c33a4699edb9554b039fa871f00f): Avoid creating invalid escape characters (#1055). Committed by Mike Taves on 2021-02-17. +* [fix(DeprecationWarning)](https://github.com/modflowpy/flopy/commit/7d36b1c7f67a9eddeda122644295cf23c0573c8d): Use collections.abc module instead of collections (#1057). Committed by Mike Taves on 2021-02-15. +* [fix(DeprecationWarning)](https://github.com/modflowpy/flopy/commit/39c0ecba20bd54f2eafd8350151e60efbcc5c162): Related to numpy (#1058). Committed by Mike Taves on 2021-02-15. +* [fix(numpy)](https://github.com/modflowpy/flopy/commit/943ace46c686cbdbfdc327a3016da5942211ab7e): Aliases of builtin types is deprecated as of numpy 1.20 (#1052). Committed by Mike Taves on 2021-02-11. +* [fix()](https://github.com/modflowpy/flopy/commit/3ccdd57e390b94c4f23daa3d46554efd39e8ec9d): fix(get_active) include the cbd layers when checking layer thickness before BAS is loaded (#1051). Committed by Michael Ou on 2021-02-08. +* [fix(dis)](https://github.com/modflowpy/flopy/commit/5bfdf715514bbefd3f9d9a2e79d5c486e48f1896): Fix for dis.get_lrc() and dis.get_node() (#1049). Committed by langevin-usgs on 2021-02-04. +* [fix()](https://github.com/modflowpy/flopy/commit/3088e51bb546afc5a68103a81821c750480263b7): fix(modflow/mflpf) mfusg unstructured lpf ikcflag addition (#1044). Committed by Chris Nicol on 2021-02-01. +* [fix(print MFArray)](https://github.com/modflowpy/flopy/commit/b8322ddc52241d3c2a49c4ebdf2e8865c6f36bb9): Fixed printing of layered arrays - issue #1043 (#1045). Committed by spaulins-usgs on 2021-01-29. +* [fix(GridIntersect)](https://github.com/modflowpy/flopy/commit/369942c7ed3171927f50a20c27b951ed062eb0e1): Fix vertices for offset grids (#1037). Committed by Davíd Brakenhoff on 2021-01-13. +* [fix(PlotMapView.plot_array())](https://github.com/modflowpy/flopy/commit/7cb429f81a9206fa450cceff21c695faf01fce41): Fix value masking code for masked_values parameter (#1026). Committed by Joshua Larsen on 2020-12-03. +* [fix(sfr ic option)](https://github.com/modflowpy/flopy/commit/0ab929e01fdf2a2205d268e51364630d9bbaf9c5): Made ic optional and updated description (#1020). Committed by spaulins-usgs on 2020-11-27. ### Version 3.3.2 -* New features: - - * [feat(mf6)](https://github.com/modflowpy/flopy/commit/133f07fe2c0c418aa139ddae1429605ef5a1f253): Update t503 autotest to use mf6examples zip file (#1007). Committed by jdhughes-usgs on 2020-10-21. - * [feat(mf6)](https://github.com/modflowpy/flopy/commit/0bc91e4c2873ee2783968fd28b98c67c883457c0): Add modflow 6 gwt dfn and classes (#1006). Committed by jdhughes-usgs on 2020-10-21. - * [feat(geospatial_util)](https://github.com/modflowpy/flopy/commit/9ad6732c4b0c9cf26cf2deac0d95fee2d6859f97): Geospatial consolidation utilities (#1002). Committed by Joshua Larsen on 2020-10-19. - * [feat(cvfdutil)](https://github.com/modflowpy/flopy/commit/fdcc35ff5a7e7a809d7d10eff914881351a8f738): Capability to create disv nested grids (#997). Committed by langevin-usgs on 2020-10-02. - * [feat(cellid not as tuple)](https://github.com/modflowpy/flopy/commit/2763a1d5ef0a886582d682cc27f02f4a5cb52693): List data input now accepts cellids as separate integers (#976). Committed by spaulins-usgs on 2020-08-27. - * [feat(set_all_data_external) ](https://github.com/modflowpy/flopy/commit/46e041bc01e47b65ea8ba0420609cecc52ff74c0): New check_data option (#966). Committed by spaulins-usgs on 2020-08-17. - - -* Bug fixes: - - * [fix(gridintersect)](https://github.com/modflowpy/flopy/commit/5091182a7c71d30bf0b62e2e257cb13b4652d7cf): Use linestrings and structured grid (#996). Committed by Tom van Steijn on 2020-09-25. - * [fix()](https://github.com/modflowpy/flopy/commit/44d8b5b68c6624b5c20e78e2e7652c7429ba088a): fix(extraneous blocks and zero length data in a list) (#990). Committed by spaulins-usgs on 2020-09-03. - * [fix(internal)](https://github.com/modflowpy/flopy/commit/af28ed8ffc7e6d6fd19d82a3f9a1d496514ef6b7): Flopy fixed to correctly reads in internal keyword when no multiplier supplied. also, header line added to package files. (#962). Committed by spaulins-usgs on 2020-08-13. - * [fix(mfsfr2.py](https://github.com/modflowpy/flopy/commit/573da13fd8a8069ea3d8fb189d8033eb20fc4eed): Find_path): wrap find_path() so that the routing dictionary (graph) can still be copied, but won't be copied with every call of find_path() as it recursively finds the routing connections along a path in the sfr network. this was severely impacting performance for large sfr networks. (#955). Committed by aleaf on 2020-08-11. - * [fix(#958)](https://github.com/modflowpy/flopy/commit/2fd9326534d2782428111ae47dfac1af0c21e04d): Fix gridintersect._vtx_grid_to_shape_generator rtree for cells with more than 3 vertices (#959). Committed by mkennard-aquaveo on 2020-08-07. - * [fix(GridIntersect)](https://github.com/modflowpy/flopy/commit/a6b6c57150e9b28022bdc878090d0f1f9b0af261): Fix crash intersecting 3d points that are outside… (#957). Committed by mkennard-aquaveo on 2020-08-05. - * [fix(mvr)](https://github.com/modflowpy/flopy/commit/49b4aa27e84c8307e8ff15cc6d1a661031af6776): Added documentation explaining the difference between the two flopy mvr classes (#950). Committed by spaulins-usgs on 2020-07-31. - * [fix(check)](https://github.com/modflowpy/flopy/commit/cd81a0911374eb1af2a9fd5ab31a3c6df7baf675): Get_active() error for confining bed layers (#937). Committed by Michael Ou on 2020-07-29. - * [fix(rcha and evta)](https://github.com/modflowpy/flopy/commit/3640b1a15667b30b04a21a0ba55b6c063747a1b6): Irch and ievt arrays now zero based. fix for issue #941. also changed createpackages.py to always produce python scripts with unix-style line endings. (#949). Committed by spaulins-usgs on 2020-07-29. - * [fix(lgrutil)](https://github.com/modflowpy/flopy/commit/3e7e3679deb0d440a139a6d2a71ad174c4d65a12): Corrected bug in child to parent vertical exchanges (#948). Committed by langevin-usgs on 2020-07-27. - * [fix(time series slowness)](https://github.com/modflowpy/flopy/commit/47572f0ecbc024df1dfa57bcdff11175416f6f26): Speeds up performance when a large number of time series are used by a single stress package (#943). Committed by spaulins-usgs on 2020-07-17. - * [fix](https://github.com/modflowpy/flopy/commit/d16411dda8eae387da3bfbb8c2c9a32d069711e6): Restore python 3.5 compatibility (modulenotfounderror -> importerror) (#933). Committed by Mike Taves on 2020-07-09. - * [fix(read binary file)](https://github.com/modflowpy/flopy/commit/f437e8bcd135fee09e6fd4aa7d4691e589ab39c0): Fix for reading binary files with array data (#931). Committed by spaulins-usgs on 2020-06-30. - * [fix(idomain)](https://github.com/modflowpy/flopy/commit/27e4191875a59c09a2339a481d84f1052c89f0f3): Data checks now treat all positive idomain values as active (#929). Committed by spaulins-usgs on 2020-06-29. - * [fix(Modpath7Sim)](https://github.com/modflowpy/flopy/commit/b27fccdee589c772e6e66160f27d60a8dd485645): Fix timepointinterval calculation for timepointoption 3 (#927). Committed by jdhughes-usgs on 2020-06-26. +#### New features + +* [feat(mf6)](https://github.com/modflowpy/flopy/commit/133f07fe2c0c418aa139ddae1429605ef5a1f253): Update t503 autotest to use mf6examples zip file (#1007). Committed by jdhughes-usgs on 2020-10-21. +* [feat(mf6)](https://github.com/modflowpy/flopy/commit/0bc91e4c2873ee2783968fd28b98c67c883457c0): Add modflow 6 gwt dfn and classes (#1006). Committed by jdhughes-usgs on 2020-10-21. +* [feat(geospatial_util)](https://github.com/modflowpy/flopy/commit/9ad6732c4b0c9cf26cf2deac0d95fee2d6859f97): Geospatial consolidation utilities (#1002). Committed by Joshua Larsen on 2020-10-19. +* [feat(cvfdutil)](https://github.com/modflowpy/flopy/commit/fdcc35ff5a7e7a809d7d10eff914881351a8f738): Capability to create disv nested grids (#997). Committed by langevin-usgs on 2020-10-02. +* [feat(cellid not as tuple)](https://github.com/modflowpy/flopy/commit/2763a1d5ef0a886582d682cc27f02f4a5cb52693): List data input now accepts cellids as separate integers (#976). Committed by spaulins-usgs on 2020-08-27. +* [feat(set_all_data_external) ](https://github.com/modflowpy/flopy/commit/46e041bc01e47b65ea8ba0420609cecc52ff74c0): New check_data option (#966). Committed by spaulins-usgs on 2020-08-17. + + +#### Bug fixes + +* [fix(gridintersect)](https://github.com/modflowpy/flopy/commit/5091182a7c71d30bf0b62e2e257cb13b4652d7cf): Use linestrings and structured grid (#996). Committed by Tom van Steijn on 2020-09-25. +* [fix()](https://github.com/modflowpy/flopy/commit/44d8b5b68c6624b5c20e78e2e7652c7429ba088a): fix(extraneous blocks and zero length data in a list) (#990). Committed by spaulins-usgs on 2020-09-03. +* [fix(internal)](https://github.com/modflowpy/flopy/commit/af28ed8ffc7e6d6fd19d82a3f9a1d496514ef6b7): Flopy fixed to correctly reads in internal keyword when no multiplier supplied. also, header line added to package files. (#962). Committed by spaulins-usgs on 2020-08-13. +* [fix(mfsfr2.py](https://github.com/modflowpy/flopy/commit/573da13fd8a8069ea3d8fb189d8033eb20fc4eed): Find_path): wrap find_path() so that the routing dictionary (graph) can still be copied, but won't be copied with every call of find_path() as it recursively finds the routing connections along a path in the sfr network. this was severely impacting performance for large sfr networks. (#955). Committed by aleaf on 2020-08-11. +* [fix(#958)](https://github.com/modflowpy/flopy/commit/2fd9326534d2782428111ae47dfac1af0c21e04d): Fix gridintersect._vtx_grid_to_shape_generator rtree for cells with more than 3 vertices (#959). Committed by mkennard-aquaveo on 2020-08-07. +* [fix(GridIntersect)](https://github.com/modflowpy/flopy/commit/a6b6c57150e9b28022bdc878090d0f1f9b0af261): Fix crash intersecting 3d points that are outside… (#957). Committed by mkennard-aquaveo on 2020-08-05. +* [fix(mvr)](https://github.com/modflowpy/flopy/commit/49b4aa27e84c8307e8ff15cc6d1a661031af6776): Added documentation explaining the difference between the two flopy mvr classes (#950). Committed by spaulins-usgs on 2020-07-31. +* [fix(check)](https://github.com/modflowpy/flopy/commit/cd81a0911374eb1af2a9fd5ab31a3c6df7baf675): Get_active() error for confining bed layers (#937). Committed by Michael Ou on 2020-07-29. +* [fix(rcha and evta)](https://github.com/modflowpy/flopy/commit/3640b1a15667b30b04a21a0ba55b6c063747a1b6): Irch and ievt arrays now zero based. fix for issue #941. also changed createpackages.py to always produce python scripts with unix-style line endings. (#949). Committed by spaulins-usgs on 2020-07-29. +* [fix(lgrutil)](https://github.com/modflowpy/flopy/commit/3e7e3679deb0d440a139a6d2a71ad174c4d65a12): Corrected bug in child to parent vertical exchanges (#948). Committed by langevin-usgs on 2020-07-27. +* [fix(time series slowness)](https://github.com/modflowpy/flopy/commit/47572f0ecbc024df1dfa57bcdff11175416f6f26): Speeds up performance when a large number of time series are used by a single stress package (#943). Committed by spaulins-usgs on 2020-07-17. +* [fix](https://github.com/modflowpy/flopy/commit/d16411dda8eae387da3bfbb8c2c9a32d069711e6): Restore python 3.5 compatibility (modulenotfounderror -> importerror) (#933). Committed by Mike Taves on 2020-07-09. +* [fix(read binary file)](https://github.com/modflowpy/flopy/commit/f437e8bcd135fee09e6fd4aa7d4691e589ab39c0): Fix for reading binary files with array data (#931). Committed by spaulins-usgs on 2020-06-30. +* [fix(idomain)](https://github.com/modflowpy/flopy/commit/27e4191875a59c09a2339a481d84f1052c89f0f3): Data checks now treat all positive idomain values as active (#929). Committed by spaulins-usgs on 2020-06-29. +* [fix(Modpath7Sim)](https://github.com/modflowpy/flopy/commit/b27fccdee589c772e6e66160f27d60a8dd485645): Fix timepointinterval calculation for timepointoption 3 (#927). Committed by jdhughes-usgs on 2020-06-26. ### Version 3.3.1 -* New features: - - * [feat(ModflowAg)](https://github.com/modflowpy/flopy/commit/c89b2d83a81125c986c05df57ffc980fe10fd663): Add the modflowag package for nwt (pull request #922). Committed by Joshua Larsen on 2020-06-25. - * [feat(GridIntersect)](https://github.com/modflowpy/flopy/commit/176c9b45eb158217b1aeb0657d60ed06739e53e6): #902 (#903). Committed by Davíd Brakenhoff on 2020-06-10. - * [feat(mbase)](https://github.com/modflowpy/flopy/commit/4fc61d573c108be7601a2e8479a86c35040998c2): Suppress duplicate package warning if verbose is false (#908). Committed by Hughes, J.D on 2020-06-09. - * [feat(ModflowSms)](https://github.com/modflowpy/flopy/commit/f539d072e20cb5654fab8826ac3bbaf7d1f8b52e): Add support for simple, moderate, complex (#906). Committed by langevin-usgs on 2020-06-09. - * [feat(str)](https://github.com/modflowpy/flopy/commit/3182f57479c1a45d614151867f419a0d35f7f2c2): Add irdflg and iptflg control to str (#905). Committed by Hughes, J.D on 2020-06-09. - * [feat(Mf6ListBudget)](https://github.com/modflowpy/flopy/commit/04b74bd8fb4ed71cf0ed07f721204296b9fd4388): Add support for mf6 budgets with multiple packages with same name (#900). Committed by langevin-usgs on 2020-06-02. - * [feat(mfchd.py)](https://github.com/modflowpy/flopy/commit/88fbd4ccdf837dd4b2a70795522fcaa0a2470dfe): Prevent write chk-file always (#869). Committed by Ralf Junghanns on 2020-05-08. - * [feat(set all data external)](https://github.com/modflowpy/flopy/commit/0336b5c4f6c62994a7ffea26318240fbaa0ca1fb): Set all data external for simulation (#846). Committed by spaulins-usgs on 2020-04-08. - * [feat(vtk)](https://github.com/modflowpy/flopy/commit/e43dccc29d87e182aaa82687968d98391fa78e5d): Improve export at vertices (#844). Committed by Etienne Bresciani on 2020-04-06. - * [feat(netcdf)](https://github.com/modflowpy/flopy/commit/fb942b4675c335247b81f9287bdb8cdb3bcf360b): Use modern features from pyproj>=2.2.0 (#840). Committed by Mike Taves on 2020-03-31. - * [feat(vtk)](https://github.com/modflowpy/flopy/commit/b975368a9c5a25df616b024a08450056e92b6426): Export vectors to vtk. Committed by Etienne Bresciani on 2020-03-31. - * [feat(vtk)](https://github.com/modflowpy/flopy/commit/13c1dd28b9c470c70aac624b70888f5f6badf795): Export in .vti and .vtr when possible. Committed by Etienne Bresciani on 2020-03-28. - * [feat(vectors)](https://github.com/modflowpy/flopy/commit/1284871e5b8ed26c9d925e28295c2098a76b1bc9): Vector plots when stresses applied along boundaries (#817). Committed by langevin-usgs on 2020-03-05. - * [feat(plot_bc)](https://github.com/modflowpy/flopy/commit/207cd1ee5dde116e5b8912232d9b94a9c9304161): Updated plot_bc for maw, uzf, sfr, and multiple bc packages (#808). Committed by Joshua Larsen on 2020-02-11. - * [feat(disl grids)](https://github.com/modflowpy/flopy/commit/469727bcb695ee42611f3df227830ef3b25853f6): Support for 1d vertex grids. fix for writing gridlines to shapefile (#799). Committed by spaulins-usgs on 2020-02-04. - * [feat(zb netcdf)](https://github.com/modflowpy/flopy/commit/491f4fe3923a942e9a0d535a7da54173c4df1204): Zonebudget netcdf export support added (#781). Committed by Joshua Larsen on 2020-01-17. - * [feat(mf6 checker)](https://github.com/modflowpy/flopy/commit/088f147f1d761875f3a1ffabdda82312c002305a): Input data check for mf6 (#779). Committed by spaulins-usgs on 2020-01-16. - - -* Bug fixes: - - * [fix(#280, #835)](https://github.com/modflowpy/flopy/commit/6dae1b0ed5df6836ce6ea981de7050621a90477f): Set_all_data_external now includes constants, cellids in list data are checked (#920). Committed by spaulins-usgs on 2020-06-23. - * [fix(mfsfr2.check)](https://github.com/modflowpy/flopy/commit/796b7b15385de0181cabd33d3bc1915bfa76a83b): Negative segments for lakes no longer included in segment numbering order check (#915). Committed by aleaf on 2020-06-23. - * [fix(GridIntersect)](https://github.com/modflowpy/flopy/commit/d5672f585faa31ead48973834d9b30cf70512cba): Fixes #916 and #917 (#918). Committed by Davíd Brakenhoff on 2020-06-22. - * [fix(ZoneBudget)](https://github.com/modflowpy/flopy/commit/0207372769c5389835c555820c11fc377a4370c7): Fix faulty logic in ZoneBudget (#911). Committed by Jason Bellino on 2020-06-22. - * [fix(SwtListBudget)](https://github.com/modflowpy/flopy/commit/eed5afdd03917256b097a797ec1137c2b80fb8a1): Totim was not being read correctly for seawat list file (#910). Committed by langevin-usgs on 2020-06-10. - * [fix(Seawat.modelgrid)](https://github.com/modflowpy/flopy/commit/7a31a1d7a210894d9970e2e7a3a6a6453518289b): Pass lenuni from dis file into modelgrid instance (#901). Committed by Joshua Larsen on 2020-06-02. - * [fix(mfsimulation)](https://github.com/modflowpy/flopy/commit/0958b28added4b572b168c35657f1d5fd968e952): Repair change for case insensitive model names (#897). Committed by langevin-usgs on 2020-06-01. - * [fix(_plot_util3d_helper, export_array)](https://github.com/modflowpy/flopy/commit/617b98dd0f5750c7cf4d1a9e8376e00fdb4e94bf): (#895). Committed by Joshua Larsen on 2020-06-01. - * [fix()](https://github.com/modflowpy/flopy/commit/8e70c9284490b220ef6fe759b0fafbb5d252f1ae): fix building in clean env (#894). Committed by Ritchie Vink on 2020-05-28. - * [fix(setup.py)](https://github.com/modflowpy/flopy/commit/b80a89c18821fe1bc7375c15e4c03d1e0be70916): Read package name, version, etc. from version.py (#893). Committed by Hughes, J.D on 2020-05-26. - * [fix(MFSimulation)](https://github.com/modflowpy/flopy/commit/3cec7929f323e7753ef80e95b31a64a6105dce41): Remove case sensitivity from register_ims_package() (#890). Committed by Joshua Larsen on 2020-05-25. - * [fix(modelgrid)](https://github.com/modflowpy/flopy/commit/bb861ac2f05e7e8d38a832d03ae0a45a2249d10d): Fix offset for xul and yul in read_usgs_model_reference_file and attribs_from_namfile_header (#889). Committed by Joshua Larsen on 2020-05-19. - * [fix(#886)](https://github.com/modflowpy/flopy/commit/f4e5ed39c5316e9bd2b7941c31f1b91253cd51e5): Mfarray aux variable now always returned as an numpy.ndarray. fixed problem with pylistutil not fully supporting numpy.ndarray type. (#887). Committed by spaulins-usgs on 2020-05-19. - * [fix(CellBudgetFile)](https://github.com/modflowpy/flopy/commit/29d7f849f8d2f160a537494661bd096a9e1c1253): Update for auto precision with imeth = 5 or 6 (#876). Committed by Joshua Larsen on 2020-05-14. - * [fix(#870)](https://github.com/modflowpy/flopy/commit/cbf1f65a8f3389f55bb55249ce8c358ac06cf75c): Update ims name file record after removing ims package (#880). Committed by Joshua Larsen on 2020-05-14. - * [fix](https://github.com/modflowpy/flopy/commit/e3a6c26fe8ad39c69cd5fec78064f12d2edbb521): #868, #874, #879 (#881). Committed by spaulins-usgs on 2020-05-14. - * [fix(#867)](https://github.com/modflowpy/flopy/commit/265fc7c64956b9165b9be2607680de086a9cf973): Fixed minimum record entry count for lists to never include keywords in the count (#875). Committed by spaulins-usgs on 2020-05-11. - * [fix(SfrFile)](https://github.com/modflowpy/flopy/commit/4100de2b80cdb542e820f3b41a88eaf9865fa63d): Update sfrfile for streambed elevation when present (#866). Committed by Joshua Larsen on 2020-05-04. - * [fix(#831,#858)](https://github.com/modflowpy/flopy/commit/a177d59c691367e568de07b340d53e8b1f2322fb): Data length check and case-insensitive lookup (#864). Committed by spaulins-usgs on 2020-05-01. - * [fix(#856)](https://github.com/modflowpy/flopy/commit/c45a5e5f1fb2f8224d87307564b68dc1c30063d9): Specifying period data with value none now only removes data from that period. also, fixed an unrelated problem by updating the multi-package list. (#857). Committed by spaulins-usgs on 2020-04-22. - * [fix(plot_array)](https://github.com/modflowpy/flopy/commit/f6545ff28004f4f6573e07aab939d774230df0a6): Update plot_array method to mask using np.ma.masked_values (#851). Committed by Joshua Larsen on 2020-04-15. - * [fix(ModflowDis)](https://github.com/modflowpy/flopy/commit/52ecd98a11fc4f459c9bd0b59cb854ff402eeb08): Zero based get_node() and get_lrc()… (#847). Committed by Joshua Larsen on 2020-04-10. - * [fix(binaryfile_utils, CellbudgetFile)](https://github.com/modflowpy/flopy/commit/f514a22a38264dc81c0db6dae62db4beae8df227): Update for imeth == 6 (#823). Committed by Joshua Larsen on 2020-04-10. - * [fix(utils.gridintersect)](https://github.com/modflowpy/flopy/commit/14040ff605dfe496d8ec88ca8eeb3f73daeee06e): Bug in gridintersect for vertex grids (#845). Committed by Davíd Brakenhoff on 2020-04-06. - * [fix(mflmt.py)](https://github.com/modflowpy/flopy/commit/1f322f0ef50be9dfaa2252cacb091aded4159113): Clean up docstring for package_flows argument in lmt. Committed by emorway-usgs on 2020-03-31. - * [fix(str)](https://github.com/modflowpy/flopy/commit/59cac5c0466b497c36e833784b436d4a5e47fcd5): Add consistent fixed and free format approach (#838). Committed by Hughes, J.D on 2020-03-31. - * [fix(vtk)](https://github.com/modflowpy/flopy/commit/aa9f3148008dd4c23d86db4e4dae5bae8c8bc564): Issues related to nan and type cast. Committed by Etienne Bresciani on 2020-03-31. - * [fix(pyproj)](https://github.com/modflowpy/flopy/commit/9a1b9e344aefad4ed222bd8d10eb6b9000c9c7d0): Pyproj.proj's errcheck keyword option not reliable (#837). Committed by Mike Taves on 2020-03-29. - * [fix](https://github.com/modflowpy/flopy/commit/4bfab916592784180d57df59b78d190e28c9099b): (#830): handling 'none' cellids in sfr package (#834). Committed by spaulins-usgs on 2020-03-25. - * [fix()](https://github.com/modflowpy/flopy/commit/90a498ea2356e0eca7ddbf1c89a0f5f12f14b5a3): Fix quasi3d plotting (#819). Committed by Ruben Caljé on 2020-03-02. - * [fix(ModflowSfr2.export)](https://github.com/modflowpy/flopy/commit/b6c9a3a6668ee8a35fda785da3709bd4842b7ba9): Update modflowsfr2.export() to use grid instead of spatialreference (#820). Committed by Joshua Larsen on 2020-02-28. - * [fix(flopy3_MT3DMS_examples.ipynb)](https://github.com/modflowpy/flopy/commit/65e8adaeea55a14a3d61c125801741c5b9ceb699): Wrong indices were indexed (#815). Committed by Eric Morway on 2020-02-20. - * [fix(build_exes.py)](https://github.com/modflowpy/flopy/commit/f3136a233274baa63ace7555d862c43bc67894f5): Fix bugs for windows (#810) (#813). Committed by Etienne Bresciani on 2020-02-18. - * [fix(mflist)](https://github.com/modflowpy/flopy/commit/4a885a107ee5ead5a116f95bb1f7f60549cba295): Default value not working (#812). Committed by langevin-usgs on 2020-02-13. - * [fix(flopy3_MT3DMS_examples.ipynb)](https://github.com/modflowpy/flopy/commit/0d152513d4ecb84fd474cb0495dd0676f05d5b72): Match constant heads to original problem (#809). Committed by Eric Morway on 2020-02-11. - * [fix(vtk)](https://github.com/modflowpy/flopy/commit/ab8120bc3dc1214fef90077ade226471900b89d5): Change in export_cbc output file name (#795). Committed by rodrperezi on 2020-01-30. - * [fix(mf6)](https://github.com/modflowpy/flopy/commit/84ee8a72b00fbcd8e7f396af9b356170634cfda6): Update create packages to support additional models (#790). Committed by Hughes, J.D on 2020-01-24. - * [fix(remove_package)](https://github.com/modflowpy/flopy/commit/102d25b23dc0281cccf65eb0a9d3cc8b05755484): Fixed remove_package to rebuild namefile recarray correctly after removing package - issue #776 (#784). Committed by spaulins-usgs on 2020-01-17. - * [fix(gridgen)](https://github.com/modflowpy/flopy/commit/061c72771ae4bc023e970bf9048a4c53bba2ba80): X, y center was not correct for rotated grids (#783). Committed by langevin-usgs on 2020-01-16. - * [fix(mtssm.py)](https://github.com/modflowpy/flopy/commit/f7886e2762464f69ae6b1e3ef1124bbee017b8a8): Handle 1st stress period with incrch equal to -1 (#780). Committed by Eric Morway on 2020-01-16. - * [fix(vtk)](https://github.com/modflowpy/flopy/commit/73f70518238ff383628ba25066c41647e875dc2e): Change in export_model when packages_names is none (#770). Committed by rodrperezi on 2019-12-30. - * [fix()](https://github.com/modflowpy/flopy/commit/ec71e6ce2d2f4bc3d05e3172cccba6c42bf26b87): fix(repeating blocks) (#771). Committed by spaulins-usgs on 2019-12-30. - * [fix(replace package)](https://github.com/modflowpy/flopy/commit/cf3586f0602acd20c9c672b2c763f09c6a252e00): When a second package of the same type is added to a model, the model now checks to see if the package type supports multiple packages. if it does not it automatically removes the first package before adding the second (#767). (#768). Committed by spaulins-usgs on 2019-12-18. - * [fix(Mflist)](https://github.com/modflowpy/flopy/commit/51d80641e81f844490306d2cddefacb21bda8302): Allow none as a list entry (#765). Committed by langevin-usgs on 2019-12-16. +#### New features + +* [feat(ModflowAg)](https://github.com/modflowpy/flopy/commit/c89b2d83a81125c986c05df57ffc980fe10fd663): Add the modflowag package for nwt (pull request #922). Committed by Joshua Larsen on 2020-06-25. +* [feat(GridIntersect)](https://github.com/modflowpy/flopy/commit/176c9b45eb158217b1aeb0657d60ed06739e53e6): #902 (#903). Committed by Davíd Brakenhoff on 2020-06-10. +* [feat(mbase)](https://github.com/modflowpy/flopy/commit/4fc61d573c108be7601a2e8479a86c35040998c2): Suppress duplicate package warning if verbose is false (#908). Committed by Hughes, J.D on 2020-06-09. +* [feat(ModflowSms)](https://github.com/modflowpy/flopy/commit/f539d072e20cb5654fab8826ac3bbaf7d1f8b52e): Add support for simple, moderate, complex (#906). Committed by langevin-usgs on 2020-06-09. +* [feat(str)](https://github.com/modflowpy/flopy/commit/3182f57479c1a45d614151867f419a0d35f7f2c2): Add irdflg and iptflg control to str (#905). Committed by Hughes, J.D on 2020-06-09. +* [feat(Mf6ListBudget)](https://github.com/modflowpy/flopy/commit/04b74bd8fb4ed71cf0ed07f721204296b9fd4388): Add support for mf6 budgets with multiple packages with same name (#900). Committed by langevin-usgs on 2020-06-02. +* [feat(mfchd.py)](https://github.com/modflowpy/flopy/commit/88fbd4ccdf837dd4b2a70795522fcaa0a2470dfe): Prevent write chk-file always (#869). Committed by Ralf Junghanns on 2020-05-08. +* [feat(set all data external)](https://github.com/modflowpy/flopy/commit/0336b5c4f6c62994a7ffea26318240fbaa0ca1fb): Set all data external for simulation (#846). Committed by spaulins-usgs on 2020-04-08. +* [feat(vtk)](https://github.com/modflowpy/flopy/commit/e43dccc29d87e182aaa82687968d98391fa78e5d): Improve export at vertices (#844). Committed by Etienne Bresciani on 2020-04-06. +* [feat(netcdf)](https://github.com/modflowpy/flopy/commit/fb942b4675c335247b81f9287bdb8cdb3bcf360b): Use modern features from pyproj>=2.2.0 (#840). Committed by Mike Taves on 2020-03-31. +* [feat(vtk)](https://github.com/modflowpy/flopy/commit/b975368a9c5a25df616b024a08450056e92b6426): Export vectors to vtk. Committed by Etienne Bresciani on 2020-03-31. +* [feat(vtk)](https://github.com/modflowpy/flopy/commit/13c1dd28b9c470c70aac624b70888f5f6badf795): Export in .vti and .vtr when possible. Committed by Etienne Bresciani on 2020-03-28. +* [feat(vectors)](https://github.com/modflowpy/flopy/commit/1284871e5b8ed26c9d925e28295c2098a76b1bc9): Vector plots when stresses applied along boundaries (#817). Committed by langevin-usgs on 2020-03-05. +* [feat(plot_bc)](https://github.com/modflowpy/flopy/commit/207cd1ee5dde116e5b8912232d9b94a9c9304161): Updated plot_bc for maw, uzf, sfr, and multiple bc packages (#808). Committed by Joshua Larsen on 2020-02-11. +* [feat(disl grids)](https://github.com/modflowpy/flopy/commit/469727bcb695ee42611f3df227830ef3b25853f6): Support for 1d vertex grids. fix for writing gridlines to shapefile (#799). Committed by spaulins-usgs on 2020-02-04. +* [feat(zb netcdf)](https://github.com/modflowpy/flopy/commit/491f4fe3923a942e9a0d535a7da54173c4df1204): Zonebudget netcdf export support added (#781). Committed by Joshua Larsen on 2020-01-17. +* [feat(mf6 checker)](https://github.com/modflowpy/flopy/commit/088f147f1d761875f3a1ffabdda82312c002305a): Input data check for mf6 (#779). Committed by spaulins-usgs on 2020-01-16. + + +#### Bug fixes + +* [fix(#280, #835)](https://github.com/modflowpy/flopy/commit/6dae1b0ed5df6836ce6ea981de7050621a90477f): Set_all_data_external now includes constants, cellids in list data are checked (#920). Committed by spaulins-usgs on 2020-06-23. +* [fix(mfsfr2.check)](https://github.com/modflowpy/flopy/commit/796b7b15385de0181cabd33d3bc1915bfa76a83b): Negative segments for lakes no longer included in segment numbering order check (#915). Committed by aleaf on 2020-06-23. +* [fix(GridIntersect)](https://github.com/modflowpy/flopy/commit/d5672f585faa31ead48973834d9b30cf70512cba): Fixes #916 and #917 (#918). Committed by Davíd Brakenhoff on 2020-06-22. +* [fix(ZoneBudget)](https://github.com/modflowpy/flopy/commit/0207372769c5389835c555820c11fc377a4370c7): Fix faulty logic in ZoneBudget (#911). Committed by Jason Bellino on 2020-06-22. +* [fix(SwtListBudget)](https://github.com/modflowpy/flopy/commit/eed5afdd03917256b097a797ec1137c2b80fb8a1): Totim was not being read correctly for seawat list file (#910). Committed by langevin-usgs on 2020-06-10. +* [fix(Seawat.modelgrid)](https://github.com/modflowpy/flopy/commit/7a31a1d7a210894d9970e2e7a3a6a6453518289b): Pass lenuni from dis file into modelgrid instance (#901). Committed by Joshua Larsen on 2020-06-02. +* [fix(mfsimulation)](https://github.com/modflowpy/flopy/commit/0958b28added4b572b168c35657f1d5fd968e952): Repair change for case insensitive model names (#897). Committed by langevin-usgs on 2020-06-01. +* [fix(_plot_util3d_helper, export_array)](https://github.com/modflowpy/flopy/commit/617b98dd0f5750c7cf4d1a9e8376e00fdb4e94bf): (#895). Committed by Joshua Larsen on 2020-06-01. +* [fix()](https://github.com/modflowpy/flopy/commit/8e70c9284490b220ef6fe759b0fafbb5d252f1ae): fix building in clean env (#894). Committed by Ritchie Vink on 2020-05-28. +* [fix(setup.py)](https://github.com/modflowpy/flopy/commit/b80a89c18821fe1bc7375c15e4c03d1e0be70916): Read package name, version, etc. from version.py (#893). Committed by Hughes, J.D on 2020-05-26. +* [fix(MFSimulation)](https://github.com/modflowpy/flopy/commit/3cec7929f323e7753ef80e95b31a64a6105dce41): Remove case sensitivity from register_ims_package() (#890). Committed by Joshua Larsen on 2020-05-25. +* [fix(modelgrid)](https://github.com/modflowpy/flopy/commit/bb861ac2f05e7e8d38a832d03ae0a45a2249d10d): Fix offset for xul and yul in read_usgs_model_reference_file and attribs_from_namfile_header (#889). Committed by Joshua Larsen on 2020-05-19. +* [fix(#886)](https://github.com/modflowpy/flopy/commit/f4e5ed39c5316e9bd2b7941c31f1b91253cd51e5): Mfarray aux variable now always returned as an numpy.ndarray. fixed problem with pylistutil not fully supporting numpy.ndarray type. (#887). Committed by spaulins-usgs on 2020-05-19. +* [fix(CellBudgetFile)](https://github.com/modflowpy/flopy/commit/29d7f849f8d2f160a537494661bd096a9e1c1253): Update for auto precision with imeth = 5 or 6 (#876). Committed by Joshua Larsen on 2020-05-14. +* [fix(#870)](https://github.com/modflowpy/flopy/commit/cbf1f65a8f3389f55bb55249ce8c358ac06cf75c): Update ims name file record after removing ims package (#880). Committed by Joshua Larsen on 2020-05-14. +* [fix](https://github.com/modflowpy/flopy/commit/e3a6c26fe8ad39c69cd5fec78064f12d2edbb521): #868, #874, #879 (#881). Committed by spaulins-usgs on 2020-05-14. +* [fix(#867)](https://github.com/modflowpy/flopy/commit/265fc7c64956b9165b9be2607680de086a9cf973): Fixed minimum record entry count for lists to never include keywords in the count (#875). Committed by spaulins-usgs on 2020-05-11. +* [fix(SfrFile)](https://github.com/modflowpy/flopy/commit/4100de2b80cdb542e820f3b41a88eaf9865fa63d): Update sfrfile for streambed elevation when present (#866). Committed by Joshua Larsen on 2020-05-04. +* [fix(#831,#858)](https://github.com/modflowpy/flopy/commit/a177d59c691367e568de07b340d53e8b1f2322fb): Data length check and case-insensitive lookup (#864). Committed by spaulins-usgs on 2020-05-01. +* [fix(#856)](https://github.com/modflowpy/flopy/commit/c45a5e5f1fb2f8224d87307564b68dc1c30063d9): Specifying period data with value none now only removes data from that period. also, fixed an unrelated problem by updating the multi-package list. (#857). Committed by spaulins-usgs on 2020-04-22. +* [fix(plot_array)](https://github.com/modflowpy/flopy/commit/f6545ff28004f4f6573e07aab939d774230df0a6): Update plot_array method to mask using np.ma.masked_values (#851). Committed by Joshua Larsen on 2020-04-15. +* [fix(ModflowDis)](https://github.com/modflowpy/flopy/commit/52ecd98a11fc4f459c9bd0b59cb854ff402eeb08): Zero based get_node() and get_lrc()… (#847). Committed by Joshua Larsen on 2020-04-10. +* [fix(binaryfile_utils, CellbudgetFile)](https://github.com/modflowpy/flopy/commit/f514a22a38264dc81c0db6dae62db4beae8df227): Update for imeth == 6 (#823). Committed by Joshua Larsen on 2020-04-10. +* [fix(utils.gridintersect)](https://github.com/modflowpy/flopy/commit/14040ff605dfe496d8ec88ca8eeb3f73daeee06e): Bug in gridintersect for vertex grids (#845). Committed by Davíd Brakenhoff on 2020-04-06. +* [fix(mflmt.py)](https://github.com/modflowpy/flopy/commit/1f322f0ef50be9dfaa2252cacb091aded4159113): Clean up docstring for package_flows argument in lmt. Committed by emorway-usgs on 2020-03-31. +* [fix(str)](https://github.com/modflowpy/flopy/commit/59cac5c0466b497c36e833784b436d4a5e47fcd5): Add consistent fixed and free format approach (#838). Committed by Hughes, J.D on 2020-03-31. +* [fix(vtk)](https://github.com/modflowpy/flopy/commit/aa9f3148008dd4c23d86db4e4dae5bae8c8bc564): Issues related to nan and type cast. Committed by Etienne Bresciani on 2020-03-31. +* [fix(pyproj)](https://github.com/modflowpy/flopy/commit/9a1b9e344aefad4ed222bd8d10eb6b9000c9c7d0): Pyproj.proj's errcheck keyword option not reliable (#837). Committed by Mike Taves on 2020-03-29. +* [fix](https://github.com/modflowpy/flopy/commit/4bfab916592784180d57df59b78d190e28c9099b): (#830): handling 'none' cellids in sfr package (#834). Committed by spaulins-usgs on 2020-03-25. +* [fix()](https://github.com/modflowpy/flopy/commit/90a498ea2356e0eca7ddbf1c89a0f5f12f14b5a3): Fix quasi3d plotting (#819). Committed by Ruben Caljé on 2020-03-02. +* [fix(ModflowSfr2.export)](https://github.com/modflowpy/flopy/commit/b6c9a3a6668ee8a35fda785da3709bd4842b7ba9): Update modflowsfr2.export() to use grid instead of spatialreference (#820). Committed by Joshua Larsen on 2020-02-28. +* [fix(flopy3_MT3DMS_examples.ipynb)](https://github.com/modflowpy/flopy/commit/65e8adaeea55a14a3d61c125801741c5b9ceb699): Wrong indices were indexed (#815). Committed by Eric Morway on 2020-02-20. +* [fix(build_exes.py)](https://github.com/modflowpy/flopy/commit/f3136a233274baa63ace7555d862c43bc67894f5): Fix bugs for windows (#810) (#813). Committed by Etienne Bresciani on 2020-02-18. +* [fix(mflist)](https://github.com/modflowpy/flopy/commit/4a885a107ee5ead5a116f95bb1f7f60549cba295): Default value not working (#812). Committed by langevin-usgs on 2020-02-13. +* [fix(flopy3_MT3DMS_examples.ipynb)](https://github.com/modflowpy/flopy/commit/0d152513d4ecb84fd474cb0495dd0676f05d5b72): Match constant heads to original problem (#809). Committed by Eric Morway on 2020-02-11. +* [fix(vtk)](https://github.com/modflowpy/flopy/commit/ab8120bc3dc1214fef90077ade226471900b89d5): Change in export_cbc output file name (#795). Committed by rodrperezi on 2020-01-30. +* [fix(mf6)](https://github.com/modflowpy/flopy/commit/84ee8a72b00fbcd8e7f396af9b356170634cfda6): Update create packages to support additional models (#790). Committed by Hughes, J.D on 2020-01-24. +* [fix(remove_package)](https://github.com/modflowpy/flopy/commit/102d25b23dc0281cccf65eb0a9d3cc8b05755484): Fixed remove_package to rebuild namefile recarray correctly after removing package - issue #776 (#784). Committed by spaulins-usgs on 2020-01-17. +* [fix(gridgen)](https://github.com/modflowpy/flopy/commit/061c72771ae4bc023e970bf9048a4c53bba2ba80): X, y center was not correct for rotated grids (#783). Committed by langevin-usgs on 2020-01-16. +* [fix(mtssm.py)](https://github.com/modflowpy/flopy/commit/f7886e2762464f69ae6b1e3ef1124bbee017b8a8): Handle 1st stress period with incrch equal to -1 (#780). Committed by Eric Morway on 2020-01-16. +* [fix(vtk)](https://github.com/modflowpy/flopy/commit/73f70518238ff383628ba25066c41647e875dc2e): Change in export_model when packages_names is none (#770). Committed by rodrperezi on 2019-12-30. +* [fix()](https://github.com/modflowpy/flopy/commit/ec71e6ce2d2f4bc3d05e3172cccba6c42bf26b87): fix(repeating blocks) (#771). Committed by spaulins-usgs on 2019-12-30. +* [fix(replace package)](https://github.com/modflowpy/flopy/commit/cf3586f0602acd20c9c672b2c763f09c6a252e00): When a second package of the same type is added to a model, the model now checks to see if the package type supports multiple packages. if it does not it automatically removes the first package before adding the second (#767). (#768). Committed by spaulins-usgs on 2019-12-18. +* [fix(Mflist)](https://github.com/modflowpy/flopy/commit/51d80641e81f844490306d2cddefacb21bda8302): Allow none as a list entry (#765). Committed by langevin-usgs on 2019-12-16. ### Version 3.3.0 @@ -224,14 +222,14 @@ FloPy Changes * Switched from [pangeo binder](https://aws-uswest2-binder.pangeo.io/) binder to [mybinder.org binder](https://mybinder.org) * Added support for MODFLOW 6 Skeletal Compaction and Subsidence (CSUB) package -* Bug fixes: +#### Bug fixes - * Fix issue in MNW2 when the input file had spaced between lines in Dataset 2. [#736](https://github.com/modflowpy/flopy/pull/736) - * Fix issue in MNW2 when the input file uses wellids with inconsistent cases in Dataset 2 and 4. Internally the MNW2 will convert all wellids to lower case strings. [#736](https://github.com/modflowpy/flopy/pull/736) - * Fix issue with VertexGrid plotting errors, squeeze proper dimension for head output, in `PlotMapView` and `PlotCrossSection` - * Fix issue in `PlotUtilities._plot_array_helper` mask MODFLOW-6 no flow and dry cells before plotting - * Removed assumption that transient SSM data appears in the first stress period [#754](https://github.com/modflowpy/flopy/issues/754) [#756](https://github.com/modflowpy/flopy/issues/754). Fix includes a new autotest ([t068_test_ssm.py](https://github.com/modflowpy/flopy/blob/develop/autotest/t068_test_ssm.py)) that adds transient concentration data after the first stress period. - * Fix issues with add_record method for MfList [#758](https://github.com/modflowpy/flopy/pull/758) +* Fix issue in MNW2 when the input file had spaced between lines in Dataset 2. [#736](https://github.com/modflowpy/flopy/pull/736) +* Fix issue in MNW2 when the input file uses wellids with inconsistent cases in Dataset 2 and 4. Internally the MNW2 will convert all wellids to lower case strings. [#736](https://github.com/modflowpy/flopy/pull/736) +* Fix issue with VertexGrid plotting errors, squeeze proper dimension for head output, in `PlotMapView` and `PlotCrossSection` +* Fix issue in `PlotUtilities._plot_array_helper` mask MODFLOW-6 no flow and dry cells before plotting +* Removed assumption that transient SSM data appears in the first stress period [#754](https://github.com/modflowpy/flopy/issues/754) [#756](https://github.com/modflowpy/flopy/issues/754). Fix includes a new autotest ([t068_test_ssm.py](https://github.com/modflowpy/flopy/blob/develop/autotest/t068_test_ssm.py)) that adds transient concentration data after the first stress period. +* Fix issues with add_record method for MfList [#758](https://github.com/modflowpy/flopy/pull/758) ### Version 3.2.13 @@ -251,30 +249,30 @@ FloPy Changes * Support for copying model and package instances with `copy.deepcopy()` * Added link to Binder on [README](README.md) and [notebooks_examples](../examples/docs/notebook_examples.md) markdown documents. Binder provides an environment that runs and interactively serves the FloPy Jupyter notebooks. -* Bug fixes: - - * When using the default `iuzfbnd=None` in the `__init__` routine of mtuzt.py, instantiation of IUZBND was generating a 3D array instead of a 2D array. Now generates a 2D array - * ModflowSfr2 `__init__` was being slowed considerably by the `ModflowSfr2.all_segments` property method. Modified the `ModflowSfr2.graph` property method that describes routing connections between segments to handle cases where segments aren't listed in stress period 0. - * Ensure disordered fields in `reach_data` (Dataset 2) can be supported in `ModflowSfr2` and written to MODFLOW SFR input files. - * When loading a MF model with UZF active, item 8 ("`[IUZROW]` `[IUZCOL]` `IFTUNIT` `[IUZOPT]`") wasn't processed correctly when a user comment appeared at the end of the line - * MODFLOW-6 DISU JA arrays are now treated as zero-based cell IDs. JA, IHC, CL12 are outputted as jagged arrays. - * Models with multiple MODFLOW-6 WEL packages now load and save correctly. - * Exporting individual array and list data to a shapefile was producing an invalid attribute error. Attribute reference has been fixed. - * Fix UnboundLocalError and typo with `flopy.export.shapefile_utils.CRS` class (#608) - * Fix Python 2.7 issue with `flopy.export.utils.export_contourf` (#625) - * When loading a MT3D-USGS model, keyword options (if used) were ignored (#649) - * When loading a modflow model, spatial reference information was not being passed to the SpatialReference class (#659) - * Fix specifysurfk option in UZF, ModflowUZF1 read and write surfk variable - * Fix minor errors in flopy gridgen wrapper - * Close opened files after loading, to reduce `ResourceWarning` messages (#673) - * Fix bugs related to flake8's F821 "undefined name 'name'", which includes issues related to Mt3dPhc, ModflowSfr2, ModflowDe4, ListBudget, and ModflowSms (#686) - * Fix bugs related to flake8's F811 "redefinition of unused 'name'" (#688) - * Fix bugs related to flake8's W605 "invalid escape sequence '\\s'" (or similar) (#700) - * Fix EpsgReference class behavior with JSON user files (#702) - * Fix ModflowSfr2 read write logic for all combinations of isfropt and icalc - * IRCH array of the Recharge Package is now a zero-based variable, which means an IRCH value of 0 corresponds to the top model layer (#715) - * MODFLOW lists were not always read correctly if they used the SFAC or binary options or were used to define parameters (#683) - * Changed VDF Package density limiter defaults to zero (#646) +#### Bug fixes + +* When using the default `iuzfbnd=None` in the `__init__` routine of mtuzt.py, instantiation of IUZBND was generating a 3D array instead of a 2D array. Now generates a 2D array +* ModflowSfr2 `__init__` was being slowed considerably by the `ModflowSfr2.all_segments` property method. Modified the `ModflowSfr2.graph` property method that describes routing connections between segments to handle cases where segments aren't listed in stress period 0. +* Ensure disordered fields in `reach_data` (Dataset 2) can be supported in `ModflowSfr2` and written to MODFLOW SFR input files. +* When loading a MF model with UZF active, item 8 ("`[IUZROW]` `[IUZCOL]` `IFTUNIT` `[IUZOPT]`") wasn't processed correctly when a user comment appeared at the end of the line +* MODFLOW-6 DISU JA arrays are now treated as zero-based cell IDs. JA, IHC, CL12 are outputted as jagged arrays. +* Models with multiple MODFLOW-6 WEL packages now load and save correctly. +* Exporting individual array and list data to a shapefile was producing an invalid attribute error. Attribute reference has been fixed. +* Fix UnboundLocalError and typo with `flopy.export.shapefile_utils.CRS` class (#608) +* Fix Python 2.7 issue with `flopy.export.utils.export_contourf` (#625) +* When loading a MT3D-USGS model, keyword options (if used) were ignored (#649) +* When loading a modflow model, spatial reference information was not being passed to the SpatialReference class (#659) +* Fix specifysurfk option in UZF, ModflowUZF1 read and write surfk variable +* Fix minor errors in flopy gridgen wrapper +* Close opened files after loading, to reduce `ResourceWarning` messages (#673) +* Fix bugs related to flake8's F821 "undefined name 'name'", which includes issues related to Mt3dPhc, ModflowSfr2, ModflowDe4, ListBudget, and ModflowSms (#686) +* Fix bugs related to flake8's F811 "redefinition of unused 'name'" (#688) +* Fix bugs related to flake8's W605 "invalid escape sequence '\\s'" (or similar) (#700) +* Fix EpsgReference class behavior with JSON user files (#702) +* Fix ModflowSfr2 read write logic for all combinations of isfropt and icalc +* IRCH array of the Recharge Package is now a zero-based variable, which means an IRCH value of 0 corresponds to the top model layer (#715) +* MODFLOW lists were not always read correctly if they used the SFAC or binary options or were used to define parameters (#683) +* Changed VDF Package density limiter defaults to zero (#646) ### Version 3.2.12 @@ -288,23 +286,24 @@ FloPy Changes * Added lgrutil test as autotest/t063_test_lgrutil.py and implemented a get_replicated_parent_array() method to the Lgr class so that the user can pass in a parent array and get back an array that is the size of the child model. * Refactored much of the flopy code style to conform with Python conventions and those checked by Codacy. Added an automated Codacy check as part of the pull request and commit checks. -* Bug fixes: - - * Fixed bug in Mt3dms.load to show correct error message when loading non-existent NAM file (#545) - * Removed errant SFT parameter contained in Mt3dUzt.__init__ routine (#572) - * Fixed DISV shapefile export bug that applied layer 1 parameter values to all model layers during export (#508) - * Updated ModflowSfr2.load to store channel_geometry and channel_flow_data (6d, 6e) by nseg instead of itmp position (#546) - * Fixed bug in ModflowMnw2.make_node_data to be able to set multiple wells with different numbers of nodes (#556) - * Fixed bug reading MODFLOW 6 comma separated files (#509) - * Fixed bug constructing a grid class with MODFLOW-USG (#513) - * Optimized performance of grid class by minimizing redundant operations through use of data result caching (#520) - * Fixed bug passing multiple auxiliary variables for MODFLOW 6 array data (#533) - * Fixed bug in Mt3dUzt.__init__; the variable ioutobs doesn't exist in the UZT package and was removed. - * Fixed MODFLOW-LGR bug in which ascii files were not able to be created for some output. Added better testing of the MODFLOW-LGR capabilities to t035_test.py. - * Fixed multiple issues in mfdis that resulted in incorrect row column determination when using the method get_rc_from_node_coordinates (#560). Added better testing of this to t007_test.py. - * Fixed the export_array_contours function as contours would not export in some cases (#577). Added tests of export_array_contours and export_array to t007_test.py as these methods were not tested at all. +#### Bug fixes + +* Fixed bug in Mt3dms.load to show correct error message when loading non-existent NAM file (#545) +* Removed errant SFT parameter contained in Mt3dUzt.__init__ routine (#572) +* Fixed DISV shapefile export bug that applied layer 1 parameter values to all model layers during export (#508) +* Updated ModflowSfr2.load to store channel_geometry and channel_flow_data (6d, 6e) by nseg instead of itmp position (#546) +* Fixed bug in ModflowMnw2.make_node_data to be able to set multiple wells with different numbers of nodes (#556) +* Fixed bug reading MODFLOW 6 comma separated files (#509) +* Fixed bug constructing a grid class with MODFLOW-USG (#513) +* Optimized performance of grid class by minimizing redundant operations through use of data result caching (#520) +* Fixed bug passing multiple auxiliary variables for MODFLOW 6 array data (#533) +* Fixed bug in Mt3dUzt.__init__; the variable ioutobs doesn't exist in the UZT package and was removed. +* Fixed MODFLOW-LGR bug in which ascii files were not able to be created for some output. Added better testing of the MODFLOW-LGR capabilities to t035_test.py. +* Fixed multiple issues in mfdis that resulted in incorrect row column determination when using the method get_rc_from_node_coordinates (#560). Added better testing of this to t007_test.py. +* Fixed the export_array_contours function as contours would not export in some cases (#577). Added tests of export_array_contours and export_array to t007_test.py as these methods were not tested at all. ### Version 3.2.11 + * Added support for the drain return package. * Added support for pyshp version 2.x, which contains a different call signature for the writer than earlier versions. * Added a new flopy3_MT3DMS_examples notebook, which uses Flopy to reproduce the example problems described in the MT3DMS documentation report by Zheng and Wang (1999). @@ -318,17 +317,19 @@ FloPy Changes * Changed the MODFLOW 6 fname argument to be filename. This change is not backward compatible, and will require existing scripts to be modified if the fname argument was used in the package constructor. * Added modflow-nwt options support for `ModflowWel`, `ModflowSfr2`, and `ModflowUzf1` via the `OptionBlock` class. -* Bug fixes: - * Removed variable MXUZCON from `mtuzt.py` that was present during the development of MT3D-USGS, but was not included in the release version of MT3D-USGS. - * Now account for UZT -> UZT2 changes with the release of MT3D-USGS 1.0.1. Use of UZT is no longer supported. - * Fixed bug in `mfuzf1.py` when reading and writing `surfk` when `specifysurfk = True`. - * Fixed bug in `ModflowStr.load()`, utility would fail to load when comments were present. - * Fixed bug in MNW2 in which nodes were not sorted correctly. - * Ensure that external 1-D free arrays are written on one line. - * Typos corrected for various functions, keyword arguments, property names, input file options, and documentation. - * Fixed bug in `Mt3dUzt.__init__` that originated when copying code from mtsft.py to get started on mtuzt.py class. The variable ioutobs doesn't exist in the UZT package and should never have appeared in the package to begin with. +#### Bug fixes + +* Removed variable MXUZCON from `mtuzt.py` that was present during the development of MT3D-USGS, but was not included in the release version of MT3D-USGS. +* Now account for UZT -> UZT2 changes with the release of MT3D-USGS 1.0.1. Use of UZT is no longer supported. +* Fixed bug in `mfuzf1.py` when reading and writing `surfk` when `specifysurfk = True`. +* Fixed bug in `ModflowStr.load()`, utility would fail to load when comments were present. +* Fixed bug in MNW2 in which nodes were not sorted correctly. +* Ensure that external 1-D free arrays are written on one line. +* Typos corrected for various functions, keyword arguments, property names, input file options, and documentation. +* Fixed bug in `Mt3dUzt.__init__` that originated when copying code from mtsft.py to get started on mtuzt.py class. The variable ioutobs doesn't exist in the UZT package and should never have appeared in the package to begin with. ### Version 3.2.10 + * Added parameter_load variable to `mbase` that is set to true if parameter data are applied in the model (only used in models that support parameters). If this is set to `True` `free_format_input` is set to `True` (if currently `False`) when the `write_input()` method is called. This change preserves the precision of parameter data (which is free format data). * MODFLOW 6 model and simulation packages can not be retrieved as a `MFSimulation` attribute * Added support for multicomponent load in `mfsft.py` @@ -345,24 +346,26 @@ FloPy Changes * Added support for MODPATH timeseries output files (`flopy.utils.TimeseriesFile()`). * Added support for plotting MODPATH timeseries output data (`plot_timeseries()`) with ModelMap. -* Bug fixes: - * Fixed issue in HOB when the same layer is specified in the `MLAY` data (dataset 4). If the layer exists the previous fraction value is added to the current value. - * Fixed bug in segment renumbering - * Changed default value for `ioutobs` `**kwargs` in `mtsft.py` from None to 0 to prevent failure. - * Fixed bug when passing extra components info from load to constructor in `mtsft.py` and `mtrct.py`. - * Fixed bug in `mt3ddsp` load - if `multidiffusion` is not found, should only read one 3d array. - * Fixed bug in `zonbud` utility that wasn't accumulating flow from constant heads. - * Fixed minor bug that precluded the passing of mass-balance record names (`TOTAL_IN`, `IN-OUT`, etc.). - * Fixed bug when writing shapefile projection (`.prj`) files using relative paths. - * Fixed bugs in `sfr.load()` -- `weight` and `flwtol` should be cast as floats, not integers. - * Fixed bug when `SpatialReference` supplied with geographic CRS. - * Fixed bug in `mfsfr.py` when writing kinematic data (`irtflg >0`). - * Fixed issue from change in MODFLOW 6 `inspect.getargspec()` method (for getting method arguments). - * Fixed MODFLOW 6 BINARY keyword for reading binary data from a file using `OPEN/CLOSE` (needs parentheses around it). - * Fixed bug in `mtlkt.py` when initiating, loading, and/or writing lkt input file related to multi-species problems. +#### Bug fixes + +* Fixed issue in HOB when the same layer is specified in the `MLAY` data (dataset 4). If the layer exists the previous fraction value is added to the current value. +* Fixed bug in segment renumbering +* Changed default value for `ioutobs` `**kwargs` in `mtsft.py` from None to 0 to prevent failure. +* Fixed bug when passing extra components info from load to constructor in `mtsft.py` and `mtrct.py`. +* Fixed bug in `mt3ddsp` load - if `multidiffusion` is not found, should only read one 3d array. +* Fixed bug in `zonbud` utility that wasn't accumulating flow from constant heads. +* Fixed minor bug that precluded the passing of mass-balance record names (`TOTAL_IN`, `IN-OUT`, etc.). +* Fixed bug when writing shapefile projection (`.prj`) files using relative paths. +* Fixed bugs in `sfr.load()` -- `weight` and `flwtol` should be cast as floats, not integers. +* Fixed bug when `SpatialReference` supplied with geographic CRS. +* Fixed bug in `mfsfr.py` when writing kinematic data (`irtflg >0`). +* Fixed issue from change in MODFLOW 6 `inspect.getargspec()` method (for getting method arguments). +* Fixed MODFLOW 6 BINARY keyword for reading binary data from a file using `OPEN/CLOSE` (needs parentheses around it). +* Fixed bug in `mtlkt.py` when initiating, loading, and/or writing lkt input file related to multi-species problems. ### Version 3.2.9 + * Modified MODFLOW 5 OC stress_period_data=None default behaviour. If MODFLOW 5 OC stress_period_data is not provided then binary head output is saved for the last time step of each stress period. * added multiple component support to ``mt3dusgs SFT`` module * Optimized loading and saving of MODFLOW 6 files @@ -374,32 +377,37 @@ FloPy Changes * Added `ModflowSfr2.export_transient_variable` method to export shapefiles of segment data variables, with stress period data as attributes * Added support for UZF package gages -* Bug fixes: - * Fixed issue with default settings for MODFLOW 5 SUB package `dp` dataset. - * Fixed issue if an external BC list file has only one entry - * Some patching for recarray issues with latest ``numpy`` release (there are more of these lurking...) - * Fixed setting model relative path for MODFLOW 6 simulations - * Python 2.7 compatibility issues fixed for MODFLOW 6 simulations - * IMS file name conflicts now automatically resolved - * Fixed issue with passing in numpy ndarrays arrays as layered data - * Doc string formatting for MODFLOW 6 packages fixed to make doc strings easier to read - * UZF package: fixed issues with handling of finf, pet, extdp and extwc arrays. - * SFR package: fixed issue with reading stress period data where not all segments are listed for periods > 0. - * `SpatialReference.write_gridSpec` was not converting the model origin coordinates to model length units. - * shorted integer field lengths written to shapefiles to 18 characters; some readers may misinterpret longer field lengths as float dtypes. +#### Bug fixes + +* Fixed issue with default settings for MODFLOW 5 SUB package `dp` dataset. +* Fixed issue if an external BC list file has only one entry +* Some patching for recarray issues with latest ``numpy`` release (there are more of these lurking...) +* Fixed setting model relative path for MODFLOW 6 simulations +* Python 2.7 compatibility issues fixed for MODFLOW 6 simulations +* IMS file name conflicts now automatically resolved +* Fixed issue with passing in numpy ndarrays arrays as layered data +* Doc string formatting for MODFLOW 6 packages fixed to make doc strings easier to read +* UZF package: fixed issues with handling of finf, pet, extdp and extwc arrays. +* SFR package: fixed issue with reading stress period data where not all segments are listed for periods > 0. +* `SpatialReference.write_gridSpec` was not converting the model origin coordinates to model length units. +* shorted integer field lengths written to shapefiles to 18 characters; some readers may misinterpret longer field lengths as float dtypes. ### Version 3.2.8 + * Added `has_package(name)` method to see if a package exists. This feature goes nicely with `get_package(name)` method. * Added `set_model_units()` method to change model units for all files created by a model. This method can be useful when creating MODFLOW-LGR models from scratch. * Added SFR2 package functionality * `export_inlets` method to write shapefile showing locations where external flows are entering the stream network. -* Bug fixes: - * Installation: Added dfn files required by MODFLOW 6 functionality to MANIFEST.in so that they are included in the distribution. - * SFR2 package: Fixed issue reading transient data when `ISFOPT` is 4 or 5 for the first stress period. + +#### Bug fixes + +* Installation: Added dfn files required by MODFLOW 6 functionality to MANIFEST.in so that they are included in the distribution. +* SFR2 package: Fixed issue reading transient data when `ISFOPT` is 4 or 5 for the first stress period. ### Version 3.2.7 + * Added beta support for MODFLOW 6 See [here](./mf6.md) for more information. * Added support for retrieving time series from binary cell-by-cell files. Cell-by-cell time series are accessed in the same way they are accessed for heads and concentrations but a text string is required. * Added support for FORTRAN free format array data using n*value where n is the number of times value is repeated. @@ -426,22 +434,25 @@ FloPy Changes * Modified HYDMOD package `klay` variable from one- to zero-based. * Added `.get_layer()` method to DIS package. * Added `.get_saturated_thickness()` and `.get_gradients()` methods -* Bug fixes: - * OC package: Fixed bug when printing and saving data for select stress periods and timesteps. In previous versions, OC data was repeated until respecified. - * SUB package: Fixed bug if data set 15 is passed to preserved unit numbers (i.e., use unit numbers passed on load). - * SUB and SUB-WT packages: Fixed bugs `.load()` to pop original unit number. - * BTN package: Fixed bug in obs. - * LPF package: Fixed bug regarding when HANI is read and written. - * UZF package: added support for MODFLOW NWT options block; fixed issue with loading files with thti/thtr options - * SFR package: fixed bug with segment renumbering, issues with reading transient text file output, - * Fixed issues with dynamic setting of `SpatialReference` parameters - * NWT package: forgive missing value for MXITERXMD - * MNW2 package: fix bug where ztop and zbotm were written incorrectly in `get_allnode_data()`. This was not affecting writing of these variables, only their values in this summary array. - * PCGN package: fixed bug writing package. - * Fixed issue in `Util2d` when non-integer `cnstnt` passed. + +#### Bug fixes + +* OC package: Fixed bug when printing and saving data for select stress periods and timesteps. In previous versions, OC data was repeated until respecified. +* SUB package: Fixed bug if data set 15 is passed to preserved unit numbers (i.e., use unit numbers passed on load). +* SUB and SUB-WT packages: Fixed bugs `.load()` to pop original unit number. +* BTN package: Fixed bug in obs. +* LPF package: Fixed bug regarding when HANI is read and written. +* UZF package: added support for MODFLOW NWT options block; fixed issue with loading files with thti/thtr options +* SFR package: fixed bug with segment renumbering, issues with reading transient text file output, +* Fixed issues with dynamic setting of `SpatialReference` parameters +* NWT package: forgive missing value for MXITERXMD +* MNW2 package: fix bug where ztop and zbotm were written incorrectly in `get_allnode_data()`. This was not affecting writing of these variables, only their values in this summary array. +* PCGN package: fixed bug writing package. +* Fixed issue in `Util2d` when non-integer `cnstnt` passed. ### Version 3.2.6 + * Added functionality to read binary grd file for unstructured grids. * Additions to SpatialReference class: * xll, yll input option @@ -482,17 +493,19 @@ FloPy Changes * load() functionality will now support optional PACKAGE_FLOWS line (last line of LMT input) * write_file() will will now insert PACKAGE_FLOWS line based on user input -* Bug fixes: - * Fixed bug in parsenamefile when file path in namefile is surrounded with quotes. - * Fixed bug in check routine when THICKSTRT is specified as an option in the LPF and UPW packages. - * Fixed bug in BinaryHeader.set_values method that prevented setting of entries based on passed kwargs. - * Fixed bugs in reading and writing SEAWAT Viscosity package. - * The DENSE and VISC arrays are now Transient3d objects, so they may change by stress period. - * MNW2: fixed bug with k, i, j node input option and issues with loading at model level - * Fixed bug in ModflowDis.get_cell_volumes(). +#### Bug fixes + +* Fixed bug in parsenamefile when file path in namefile is surrounded with quotes. +* Fixed bug in check routine when THICKSTRT is specified as an option in the LPF and UPW packages. +* Fixed bug in BinaryHeader.set_values method that prevented setting of entries based on passed kwargs. +* Fixed bugs in reading and writing SEAWAT Viscosity package. +* The DENSE and VISC arrays are now Transient3d objects, so they may change by stress period. +* MNW2: fixed bug with k, i, j node input option and issues with loading at model level +* Fixed bug in ModflowDis.get_cell_volumes(). ### Version 3.2.5 + * Added support for LAK and GAGE packages - full load and write functionality supported. * Added support for MNW2 package. Load and write of .mnw2 package files supported. Support for .mnwi, or the results files (.qsu, .byn) not yet implemented. * Improved support for changing the output format of arrays and variables written to MODFLOW input files. @@ -503,82 +516,68 @@ FloPy Changes * Added static method to Mt3dms().load_obs that reads an MT3D mass file and returns a recarray * Added method to flopy.modpath.Modpath to create modpath simulation file from modflow model instance boundary conditions. Also added examples of creating modpath files and post-processing modpath pathline and endpoint files to the flopy3_MapExample notebook. -* Bug fixes: - * Fixed issue with VK parameters for LPF and UPW packages. - * Fixed issue with MT3D ADV load in cases where empty fields were present in the first line of the file. - * Fixed cross-section array plotting issues. - * BTN observation locations must now be entered in zero-based indices (a 1 is now added to the index values written to btn file) - * Uploaded supporting files for SFR example notebook; fixed issue with segment_data submitted as array (instead of dict) and as 0d array(s). - * Fixed CHD Package so that it now supports options, and therefore, auxiliary variables can be specified. - * Fixed loading BTN save times when numbers are touching. +#### Bug fixes + +* Fixed issue with VK parameters for LPF and UPW packages. +* Fixed issue with MT3D ADV load in cases where empty fields were present in the first line of the file. +* Fixed cross-section array plotting issues. +* BTN observation locations must now be entered in zero-based indices (a 1 is now added to the index values written to btn file) +* Uploaded supporting files for SFR example notebook; fixed issue with segment_data submitted as array (instead of dict) and as 0d array(s). +* Fixed CHD Package so that it now supports options, and therefore, auxiliary variables can be specified. +* Fixed loading BTN save times when numbers are touching. ### Version 3.2.4 -* Added basic model checking functionality (`.check()`). +* Added basic model checking functionality (`.check()`). * Added support for reading SWR Process observation, stage, budget, flow, reach-aquifer exchanges, and structure flows. - * `flopy.utils.HydmodObs` returns a numpy recarray. Previously numpy arrays were returned except when the `slurp()` method was used. The slurp method has been deprecated but the same functionality is available using the `get_data()` method. The recarray returned from the `get_data()` method includes the `totim` value and one or all of the observations (`HYDLBL`). - * Added support for MODFLOW-USG DISU package for unstructured grids. - * Added class (`Gridgen`) for creating layered quadtree grids using GRIDGEN (`flopy.utils.gridgen`). See the flopy3_gridgen notebook for an example of how to use the `Gridgen` class. - * Added user-specified control on use of `OPEN/CLOSE` array options (see flopy3_external_file_handling notebook). - * Added user-specified control for array output formats (see flopy3_array_outputformat_options IPython notebook). - * Added shapefile as optional output format to `.export()` method and deprecated `.to_shapefile()` method. -* Bug fixes: - * Fixed issue with right justified format statement for array control record for MT3DMS. - * Fixed bug writing PHIRAMP for MODFLOW-NWT well files. - * Fixed bugs in NETCDF export methods. - * Fixed bugs in LMT and BTN classes. +#### Bug fixes + +* Fixed issue with right justified format statement for array control record for MT3DMS. +* Fixed bug writing PHIRAMP for MODFLOW-NWT well files. +* Fixed bugs in NETCDF export methods. +* Fixed bugs in LMT and BTN classes. ### Version 3.2.3 -* Added template creation support for several packages for used with PEST (and UCODE). +* Added template creation support for several packages for used with PEST (and UCODE). * Added support for the SEAWAT viscosity (VSC) package. - * Added support for the MODFLOW Stream (STR), Streamflow-Routing (SFR2), Subsidence (SUB), and Subsidence and Aquifer-System Compaction Package for Water-Table Aquifers (SWT) Packages. - * Mt3d model was redesigned based on recent changes to the Modflow model. Mt3d packages rewritten to support multi-species. Primary packages can be loaded (btn, adv, dsp, ssm, gcg). Array utilities modified to read some MT3D RARRAY formats. - * Fixed array loading functionality for case when the CNSTNT value is zero. If CNSTNT is zero and is used as an array multiplier, it is changed to 1 (as done in MODFLOW). - * Added support for the MODFLOW HYDMOD (HYD) Package and reading binary files created by the HYDMOD Package (`HydmodObs` Class) in the `flopy.utils` submodule. - * `flopy.utils.CellBudgetFile` returns a numpy recarray for list based budget data. Previously a dictionary with the `node` number and `q` were returned. The recarray will return the `node` number, `q`, and the `aux` variables for list based budget data. - * Added travis-ci automated testing. ### Version 3.2.2 -* FloPy now supports some simple plotting capabilities for two- and three-dimensional model input data array classes and transient two-dimensional stress period input data using the `.plot()` methods associated with the data array classes (`util_2d`, `util_3d`, and `transient_2d`). The model results reader classes (`HeadFile`, `UcnFile`, and `CellBudgetFile`) have also been extended to include a `.plot()` method that can be used to create simple plots of model output data. See the notebook [flopy3_PlotArrayExample](https://github.com/modflowpy/flopy/blob/master/examples/Notebooks/flopy3_PlotArrayExample.ipynb). +* FloPy now supports some simple plotting capabilities for two- and three-dimensional model input data array classes and transient two-dimensional stress period input data using the `.plot()` methods associated with the data array classes (`util_2d`, `util_3d`, and `transient_2d`). The model results reader classes (`HeadFile`, `UcnFile`, and `CellBudgetFile`) have also been extended to include a `.plot()` method that can be used to create simple plots of model output data. See the notebook [flopy3_PlotArrayExample](https://github.com/modflowpy/flopy/blob/master/examples/Notebooks/flopy3_PlotArrayExample.ipynb). * Added `.to_shapefile()` method to two- and three-dimensional model input data array classes (`util_2d` and `util_3d`), transient two-dimensional stress period input data classes (`transient_2d`), and model output data classes (`HeadFile`, `UcnFile`, and `CellBudgetFile`) that allows model data to be exported as polygon shapefiles with separate attribute columns for each model layer. - * Added support for ASCII model results files. - * Added support for reading MODPATH version 6 pathline and endpoint output files and plotting MODPATH results using mapping capabilities in `flopy.plot` submodule. - * Added `load()` method for MODFLOW GMG solver. -* Bug fixes: - * Multiplier in array control record was not being applied to arrays - * vani parameter was not supported +#### Bug fixes + +* Multiplier in array control record was not being applied to arrays +* vani parameter was not supported ### Version 3.2.1 -* FloPy can now be used with **Python 3.x** +* FloPy can now be used with **Python 3.x** * Revised setters for package class variables stored using the `util_2d` or `util_3d` classes. - * Added option to load a subset of MODFLOW packages in a MODFLOW model name file using `load_only=` keyword. ### Version 3.1 -* FloPy now supports some simple mapping and cross-section capabilities through the `flopy.plot` submodule. See the notebook [flopy3_MapExample](https://github.com/modflowpy/flopy/blob/master/examples/Notebooks/flopy3_MapExample.ipynb). +* FloPy now supports some simple mapping and cross-section capabilities through the `flopy.plot` submodule. See the notebook [flopy3_MapExample](https://github.com/modflowpy/flopy/blob/master/examples/Notebooks/flopy3_MapExample.ipynb). * Full support for all Output Control (OC) options including DDREFERENCE, SAVE IBOUND, and layer lists. All Output Control Input is specified using words. Output Control Input using numeric codes is still available in the ModflowOc88 class. The ModflowOc88 class is currently deprecated and no longer actively maintained. - * Added support for standard MULT package FUNCTION and EXPRESSION functionality are supported. MODFLOW parameters are not supported in `write()` methods. ### Version 3.0 @@ -586,13 +585,8 @@ FloPy Changes FloPy is significantly different from earlier versions of FloPy (previously hosted on [googlecode](https://code.google.com/p/flopy/)). The main changes are: * FloPy is fully zero-based. This means that layers, rows and columns start counting at *zero*. The reason for this is consistency. Arrays are zero-based by default in Python, so it was confusing to have a mix. - * Input for packages that take *layer, row, column, data* input (like the wel or ghb package) has changed and is much more flexible now. See the notebook [flopy3boundaries](https://github.com/modflowpy/flopy/blob/master/examples/Notebooks/flopy3boundaries.ipynb) - * Input for the MT3DMS Source/Sink Mixing (SSM) Package has been modified to be consistent with the new MODFLOW boundary package input and is more flexible than previous versions of FloPy. See the notebook [flopy3ssm](https://github.com/modflowpy/flopy/blob/master/examples/Notebooks/flopy3_multi-component_SSM.ipynb) - * Support for use of EXTERNAL and OPEN/CLOSE array specifiers has been improved. - * *load()* methods have been developed for all of the standard MODFLOW packages and a few less used packages (*e.g.* SWI2). - * MODFLOW parameter support has been added to the `load()` methods. MULT, PVAL, and ZONE packages are now supported and parameter data are converted to arrays in the `load()` methods. MODFLOW parameters are not supported in `write()` methods. diff --git a/etc/environment.yml b/etc/environment.yml index d2faaaaef7..31b3e7c8d3 100644 --- a/etc/environment.yml +++ b/etc/environment.yml @@ -20,10 +20,12 @@ dependencies: - jupyter - jupytext - pytest + - pytest-benchmark - pytest-cases - pytest-cov + - pytest-dotenv - pytest-xdist - - pytest-benchmark + # optional - python-dateutil>=2.4.0 diff --git a/examples/common/notebook_utils.py b/examples/common/notebook_utils.py index 1e6f76d359..22949e0876 100644 --- a/examples/common/notebook_utils.py +++ b/examples/common/notebook_utils.py @@ -11,6 +11,7 @@ sys.path.append(fpth) import flopy + def get_project_root_path() -> Path: return Path.cwd().parent.parent diff --git a/flopy/utils/get_modflow.py b/flopy/utils/get_modflow.py index 280225c51d..672ee49dd1 100755 --- a/flopy/utils/get_modflow.py +++ b/flopy/utils/get_modflow.py @@ -450,18 +450,8 @@ def run_main( if subset: if isinstance(subset, str): subset = set(subset.replace(",", " ").split()) - elif not isinstance(subset, set): + else: subset = set(subset) - subset = set( - [ - ( - f"{e}{lib_suffix}" - if e.startswith("lib") - else f"{e}{exe_suffix}" - ) - for e in subset - ] - ) # Open archive and extract files extract = set() @@ -495,7 +485,7 @@ def run_main( files = set(zipf.namelist()) code = False - if "code.json" in files: + if "code.json" in files and repo == "executables": # don't extract this file files.remove("code.json") code_bytes = zipf.read("code.json") @@ -505,6 +495,7 @@ def run_main( code_md5 = hashlib.md5(code_bytes).hexdigest() meta["code_json_md5"] = code_md5 + if subset: nosub = False subset_keys = files @@ -534,14 +525,17 @@ def add_item(key, fname, do_chmod): return for key in sorted(code): - key_in_sub = key in subset if code[key].get("shared_object"): fname = f"{key}{lib_suffix}" - if nosub or (subset and (key_in_sub or fname in subset)): + if nosub or ( + subset and (key in subset or fname in subset) + ): add_item(key, fname, do_chmod=False) else: fname = f"{key}{exe_suffix}" - if nosub or (subset and (key_in_sub or fname in subset)): + if nosub or ( + subset and (key in subset or fname in subset) + ): add_item(key, fname, do_chmod=True) # check if double version exists fname = f"{key}dbl{exe_suffix}" @@ -550,7 +544,7 @@ def add_item(key, fname, do_chmod): and fname in files and ( nosub - or (subset and (key_in_sub or fname in subset)) + or (subset and (key in subset or fname in subset)) ) ): add_item(key, fname, do_chmod=True) @@ -603,7 +597,8 @@ def add_item(key, fname, do_chmod): # Show listing if not quiet: - print(columns_str(items)) + if any(items): + print(columns_str(items)) if not subset: if full_path: diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000000..163aa77911 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,41 @@ +# Scripts + +This document describes the utility scripts in this directory. + + + + +- [`make-release.py`](#make-releasepy) +- [`process_benchmarks.py`](#process_benchmarkspy) +- [`pull_request_prepare.py`](#pull_request_preparepy) +- [`run_notebooks.py`](#run_notebookspy) +- [`update_version.py`](#update_versionpy) + + + +## `make-release.py` + +TODO + +## `process_benchmarks.py` + +The `process_benchmarks.py` script consumes JSON files created by `pytest-benchmark` and creates a CSV file containing benchmark results. The script takes 2 positional arguments: + +1. The path to the directory containing the JSON files. +2. The path to the directory to create the results CSV. + +## `pull_request_prepare.py` + +The `pull_request_prepare.py` script lints Python source code files by running `black` and `isort` on the `flopy` subdirectory. This script should be run before opening a pull request, as CI will fail if the code is not properly formatted. + +## `run_notebooks.py` + +TODO + +## `update_version.py` + +The `update_version.py` script can be used to update the FloPy version number. If the script is run with no argument, the version number is not changed, but an updated timestamp is written to the `flopy/version.py` file. To set the FloPy version number, use the `--version` (short `-v`) option, e.g.: + +```shell +python scripts/update_version.py 3.3.6 +``` \ No newline at end of file diff --git a/scripts/make-release.py b/scripts/make-release.py deleted file mode 100755 index 2a47a2e039..0000000000 --- a/scripts/make-release.py +++ /dev/null @@ -1,378 +0,0 @@ -#!/usr/bin/python - -import datetime -import json -import subprocess -import sys -from pathlib import Path -from textwrap import dedent - -import yaml - -# file_paths_list has file names and the path to the file relative to -# the repo root directory. The dictionary file_paths has keys for each file. -repo_root = Path(__file__).parent.parent.resolve() -file_paths_list = [ - repo_root / "CITATION.cff", - repo_root / "code.json", - repo_root / "README.md", - repo_root / "docs" / "notebook_examples.md", - repo_root / "docs" / "PyPI_release.md", - repo_root / "flopy" / "version.py", - repo_root / "flopy" / "DISCLAIMER.md", -] -file_paths = {pth.name: pth for pth in file_paths_list} - -now = datetime.datetime.now() - -pak = "flopy" - -approved = """Disclaimer ----------- - -This software is provided "as is" and "as-available", and makes no -representations or warranties of any kind concerning the software, whether -express, implied, statutory, or other. This includes, without limitation, -warranties of title, merchantability, fitness for a particular purpose, -non-infringement, absence of latent or other defects, accuracy, or the -presence or absence of errors, whether or not known or discoverable. -""" - -preliminary = """Disclaimer ----------- - -This software is preliminary or provisional and is subject to revision. It is -being provided to meet the need for timely best science. This software is -provided "as is" and "as-available", and makes no representations or warranties -of any kind concerning the software, whether express, implied, statutory, or -other. This includes, without limitation, warranties of title, -merchantability, fitness for a particular purpose, non-infringement, absence -of latent or other defects, accuracy, or the presence or absence of errors, -whether or not known or discoverable. -""" - - -def get_disclaimer(): - # get current branch - branch = get_branch() - - if branch.lower().startswith("release") or "master" in branch.lower(): - disclaimer = approved - is_approved = True - else: - disclaimer = preliminary - is_approved = False - - return is_approved, disclaimer - - -def get_branch(): - branch = None - - # determine if branch defined on command line - for argv in sys.argv: - if "master" in argv: - branch = "master" - elif "develop" in argv.lower(): - branch = "develop" - - if branch is None: - try: - # determine current branch - b = subprocess.Popen( - ("git", "status"), - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - ).communicate()[0] - if isinstance(b, bytes): - b = b.decode("utf-8") - - for line in b.splitlines(): - if "On branch" in line: - branch = line.replace("On branch ", "").rstrip() - - except: - msg = "Could not determine current branch. Is git installed?" - raise ValueError(msg) - - return branch - - -def get_tag(*v): - return ".".join(str(vi) for vi in v) - - -def get_software_citation(version, is_approved): - - # get data Software/Code citation for FloPy - citation = yaml.safe_load(file_paths["CITATION.cff"].read_text()) - - sb = "" - if not is_approved: - sb = " — release candidate" - # format author names - authors = [] - for author in citation["authors"]: - tauthor = author["family-names"] + ", " - gnames = author["given-names"].split() - if len(gnames) > 1: - for gname in gnames: - tauthor += gname[0] - if len(gname) > 1: - tauthor += "." - tauthor += " " - else: - tauthor += author["given-names"] - authors.append(tauthor.rstrip()) - - line = "[" - for ipos, tauthor in enumerate(authors): - if ipos > 0: - line += ", " - if ipos == len(authors) - 1: - line += "and " - # add formatted author name to line - line += tauthor - - # add the rest of the citation - line += ( - f", {now.year}, FloPy v{version}{sb}: " - f"U.S. Geological Survey Software Release, {now:%d %B %Y}, " - "https://doi.org/10.5066/F7BK19FH]" - "(https://doi.org/10.5066/F7BK19FH)" - ) - - return line - - -def update_version(): - fpth = file_paths["version.py"] - lines = fpth.read_text().rstrip().split("\n") - vmajor = 0 - vminor = 0 - vmicro = 0 - for idx, line in enumerate(lines): - t = line.split() - if "major =" in line: - vmajor = int(t[2]) - elif "minor =" in line: - vminor = int(t[2]) - elif "micro =" in line: - vmicro = int(t[2]) - - content = dedent( - f"""\ - # {pak} version file automatically created using...{Path(__file__).name} - # created on...{now:%B %d, %Y %H:%M:%S} - - major = {vmajor} - minor = {vminor} - micro = {vmicro} - __version__ = f"{{major}}.{{minor}}.{{micro}}" - """ - ) - fpth.write_text(content) - - print("Successfully updated version.py") - - # update README.md with new version information - update_readme_markdown(vmajor, vminor, vmicro) - - # update CITATION.cff with new version information - update_citation_cff(vmajor, vminor, vmicro) - - # update notebook_examples.md - update_notebook_examples_markdown() - - # update code.json - update_codejson(vmajor, vminor, vmicro) - - # update PyPI_release.md - update_PyPI_release(vmajor, vminor, vmicro) - - -def update_codejson(vmajor, vminor, vmicro): - # define json filename - json_fname = file_paths["code.json"] - - # get branch - branch = get_branch() - - # create version - version = get_tag(vmajor, vminor, vmicro) - - # load and modify json file - data = json.loads(json_fname.read_text()) - - # modify the json file data - data[0]["date"]["metadataLastUpdated"] = now.strftime("%Y-%m-%d") - if branch.lower().startswith("release") or "master" in branch.lower(): - data[0]["version"] = version - data[0]["status"] = "Production" - else: - data[0]["version"] = version - data[0]["status"] = "Release Candidate" - - # rewrite the json file - with open(json_fname, "w") as f: - json.dump(data, f, indent=4) - f.write("\n") - - return - - -def update_readme_markdown(vmajor, vminor, vmicro): - # create disclaimer text - is_approved, disclaimer = get_disclaimer() - - # define branch - if is_approved: - branch = "master" - else: - branch = "develop" - - # create version - version = get_tag(vmajor, vminor, vmicro) - - # read README.md into memory - fpth = file_paths["README.md"] - lines = fpth.read_text().rstrip().split("\n") - - # rewrite README.md - terminate = False - f = open(fpth, "w") - for line in lines: - if "### Version " in line: - line = f"### Version {version}" - if not is_approved: - line += " — release candidate" - elif "[flopy continuous integration]" in line: - line = ( - "[![flopy continuous integration](https://github.com/" - "modflowpy/flopy/actions/workflows/commit.yml/badge.svg?" - "branch={})](https://github.com/modflowpy/flopy/actions/" - "workflows/commit.yml)".format(branch) - ) - elif "[Read the Docs]" in line: - line = ( - "[![Read the Docs](https://github.com/modflowpy/flopy/" - "actions/workflows/rtd.yml/badge.svg?branch={})]" - "(https://github.com/modflowpy/flopy/actions/" - "workflows/rtd.yml)".format(branch) - ) - elif "[Coverage Status]" in line: - line = ( - "[![Coverage Status](https://coveralls.io/repos/github/" - "modflowpy/flopy/badge.svg?branch={0})]" - "(https://coveralls.io/github/modflowpy/" - "flopy?branch={0})".format(branch) - ) - elif "[Binder]" in line: - # [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/modflowpy/flopy.git/develop) - line = ( - "[![Binder](https://mybinder.org/badge_logo.svg)]" - "(https://mybinder.org/v2/gh/modflowpy/flopy.git/" - "{})".format(branch) - ) - elif "doi.org/10.5066/F7BK19FH" in line: - line = get_software_citation(version, is_approved) - elif "Disclaimer" in line: - line = disclaimer - terminate = True - f.write(f"{line}\n") - if terminate: - break - - f.close() - - # write disclaimer markdown file - file_paths["DISCLAIMER.md"].write_text(disclaimer) - - return - - -def update_citation_cff(vmajor, vminor, vmicro): - # read CITATION.cff to modify - fpth = file_paths["CITATION.cff"] - citation = yaml.safe_load(fpth.read_text()) - - # create version - version = get_tag(vmajor, vminor, vmicro) - - # update version and date-released - citation["version"] = version - citation["date-released"] = now.strftime("%Y-%m-%d") - - # write CITATION.cff - with open(fpth, "w") as f: - yaml.safe_dump( - citation, - f, - allow_unicode=True, - default_flow_style=False, - sort_keys=False, - ) - - return - - -def update_notebook_examples_markdown(): - # create disclaimer text - is_approved, disclaimer = get_disclaimer() - - # define branch - if is_approved: - branch = "master" - else: - branch = "develop" - - # read notebook_examples.md into memory - fpth = file_paths["notebook_examples.md"] - lines = fpth.read_text().rstrip().split("\n") - - # rewrite notebook_examples.md - f = open(fpth, "w") - for line in lines: - if "[Binder]" in line: - # [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/modflowpy/flopy.git/develop) - line = ( - "[![Binder](https://mybinder.org/badge_logo.svg)]" - "(https://mybinder.org/v2/gh/modflowpy/flopy.git/" - "{})".format(branch) - ) - f.write(f"{line}\n") - f.close() - - -def update_PyPI_release(vmajor, vminor, vmicro): - # create disclaimer text - is_approved, disclaimer = get_disclaimer() - - # create version - version = get_tag(vmajor, vminor, vmicro) - - # read PyPI_release.md into memory - fpth = file_paths["PyPI_release.md"] - lines = fpth.read_text().rstrip().split("\n") - - # rewrite PyPI_release.md - terminate = False - f = open(fpth, "w") - for line in lines: - if "doi.org/10.5066/F7BK19FH" in line: - line = get_software_citation(version, is_approved) - elif "Disclaimer" in line: - line = disclaimer - terminate = True - f.write(f"{line}\n") - if terminate: - break - - f.close() - - return - - -if __name__ == "__main__": - update_version() - get_software_citation("3.1.1", True) diff --git a/scripts/update-version_changes.py b/scripts/update-version_changes.py deleted file mode 100644 index a4df2fd6b0..0000000000 --- a/scripts/update-version_changes.py +++ /dev/null @@ -1,247 +0,0 @@ -import os -import sys -from subprocess import PIPE, STDOUT, Popen - -PY3 = sys.version_info[0] >= 3 - - -def process_Popen(cmdlist, verbose=False): - """Generic function to initialize a Popen process. - - Parameters - ---------- - cmdlist : list - command list passed to Popen - - Returns - ------- - proc : Popen - Popen instance - - """ - process = Popen(cmdlist, stdout=PIPE, stderr=STDOUT) - stdout, stderr = process.communicate() - - if stdout: - if PY3: - stdout = stdout.decode() - if verbose: - print(stdout) - if stderr: - if PY3: - stderr = stderr.decode() - if verbose: - print(stderr) - - # catch non-zero return code - if process.returncode != 0: - errmsg = "{} failed\n".format( - " ".join(process.args) - ) + "\tstatus code {}\n".format(process.returncode) - raise ChildProcessError(errmsg) - - return stdout - - -def get_version(): - major = 0 - minor = 0 - micro = 0 - - # read existing version file - fpth = os.path.join("..", "flopy", "version.py") - f = open(fpth, "r") - lines = [line.rstrip("\n") for line in open(fpth, "r")] - for idx, line in enumerate(lines): - t = line.split() - if "major =" in line: - major = int(t[2]) - elif "minor =" in line: - minor = int(t[2]) - elif "micro =" in line: - micro = int(t[2]) - - f.close() - - return f"{major}.{minor}.{micro}" - - -def get_branch(): - branch = None - - # determine if branch defined on command line - for argv in sys.argv: - if "--master" in argv: - branch = "master" - elif "--develop" in argv.lower(): - branch = "develop" - - # use git to determine branch - if branch is None: - cmdlist = ("git", "status") - stdout = process_Popen(cmdlist) - for line in stdout.splitlines(): - if "On branch" in line: - branch = line.replace("On branch ", "").rstrip() - break - return branch - - -def get_last_tag_date(): - cmdlist = ( - "git", - "log", - "--tags", - "--no-walk", - "--date=iso-local", - "--pretty='%cd %D'", - ) - stdout = process_Popen(cmdlist) - line = stdout.splitlines()[0] - ipos = line.find("tag") - if ipos > -1: - tag_date = line[1:20] - tag = line[ipos + 4 :].split(",")[0].strip() - - return tag, tag_date - - -def get_hash_dict(branch): - tag, tag_date = get_last_tag_date() - - # get hash and - fmt = '--pretty="%H"' - since = f'--since="{tag_date}"' - hash_dict = {"fix": {}, "feat": {}} - cmdlist = ("git", "log", branch, fmt, since) - stdout = process_Popen(cmdlist) - - fix_dict = {} - feat_dict = {} - - fix_tags = ["fix", "bug"] - feat_tags = ["feat"] - # parse stdout - for line in stdout.splitlines(): - hash = line.split()[0].replace('"', "") - url = f"https://github.com/modflowpy/flopy/commit/{hash}" - fmt = '--pretty="%s."' - cmdlist = ("git", "log", fmt, "-n1", hash) - subject = process_Popen(cmdlist).strip().replace('"', "") - fmt = '--pretty="Committed by %aN on %cd."' - cmdlist = ("git", "log", "--date=short", fmt, "-n1", hash) - cdate = process_Popen(cmdlist).strip().replace('"', "") - ipos = subject.find(":") - key = None - if ipos > -1: - type = subject[0:ipos] - subject = subject.replace(f"{type}:", "").strip().capitalize() - for tag in fix_tags: - if type.lower().startswith(tag): - key = "fix" - type = key + type[3:] - break - if key is None: - for tag in feat_tags: - if type.lower().startswith(tag): - key = "feat" - break - else: - type = None - slower = subject.lower() - for tag in fix_tags: - if slower.startswith(tag): - key = "fix" - type = "fix()" - break - if key is None: - for tag in feat_tags: - if slower.startswith(tag): - key = "feat" - type = "feat()" - break - - if key is not None: - message = f"[{type}]({url}): " - message += f"{subject} {cdate}" - if key == "fix": - fix_dict[hash] = message - elif key == "feat": - feat_dict[hash] = message - - # add dictionaries to the hash dictionary - hash_dict["fix"] = fix_dict - hash_dict["feat"] = feat_dict - - return hash_dict - - -def create_md(hash_dict): - # get current version information - version = get_version() - tag = "### Version" - version_text = f"{tag} {version}" - # - - # read the lines in the existing version_changes.md - fpth = os.path.join("..", "docs", "version_changes.md") - with open(fpth) as f: - lines = f.read().splitlines() - - # rewrite the existing version_changes.md - f = open(fpth, "w") - - write_line = True - write_update = True - for line in lines: - if line.startswith(tag): - write_line = True - if version_text in line: - write_line = False - - # write the changes for the latest comment - if write_update: - write_update = False - f.write(f"{version_text}\n\n") - write_version_changes(f, hash_dict) - - if write_line: - f.write(f"{line}\n") - - f.close() - - -def write_version_changes(f, hash_dict): - # features - istart = True - for key, val in hash_dict["feat"].items(): - if istart: - istart = False - f.write("* New features:\n\n") - f.write(4 * " " + "* " + val + "\n") - if not istart: - f.write("\n\n") - - # bug fixes - istart = True - for key, val in hash_dict["fix"].items(): - if istart: - istart = False - f.write("* Bug fixes:\n\n") - f.write(4 * " " + "* " + val + "\n") - if not istart: - f.write("\n") - - return - - -def main(): - branch = get_branch() - hash_dict = get_hash_dict(branch) - - create_md(hash_dict) - return - - -if __name__ == "__main__": - main() diff --git a/scripts/update_version.py b/scripts/update_version.py new file mode 100644 index 0000000000..56fc143f0e --- /dev/null +++ b/scripts/update_version.py @@ -0,0 +1,425 @@ +import argparse +import json +import subprocess +import textwrap +import yaml +from datetime import datetime +from enum import Enum +from os import environ, PathLike +from pathlib import Path +from typing import NamedTuple + +from filelock import FileLock + +_project_name = "flopy" +_project_root_path = Path(__file__).parent.parent +_version_txt_path = _project_root_path / "version.txt" +_version_py_path = _project_root_path / "flopy" / "version.py" + +# file names and the path to the file relative to the repo root directory +file_paths_list = [ + _project_root_path / "CITATION.cff", + _project_root_path / "code.json", + _project_root_path / "README.md", + _project_root_path / "docs" / "notebook_examples.md", + _project_root_path / "docs" / "PyPI_release.md", + _project_root_path / "flopy" / "version.py", + _project_root_path / "flopy" / "DISCLAIMER.md", +] +file_paths = {pth.name: pth for pth in file_paths_list} # keys for each file + + +approved_disclaimer = """Disclaimer +---------- + +This software is provided "as is" and "as-available", and makes no +representations or warranties of any kind concerning the software, whether +express, implied, statutory, or other. This includes, without limitation, +warranties of title, merchantability, fitness for a particular purpose, +non-infringement, absence of latent or other defects, accuracy, or the +presence or absence of errors, whether or not known or discoverable. +""" + +preliminary_disclaimer = """Disclaimer +---------- + +This software is preliminary or provisional and is subject to revision. It is +being provided to meet the need for timely best science. This software is +provided "as is" and "as-available", and makes no representations or warranties +of any kind concerning the software, whether express, implied, statutory, or +other. This includes, without limitation, warranties of title, +merchantability, fitness for a particular purpose, non-infringement, absence +of latent or other defects, accuracy, or the presence or absence of errors, +whether or not known or discoverable. +""" + + +class Version(NamedTuple): + """Semantic version number""" + + major: int = 0 + minor: int = 0 + patch: int = 0 + + def __repr__(self): + return f"{self.major}.{self.minor}.{self.patch}" + + @classmethod + def from_string(cls, version: str) -> "Version": + t = version.split(".") + + vmajor = int(t[0]) + vminor = int(t[1]) + vpatch = int(t[2]) + + return cls(major=vmajor, minor=vminor, patch=vpatch) + + @classmethod + def from_file(cls, path: PathLike) -> "Version": + lines = [ + line.rstrip("\n") + for line in open(Path(path).expanduser().absolute(), "r") + ] + vmajor = vminor = vpatch = None + for line in lines: + line = line.strip() + if not any(line): + continue + t = line.split(".") + vmajor = int(t[0]) + vminor = int(t[1]) + vpatch = int(t[2]) + + assert ( + vmajor is not None and vminor is not None and vpatch is not None + ), "version string must follow semantic version format: major.minor.patch" + return cls(major=vmajor, minor=vminor, patch=vpatch) + + +class ReleaseType(Enum): + CANDIDATE = "Release Candidate" + APPROVED = "Production" + + +_initial_version = Version(0, 0, 1) +_current_version = Version.from_file(_version_txt_path) + + +def get_disclaimer(release_type: ReleaseType): + if release_type == ReleaseType.APPROVED: + return approved_disclaimer + else: + return preliminary_disclaimer + + +def get_branch(): + branch = None + error = ValueError("Coulnd't detect branch") + try: + # determine current branch + b = subprocess.Popen( + ("git", "status"), stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ).communicate()[0] + if isinstance(b, bytes): + b = b.decode("utf-8") + + # determine current branch + for line in b.splitlines(): + if "On branch" in line: + branch = line.replace("On branch ", "").rstrip() + if branch is None: + raise error + except: + branch = environ.get("GITHUB_REF_NAME", None) + + if branch is None: + raise error + else: + print(f"Detected branch: {branch}") + + return branch + + +def update_version_txt(version: Version): + with open(_version_txt_path, "w") as f: + f.write(str(version)) + print(f"Updated {_version_txt_path} to version {version}") + + +def update_version_py(release_type: ReleaseType, timestamp: datetime, version: Version): + with open(_version_py_path, "w") as f: + f.write( + f"# {_project_name} version file automatically created using {Path(__file__).name} on {timestamp.strftime('%B %d, %Y %H:%M:%S')}\n" + ) + f.write("\n") + f.write(f"major = {version.major}\n") + f.write(f"minor = {version.minor}\n") + f.write(f"micro = {version.patch}\n") + f.write("__version__ = '{}.{}.{}'.format(major, minor, micro)\n") + print(f"Updated {_version_py_path} to version {version}") + + +def get_software_citation(release_type: ReleaseType, timestamp: datetime, version: Version): + + # get data Software/Code citation for FloPy + citation = yaml.safe_load(file_paths["CITATION.cff"].read_text()) + + sb = "" + if release_type != ReleaseType.APPROVED: + sb = f" — {release_type.value.lower()}" + # format author names + authors = [] + for author in citation["authors"]: + tauthor = author["family-names"] + ", " + gnames = author["given-names"].split() + if len(gnames) > 1: + for gname in gnames: + tauthor += gname[0] + if len(gname) > 1: + tauthor += "." + tauthor += " " + else: + tauthor += author["given-names"] + authors.append(tauthor.rstrip()) + + line = "[" + for ipos, tauthor in enumerate(authors): + if ipos > 0: + line += ", " + if ipos == len(authors) - 1: + line += "and " + # add formatted author name to line + line += tauthor + + # add the rest of the citation + line += ( + f", {timestamp.year}, FloPy v{version}{sb}: " + f"U.S. Geological Survey Software Release, {timestamp:%d %B %Y}, " + "https://doi.org/10.5066/F7BK19FH]" + "(https://doi.org/10.5066/F7BK19FH)" + ) + + return line + + +def update_codejson(release_type: ReleaseType, timestamp: datetime, version: Version): + # define json filename + json_fname = file_paths["code.json"] + + # load and modify json file + data = json.loads(json_fname.read_text()) + + # modify the json file data + data[0]["date"]["metadataLastUpdated"] = timestamp.strftime("%Y-%m-%d") + data[0]["version"] = str(version) + data[0]["status"] = release_type.value + + # rewrite the json file + with open(json_fname, "w") as f: + json.dump(data, f, indent=4) + f.write("\n") + + print(f"Updated {json_fname} to version {version}") + + +def update_readme_markdown(release_type: ReleaseType, timestamp: datetime, version: Version): + # create disclaimer text + disclaimer = get_disclaimer(release_type) + + # read README.md into memory + fpth = file_paths["README.md"] + lines = fpth.read_text().rstrip().split("\n") + + # rewrite README.md + terminate = False + f = open(fpth, "w") + for line in lines: + if "### Version " in line: + line = f"### Version {version}" + if release_type != ReleaseType.APPROVED: + line += f" — {release_type.value.lower()}" + elif "[flopy continuous integration]" in line: + line = ( + "[![flopy continuous integration](https://github.com/" + "modflowpy/flopy/actions/workflows/commit.yml/badge.svg?" + "branch=develop)](https://github.com/modflowpy/flopy/actions/" + "workflows/commit.yml)" + ) + elif "[Read the Docs]" in line: + line = ( + "[![Read the Docs](https://github.com/modflowpy/flopy/" + "actions/workflows/rtd.yml/badge.svg?branch=develop)]" + "(https://github.com/modflowpy/flopy/actions/" + "workflows/rtd.yml)" + ) + elif "[Coverage Status]" in line: + line = ( + "[![Coverage Status](https://coveralls.io/repos/github/" + "modflowpy/flopy/badge.svg?branch=develop)]" + "(https://coveralls.io/github/modflowpy/" + "flopy?branch=develop)" + ) + elif "[Binder]" in line: + # [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/modflowpy/flopy.git/develop) + line = ( + "[![Binder](https://mybinder.org/badge_logo.svg)]" + "(https://mybinder.org/v2/gh/modflowpy/flopy.git/develop)" + ) + elif "doi.org/10.5066/F7BK19FH" in line: + line = get_software_citation(release_type, timestamp, version) + elif "Disclaimer" in line: + line = disclaimer + terminate = True + f.write(f"{line}\n") + if terminate: + break + + f.close() + print(f"Updated {fpth} to version {version}") + + # write disclaimer markdown file + file_paths["DISCLAIMER.md"].write_text(disclaimer) + print(f"Updated {file_paths['DISCLAIMER.md']} to version {version}") + + +def update_citation_cff(release_type: ReleaseType, timestamp: datetime, version: Version): + # read CITATION.cff to modify + fpth = file_paths["CITATION.cff"] + citation = yaml.safe_load(fpth.read_text()) + + # update version and date-released + citation["version"] = str(version) + citation["date-released"] = timestamp.strftime("%Y-%m-%d") + + # write CITATION.cff + with open(fpth, "w") as f: + yaml.safe_dump( + citation, + f, + allow_unicode=True, + default_flow_style=False, + sort_keys=False, + ) + + print(f"Updated {fpth} to version {version}") + + +def update_notebook_examples_markdown(release_type: ReleaseType, timestamp: datetime, version: Version): + # create disclaimer text + disclaimer = get_disclaimer(release_type) + + # read notebook_examples.md into memory + fpth = file_paths["notebook_examples.md"] + lines = fpth.read_text().rstrip().split("\n") + + # rewrite notebook_examples.md + f = open(fpth, "w") + for line in lines: + if "[Binder]" in line: + # [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/modflowpy/flopy.git/develop) + line = ( + "[![Binder](https://mybinder.org/badge_logo.svg)]" + "(https://mybinder.org/v2/gh/modflowpy/flopy.git/develop)" + ) + f.write(f"{line}\n") + f.close() + print(f"Updated {fpth} to version {version}") + + +def update_PyPI_release(release_type: ReleaseType, timestamp: datetime, version: Version): + # create disclaimer text + disclaimer = get_disclaimer(release_type) + + # read PyPI_release.md into memory + fpth = file_paths["PyPI_release.md"] + lines = fpth.read_text().rstrip().split("\n") + + # rewrite PyPI_release.md + terminate = False + f = open(fpth, "w") + for line in lines: + if "doi.org/10.5066/F7BK19FH" in line: + line = get_software_citation(release_type, timestamp, version) + elif "Disclaimer" in line: + line = disclaimer + terminate = True + f.write(f"{line}\n") + if terminate: + break + + f.close() + print(f"Updated {fpth} to version {version}") + + +def update_version(release_type: ReleaseType, timestamp: datetime = datetime.now(), version: Version = None): + lock_path = Path(_version_txt_path.name + ".lock") + try: + lock = FileLock(lock_path) + previous = Version.from_file(_version_txt_path) + version = ( + version + if version + else Version(previous.major, previous.minor, previous.patch) + ) + + with lock: + update_version_txt(version) + update_version_py(release_type, timestamp, version) + update_readme_markdown(release_type, timestamp, version) + update_citation_cff(release_type, timestamp, version) + update_notebook_examples_markdown(release_type, timestamp, version) + update_codejson(release_type, timestamp, version) + update_PyPI_release(release_type, timestamp, version) + finally: + try: + lock_path.unlink() + except: + pass + + +if __name__ == "__main__": + parser = argparse.ArgumentParser( + prog=f"Update {_project_name} version", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=textwrap.dedent( + """\ + Update version information stored in version.txt in the project root, + as well as several other files in the repository. If --version is not + provided, the version number will not be changed. A file lock is held + to synchronize file access. The version tag must comply with standard + '..' format conventions for semantic versioning. + """ + ), + ) + parser.add_argument( + "-v", + "--version", + required=False, + help="Specify the release version", + ) + parser.add_argument( + "-a", + "--approve", + required=False, + action="store_true", + help="Indicate release is approved (defaults to false for preliminary/development distributions)", + ) + parser.add_argument( + "-g", + "--get", + required=False, + action="store_true", + help="Just get the current version number, don't update anything (defaults to false)", + ) + args = parser.parse_args() + + if args.get: + print(Version.from_file(_project_root_path / "version.txt")) + else: + update_version( + release_type=ReleaseType.APPROVED if args.approve else ReleaseType.CANDIDATE, + timestamp=datetime.now(), + version=Version.from_string(args.version) + if args.version + else _current_version + ) diff --git a/setup.cfg b/setup.cfg index 17b9ab8ab8..ba35004718 100644 --- a/setup.cfg +++ b/setup.cfg @@ -64,6 +64,7 @@ test = pytest-benchmark pytest-cases pytest-cov + pytest-dotenv pytest-xdist optional = affine diff --git a/version.txt b/version.txt new file mode 100644 index 0000000000..0163af7e86 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +3.3.5 \ No newline at end of file