diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e651c8ec38..141c59d33f 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,6 +1,7 @@ name: FloPy benchmarks on: + push: schedule: - cron: '0 8 * * *' # run at 8 AM UTC (12 am PST) @@ -19,7 +20,7 @@ jobs: - python-version: '3.8.0' defaults: run: - shell: bash -l {0} + shell: bash timeout-minutes: 90 steps: @@ -37,9 +38,9 @@ jobs: - name: Install Python dependencies if: runner.os != 'Windows' run: | - python -m pip install --upgrade pip - pip3 install . - pip3 install ".[test, optional]" + pip install --upgrade pip + pip install . + pip install ".[test, optional]" - name: Setup Micromamba if: runner.os == 'Windows' @@ -54,16 +55,28 @@ jobs: - name: Install extra Python dependencies if: runner.os == 'Windows' + shell: bash -l {0} run: | - python -m pip install --upgrade pip - pip3 install https://github.com/modflowpy/pymake/zipball/master - pip3 install xmipy - pip3 install . + pip install --upgrade pip + pip install https://github.com/modflowpy/pymake/zipball/master + pip install xmipy + pip install . - name: Install Modflow executables uses: modflowpy/install-modflow-action@v1 - name: Run benchmarks + if: runner.os != 'Windows' + working-directory: ./autotest + run: | + mkdir -p .benchmarks + pytest -v --durations=0 --benchmark-only --benchmark-json .benchmarks/${{ matrix.os }}_python${{ matrix.python-version }}.json --keep-failed=.failed + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run benchmarks + if: runner.os == 'Windows' + shell: bash -l {0} working-directory: ./autotest run: | mkdir -p .benchmarks @@ -109,7 +122,7 @@ jobs: - name: Install Python dependencies run: | - python -m pip install --upgrade pip + pip install --upgrade pip pip install numpy pandas matplotlib seaborn - name: Download all artifacts diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index baa9e9773d..85751cf635 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -4,8 +4,8 @@ on: branches: - master - develop - - 'release*' - - 'ci-diagnose' + - release* + - ci-diagnose* pull_request: branches: - master @@ -31,7 +31,7 @@ jobs: - name: Install Python dependencies run: | - python -m pip install --upgrade pip + pip install --upgrade pip pip install build twine pip install . python -c "import flopy; print(f'{flopy.__version__}')" @@ -120,7 +120,7 @@ jobs: - name: Install Python dependencies run: | - python -m pip install --upgrade pip + pip install --upgrade pip pip install . pip install ".[test, optional]" @@ -157,7 +157,7 @@ jobs: - python-version: '3.8.0' defaults: run: - shell: bash -l {0} + shell: bash timeout-minutes: 45 steps: @@ -175,9 +175,9 @@ jobs: - name: Install Python dependencies if: runner.os != 'Windows' run: | - python -m pip install --upgrade pip - pip3 install . - pip3 install ".[test, optional]" + pip install --upgrade pip + pip install . + pip install ".[test, optional]" - name: Setup Micromamba if: runner.os == 'Windows' @@ -191,20 +191,33 @@ jobs: cache-env: true - name: Install Python dependencies + shell: bash -l {0} if: runner.os == 'Windows' run: | - python -m pip install --upgrade pip - pip3 install https://github.com/modflowpy/pymake/zipball/master - pip3 install xmipy - pip3 install . + pip install --upgrade pip + pip install https://github.com/modflowpy/pymake/zipball/master + pip install xmipy + pip install . - name: Install Modflow executables uses: modflowpy/install-modflow-action@v1 - name: Run tests + if: runner.os != 'Windows' + working-directory: ./autotest + run: | + pytest -v -m="not example and not regression" -n=auto --cov=flopy --cov-report=xml --durations=0 --keep-failed=.failed + coverage report + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run tests + if: runner.os == 'Windows' + shell: bash -l {0} working-directory: ./autotest run: | pytest -v -m="not example and not regression" -n=auto --cov=flopy --cov-report=xml --durations=0 --keep-failed=.failed + coverage report env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -216,11 +229,6 @@ jobs: path: | ./autotest/.failed/** - - name: Print coverage - working-directory: ./autotest - run: | - coverage report - - name: Upload coverage if: github.repository_owner == 'modflowpy' && (github.event_name == 'push' || github.event_name == 'pull_request') diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 30eae519fd..b6fa89a503 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -1,6 +1,7 @@ name: FloPy example script & notebook tests on: + push: schedule: - cron: '0 8 * * *' # run at 8 AM UTC (12 am PST) @@ -19,7 +20,7 @@ jobs: - python-version: '3.8.0' defaults: run: - shell: bash -l {0} + shell: bash timeout-minutes: 90 steps: - name: Checkout repo @@ -36,9 +37,9 @@ jobs: - name: Install Python dependencies if: runner.os != 'Windows' run: | - python -m pip install --upgrade pip - pip3 install . - pip3 install ".[test, optional]" + pip install --upgrade pip + pip install . + pip install ".[test, optional]" - name: Setup Micromamba if: runner.os == 'Windows' @@ -53,16 +54,27 @@ jobs: - name: Install extra Python dependencies if: runner.os == 'Windows' + shell: bash -l {0} run: | - python -m pip install --upgrade pip - pip3 install https://github.com/modflowpy/pymake/zipball/master - pip3 install xmipy - pip3 install . + pip install --upgrade pip + pip install https://github.com/modflowpy/pymake/zipball/master + pip install xmipy + pip install . - name: Install Modflow executables uses: modflowpy/install-modflow-action@v1 - name: Run example tests + if: runner.os != 'Windows' + working-directory: ./autotest + run: | + pytest -v -m="example" -n=auto --durations=0 --keep-failed=.failed + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run example tests + if: runner.os == 'Windows' + shell: bash -l {0} working-directory: ./autotest run: | pytest -v -m="example" -n=auto --durations=0 --keep-failed=.failed diff --git a/.github/workflows/mf6.yml b/.github/workflows/mf6.yml index aa55b5e04f..e2f0ca227e 100644 --- a/.github/workflows/mf6.yml +++ b/.github/workflows/mf6.yml @@ -7,9 +7,12 @@ on: branches: - master - develop - - 'release*' + - release* + - ci-diagnose* pull_request: - branches: [master, develop] + branches: + - master + - develop jobs: @@ -35,11 +38,11 @@ jobs: - name: Install Python dependencies run: | - python -m pip install --upgrade pip - pip3 install https://github.com/modflowpy/pymake/zipball/master - pip3 install https://github.com/Deltares/xmipy/zipball/develop - pip3 install https://github.com/MODFLOW-USGS/modflowapi/zipball/develop - pip3 install .[test,optional] + pip install --upgrade pip + pip install https://github.com/modflowpy/pymake/zipball/master + pip install https://github.com/Deltares/xmipy/zipball/develop + pip install https://github.com/MODFLOW-USGS/modflowapi/zipball/develop + pip install .[test,optional] - name: Install gfortran uses: modflowpy/install-gfortran-action@v1 diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 3126b82881..7ebd83f02f 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -1,6 +1,7 @@ name: FloPy regression tests on: + push: schedule: - cron: '0 8 * * *' # run at 8 AM UTC (12 am PST) @@ -19,7 +20,7 @@ jobs: - python-version: '3.8.0' defaults: run: - shell: bash -l {0} + shell: bash timeout-minutes: 90 steps: - name: Checkout repo @@ -36,9 +37,9 @@ jobs: - name: Install Python dependencies if: runner.os != 'Windows' run: | - python -m pip install --upgrade pip - pip3 install . - pip3 install ".[test, optional]" + pip install --upgrade pip + pip install . + pip install ".[test, optional]" - name: Setup Micromamba if: runner.os == 'Windows' @@ -53,16 +54,27 @@ jobs: - name: Install extra Python dependencies if: runner.os == 'Windows' + shell: bash -l {0} run: | - python -m pip install --upgrade pip - pip3 install https://github.com/modflowpy/pymake/zipball/master - pip3 install xmipy - pip3 install . + pip install --upgrade pip + pip install https://github.com/modflowpy/pymake/zipball/master + pip install xmipy + pip install . - name: Install Modflow executables uses: modflowpy/install-modflow-action@v1 - name: Run regression tests + if: runner.os != 'Windows' + working-directory: ./autotest + run: | + pytest -v -m="regression" -n=auto --durations=0 --keep-failed=.failed + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run regression tests + if: runner.os == 'Windows' + shell: bash -l {0} working-directory: ./autotest run: | pytest -v -m="regression" -n=auto --durations=0 --keep-failed=.failed diff --git a/.github/workflows/rtd.yml b/.github/workflows/rtd.yml index 205e1970ce..b26f5be3de 100644 --- a/.github/workflows/rtd.yml +++ b/.github/workflows/rtd.yml @@ -5,10 +5,12 @@ on: branches: - master - develop - - 'release*' - - 'ci-pytest' + - release* + - ci-diagnose* pull_request: - branches: [master, develop] + branches: + - master + - develop jobs: @@ -41,7 +43,7 @@ jobs: - name: Upgrade pip run: | - python -m pip install --upgrade pip + pip install --upgrade pip - name: Install prerequisites run: | diff --git a/flopy/mbase.py b/flopy/mbase.py index 0e3743c86d..655ddd4afe 100644 --- a/flopy/mbase.py +++ b/flopy/mbase.py @@ -480,7 +480,7 @@ def hdry(self): return self.get_package("BCF6").hdry if self.get_package("UPW") is not None: return self.get_package("UPW").hdry - return None + return -1e30 @property def hnoflo(self): @@ -488,7 +488,7 @@ def hnoflo(self): bas6 = self.get_package("BAS6") return bas6.hnoflo except AttributeError: - return None + return 1e30 @property def laycbd(self): diff --git a/flopy/plot/crosssection.py b/flopy/plot/crosssection.py index 36af8baeb0..1bc18fbe63 100644 --- a/flopy/plot/crosssection.py +++ b/flopy/plot/crosssection.py @@ -258,7 +258,7 @@ def __init__( self._polygons = {} if model is None: - self._masked_values = [1e30, -1e-30] + self._masked_values = [1e30, -1e30] else: self._masked_values = [model.hnoflo, model.hdry] diff --git a/flopy/plot/map.py b/flopy/plot/map.py index ed7c4afd9b..9d16d51b9c 100644 --- a/flopy/plot/map.py +++ b/flopy/plot/map.py @@ -70,7 +70,7 @@ def __init__( self._extent = None if model is None: - self._masked_values = [1e30, -1e-30] + self._masked_values = [1e30, -1e30] else: self._masked_values = [model.hnoflo, model.hdry]