diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e72415c424..eba412d900 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -69,7 +69,7 @@ jobs: 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 + pytest -v --color=yes --durations=0 --benchmark-only --benchmark-json .benchmarks/${{ matrix.os }}_python${{ matrix.python-version }}.json --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -79,7 +79,7 @@ jobs: 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 + pytest -v --color=yes --durations=0 --benchmark-only --benchmark-json .benchmarks/${{ matrix.os }}_python${{ matrix.python-version }}.json --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 5e5163f5ce..dad0c098cf 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -131,7 +131,7 @@ jobs: - name: Smoke test working-directory: autotest - run: pytest -v -n=auto --smoke --cov=flopy --cov-report=xml --durations=0 --keep-failed=.failed + run: pytest -v -n=auto --smoke --color=yes --cov=flopy --cov-report=xml --durations=0 --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -226,7 +226,7 @@ jobs: if: runner.os != 'Windows' working-directory: ./autotest run: | - pytest -v -m="not example and not regression" -n=auto --cov=flopy --cov-append --cov-report=xml --durations=0 --keep-failed=.failed --dist loadfile + pytest -v -m="not example and not regression" -n=auto --color=yes --cov=flopy --cov-append --cov-report=xml --durations=0 --keep-failed=.failed --dist loadfile coverage report env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -236,7 +236,7 @@ jobs: shell: bash -l {0} working-directory: ./autotest run: | - pytest -v -m="not example and not regression" -n=auto --cov=flopy --cov-append --cov-report=xml --durations=0 --keep-failed=.failed --dist loadfile + pytest -v -m="not example and not regression" -n=auto --color=yes --cov=flopy --cov-append --cov-report=xml --durations=0 --keep-failed=.failed --dist loadfile coverage report env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index fe9b014b3b..e0b4fb061c 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -97,7 +97,7 @@ jobs: if: runner.os != 'Windows' working-directory: ./autotest run: | - pytest -v -m="example" -n=auto -s --durations=0 --keep-failed=.failed + pytest -v -m="example" -n=auto -s --color=yes --durations=0 --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -106,7 +106,7 @@ jobs: shell: bash -l {0} working-directory: ./autotest run: | - pytest -v -m="example" -n=auto -s --durations=0 --keep-failed=.failed + pytest -v -m="example" -n=auto -s --color=yes --durations=0 --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/mf6.yml b/.github/workflows/mf6.yml index 584e4e80ad..445eebf180 100644 --- a/.github/workflows/mf6.yml +++ b/.github/workflows/mf6.yml @@ -82,12 +82,12 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} run: | - pytest -v --durations=0 get_exes.py + pytest -v --color=yes --durations=0 get_exes.py - name: Run tests working-directory: modflow6/autotest run: | - pytest -v -n auto -k "test_gw" --durations=0 --cov=flopy --cov-report=xml + pytest -v --color=yes --cov=flopy --cov-report=xml --durations=0 -k "test_gw" -n auto - name: Print coverage report before upload working-directory: ./modflow6/autotest diff --git a/.github/workflows/optional.yml b/.github/workflows/optional.yml index ee29136542..c3081a7ab1 100644 --- a/.github/workflows/optional.yml +++ b/.github/workflows/optional.yml @@ -62,7 +62,7 @@ jobs: - name: Smoke test (${{ matrix.optdeps }}) working-directory: autotest - run: pytest -v -n=auto --smoke --cov=flopy --cov-report=xml --durations=0 --keep-failed=.failed + run: pytest -v -n=auto --smoke --color=yes --cov=flopy --cov-report=xml --durations=0 --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 972f1e1650..097ff9efa0 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -80,7 +80,7 @@ jobs: - name: Run regression tests if: runner.os != 'Windows' working-directory: ./autotest - run: pytest -v -m="regression" -n=auto --durations=0 --keep-failed=.failed + run: pytest -v -m="regression" -n=auto --color=yes --durations=0 --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -88,7 +88,7 @@ jobs: if: runner.os == 'Windows' shell: bash -l {0} working-directory: ./autotest - run: pytest -v -m="regression" -n=auto --durations=0 --keep-failed=.failed + run: pytest -v -m="regression" -n=auto --color=yes --durations=0 --keep-failed=.failed env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e130f3a337..bcd0af801d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,7 @@ jobs: - name: Run tests working-directory: autotest - run: pytest -v -m="not example and not regression" -n=auto --durations=0 --keep-failed=.failed --dist loadfile + run: pytest -v -m="not example and not regression" -n=auto --color=yes --durations=0 --keep-failed=.failed --dist loadfile env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rtd.yml b/.github/workflows/rtd.yml index b092e4b16e..76d4f1b43b 100644 --- a/.github/workflows/rtd.yml +++ b/.github/workflows/rtd.yml @@ -79,7 +79,7 @@ jobs: - name: Run tutorial and example notebooks working-directory: autotest - run: pytest -v -n auto test_notebooks.py + run: pytest -v -n auto --color=yes test_notebooks.py - name: Upload notebooks artifact for ReadtheDocs if: github.repository_owner == 'modflowpy' && github.event_name == 'push' && runner.os == 'Linux' diff --git a/autotest/test_model_splitter.py b/autotest/test_model_splitter.py index 921c29dc4a..e743399d91 100644 --- a/autotest/test_model_splitter.py +++ b/autotest/test_model_splitter.py @@ -1,9 +1,9 @@ import numpy as np -import flopy import pytest from autotest.conftest import get_example_data_path from modflow_devtools.markers import requires_exe, requires_pkg +import flopy from flopy.mf6 import MFSimulation from flopy.mf6.utils import Mf6Splitter @@ -260,11 +260,7 @@ def test_control_records(function_tmpdir): tdis = flopy.mf6.ModflowTdis( sim, nper=nper, - perioddata=( - (1., 1, 1.), - (1., 1, 1.), - (1., 1, 1.) - ) + perioddata=((1.0, 1, 1.0), (1.0, 1, 1.0), (1.0, 1, 1.0)), ) gwf = flopy.mf6.ModflowGwf(sim, save_flows=True) @@ -279,20 +275,20 @@ def test_control_records(function_tmpdir): delc=1, top=35, botm=[30, botm2], - idomain=1 + idomain=1, ) ic = flopy.mf6.ModflowGwfic(gwf, strt=32) npf = flopy.mf6.ModflowGwfnpf( gwf, k=[ - 1., + 1.0, { "data": np.ones((10, 10)) * 0.75, "filename": "k.l2.txt", "iprn": 1, - "factor": 1 - } + "factor": 1, + }, ], k33=[ np.ones((nrow, ncol)), @@ -301,41 +297,29 @@ def test_control_records(function_tmpdir): "filename": "k33.l2.bin", "iprn": 1, "factor": 1, - "binary": True - } - ] - + "binary": True, + }, + ], ) - wel_rec = [((0, 4, 5), -10), ] + wel_rec = [ + ((0, 4, 5), -10), + ] spd = { 0: wel_rec, - 1: { - "data": wel_rec, - "filename": "wel.1.txt" - }, - 2: { - "data": wel_rec, - "filename": "wel.2.bin", - "binary": True - } + 1: {"data": wel_rec, "filename": "wel.1.txt"}, + 2: {"data": wel_rec, "filename": "wel.2.bin", "binary": True}, } - wel = flopy.mf6.ModflowGwfwel( - gwf, - stress_period_data=spd - ) + wel = flopy.mf6.ModflowGwfwel(gwf, stress_period_data=spd) chd_rec = [] for cond, j in ((30, 0), (22, 9)): for i in range(10): chd_rec.append(((0, i, j), cond)) - chd = flopy.mf6.ModflowGwfchd( - gwf, - stress_period_data={0: chd_rec} - ) + chd = flopy.mf6.ModflowGwfchd(gwf, stress_period_data={0: chd_rec}) arr = np.zeros((10, 10), dtype=int) arr[0:5, :] = 1 @@ -354,14 +338,18 @@ def test_control_records(function_tmpdir): "External ascii files not being preserved for MFArray" ) - k33ls = ml1.npf.k33._data_storage.layer_storage.multi_dim_list + k33ls = ml1.npf.k33._data_storage.layer_storage.multi_dim_list if k33ls[1].data_storage_type.value != 3 or not k33ls[1].binary: raise AssertionError( "Binary file input not being preserved for MFArray" ) - spd_ls1 = ml1.wel.stress_period_data._data_storage[1].layer_storage.multi_dim_list[0] - spd_ls2 = ml1.wel.stress_period_data._data_storage[2].layer_storage.multi_dim_list[0] + spd_ls1 = ml1.wel.stress_period_data._data_storage[ + 1 + ].layer_storage.multi_dim_list[0] + spd_ls2 = ml1.wel.stress_period_data._data_storage[ + 2 + ].layer_storage.multi_dim_list[0] if spd_ls1.data_storage_type.value != 3 or spd_ls1.binary: raise AssertionError( @@ -372,5 +360,3 @@ def test_control_records(function_tmpdir): raise AssertionError( "External binary file input not being preseved for MFList" ) - - diff --git a/autotest/test_modflow.py b/autotest/test_modflow.py index d19a255d37..fd34810f00 100644 --- a/autotest/test_modflow.py +++ b/autotest/test_modflow.py @@ -7,8 +7,8 @@ import numpy as np import pytest from autotest.conftest import get_example_data_path -from modflow_devtools.misc import has_pkg from modflow_devtools.markers import excludes_platform, requires_exe +from modflow_devtools.misc import has_pkg from flopy.discretization import StructuredGrid from flopy.mf6 import MFSimulation