From db3cbf46418194584f3a3bab6b72bafc618b4f3f Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 15:29:54 +1300 Subject: [PATCH 01/46] First attempt at hacking in GitHub Actions --- .github/workflows/ci.yml | 115 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..53c063437 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,115 @@ +name: pyemu continuous integration + +on: + schedule: + - cron: '0 8 * * *' # run at 8 AM UTC (12 am PST) + push: + pull_request: + +jobs: + pyemuCI: + name: autotests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.8, 3.7, 3.6, 2.7] + run-type: [std] + test-pth: [""] + nclude: + - os: ubuntu-latest + python-version: 3.8 + run-type: nb + test-path: autotest_notebooks.py + + steps: + # check out repo + - name: Checkout pyemu repo + uses: actions/checkout@v2.3.4 # must be a better way to checkout current version.... + + - name: Cache Miniconda + uses: actions/cache@v2.1.0 + env: + # Increase this value to reset cache if environment.yml has changed + CACHE_NUMBER: 0 + with: + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }} + + # Standard python fails on windows without GDAL installation + # Using custom bash shell ("shell: bash -l {0}") with Miniconda + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2.0.0 + with: + python-version: ${{ matrix.python-version }} + mamba-version: "*" + channels: conda-forge + auto-update-conda: true + activate-environment: pyemu + use-only-tar-bz2: true + + - name: Add jupyter and jupytext to notebooks run + if: matrix.run-type == 'nb' + shell: bash -l {0} + run: | + mamba install --name pyemu jupyter jupytext + + - name: Add packages to pyemu environment using mamba or conda + shell: bash -l {0} + run: | + if [ "$RUNNER_OS" == "Windows" ]; then + conda env update --name pyemu --file etc/environment.yml + else + mamba env update --name pyemu --file etc/environment.yml + fi + + - name: Prep for exe install + shell: bash -l {0} + run: | + if [[ ! -d "$HOME/.local/bin" ]]; then + mkdir "$HOME/.local/bin"; + fi + export PATH="$HOME/.local/bin:$PATH" + ln -fs /usr/bin/gfortran-6 "$HOME/.local/bin/gfortran" && gfortran --version + ls -l /usr/bin/gfortran-6 + ln -fs /usr/bin/gcc-6 "$HOME/.local/bin/gcc" && gcc --version + ls -l /usr/bin/gcc-6 + ln -fs /usr/bin/g++-6 "$HOME/.local/bin/g++" && g++ --version + ls -l /usr/bin/g++-6 + export CXX="g++" + git clone -b develop --depth 1 https://github.com/usgs/pestpp + cd pestpp/src + bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install + cd ../../ + # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh + # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda + # might be able to get away without this line? export PATH="$HOME/miniconda/bin:$PATH" + - export PATH="$HOME/pestpp/bin/linux:$PATH" + # might be able to get away without this line? conda update --yes conda + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + + - name: Install pymake and flopy + shell: bash -l {0} + run: | + pip install https://github.com/modflowpy/pymake/zipball/master + python setup.py install + git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git + cd flopy + python setup.py install + cd .. + + - name: Add executables directory to path + shell: bash + run: | + echo "$HOME/pestpp/bin/linux" >> $GITHUB_PATH + + - name: Run nosetests + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer -w ./autotest --with-coverage --cover-package=pyemu ${{ matrix.test-path }} + + + + From 1fb4e165cecd2cdfb43abc1f4ba3c188f9f15f09 Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 15:38:23 +1300 Subject: [PATCH 02/46] env.yml req. --- etc/environment.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 etc/environment.yml diff --git a/etc/environment.yml b/etc/environment.yml new file mode 100644 index 000000000..10fdac6d7 --- /dev/null +++ b/etc/environment.yml @@ -0,0 +1,9 @@ +name: pyemu +channels: + - defaults +dependencies: + - numpy + - pandas + - pyshp + - nose-timer + - nbsphinx \ No newline at end of file From c28b86b779c56e32597ec4483e53be8919dbd628 Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 17:26:39 +1300 Subject: [PATCH 03/46] Working in cmake for pestpp exes --- .github/workflows/ci.yml | 50 +++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53c063437..49dd73ea9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: steps: # check out repo - name: Checkout pyemu repo - uses: actions/checkout@v2.3.4 # must be a better way to checkout current version.... + uses: actions/checkout@v2.3.4 - name: Cache Miniconda uses: actions/cache@v2.1.0 @@ -36,6 +36,9 @@ jobs: with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }} + + # - name: Get specific version CMake, v3.19 + # uses: lukka/get-cmake@v3.19 # Standard python fails on windows without GDAL installation # Using custom bash shell ("shell: bash -l {0}") with Miniconda @@ -70,31 +73,35 @@ jobs: if [[ ! -d "$HOME/.local/bin" ]]; then mkdir "$HOME/.local/bin"; fi - export PATH="$HOME/.local/bin:$PATH" - ln -fs /usr/bin/gfortran-6 "$HOME/.local/bin/gfortran" && gfortran --version - ls -l /usr/bin/gfortran-6 - ln -fs /usr/bin/gcc-6 "$HOME/.local/bin/gcc" && gcc --version - ls -l /usr/bin/gcc-6 - ln -fs /usr/bin/g++-6 "$HOME/.local/bin/g++" && g++ --version - ls -l /usr/bin/g++-6 - export CXX="g++" + # export PATH="$HOME/.local/bin:$PATH" + # ln -fs /usr/bin/gfortran-6 "$HOME/.local/bin/gfortran" && gfortran --version + # ls -l /usr/bin/gfortran-6 + # ln -fs /usr/bin/gcc-6 "$HOME/.local/bin/gcc" && gcc --version + # ls -l /usr/bin/gcc-6 + # ln -fs /usr/bin/g++-6 "$HOME/.local/bin/g++" && g++ --version + # ls -l /usr/bin/g++-6 + # export CXX="g++" git clone -b develop --depth 1 https://github.com/usgs/pestpp - cd pestpp/src - bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install + cd pestpp + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 + # cd pestpp/src + # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd ../../ # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda # might be able to get away without this line? export PATH="$HOME/miniconda/bin:$PATH" - - export PATH="$HOME/pestpp/bin/linux:$PATH" + # export PATH="$HOME/pestpp/bin/linux:$PATH" # might be able to get away without this line? conda update --yes conda - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" + # - "export DISPLAY=:99.0" + # - "sh -e /etc/init.d/xvfb start" - name: Install pymake and flopy shell: bash -l {0} run: | - pip install https://github.com/modflowpy/pymake/zipball/master - python setup.py install + # pip install https://github.com/modflowpy/pymake/zipball/master + # python setup.py install git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git cd flopy python setup.py install @@ -103,13 +110,18 @@ jobs: - name: Add executables directory to path shell: bash run: | - echo "$HOME/pestpp/bin/linux" >> $GITHUB_PATH + echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Run nosetests shell: bash -l {0} run: | - nosetests -v --with-id --nocapture --with-timer -w ./autotest --with-coverage --cover-package=pyemu ${{ matrix.test-path }} - + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest ${{ matrix.test-path }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.15 + with: + file: ./coverage.xml From 440e07c9592fdc9d69ea5279d363293d4b9658d0 Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 17:42:49 +1300 Subject: [PATCH 04/46] python 3.6+ and cp pestpp exe --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49dd73ea9..95bcb788d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.7, 3.6, 2.7] + python-version: [3.8, 3.7, 3.6] run-type: [std] test-pth: [""] nclude: @@ -67,7 +67,7 @@ jobs: mamba env update --name pyemu --file etc/environment.yml fi - - name: Prep for exe install + - name: PESTPP exe install shell: bash -l {0} run: | if [[ ! -d "$HOME/.local/bin" ]]; then @@ -88,7 +88,9 @@ jobs: make -j2 # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install - cd ../../ + cd .. + cp -v bin/* $HOME/.local/bin/* + cd .. # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda # might be able to get away without this line? export PATH="$HOME/miniconda/bin:$PATH" From 711f731c914c7f8258f2e387122c1e25c75518fb Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 17:54:43 +1300 Subject: [PATCH 05/46] cp typo fix --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95bcb788d..461dd6a6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,7 @@ jobs: # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd .. - cp -v bin/* $HOME/.local/bin/* + cp bin/* $HOME/.local/bin/* cd .. # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda @@ -99,15 +99,15 @@ jobs: # - "export DISPLAY=:99.0" # - "sh -e /etc/init.d/xvfb start" - - name: Install pymake and flopy + - name: Install Flopy & pyemu? shell: bash -l {0} run: | - # pip install https://github.com/modflowpy/pymake/zipball/master - # python setup.py install git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git cd flopy python setup.py install cd .. + pip install https://github.com/modflowpy/pymake/zipball/master + python setup.py install - name: Add executables directory to path shell: bash From 07e5b01b41dc498e89a554c84e146b36b3e4a855 Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 18:06:28 +1300 Subject: [PATCH 06/46] idiot forgot how to bash --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 461dd6a6a..62c4d4d08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,7 @@ jobs: # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd .. - cp bin/* $HOME/.local/bin/* + cp bin/. $HOME/.local/bin/. cd .. # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda From 04d0056eca566d57fc977c6a29d2b79e4227e26c Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 18:42:34 +1300 Subject: [PATCH 07/46] trying to get pestpp bins into right place --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62c4d4d08..7e821597f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,7 @@ jobs: # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd .. - cp bin/. $HOME/.local/bin/. + find bin -maxdepth 1 -type f -exec cp {} $HOME/.local/bin/. \; cd .. # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda From 387afb265d05b7d0ed227955ce2c5b91b993363c Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 22:22:09 +1300 Subject: [PATCH 08/46] trying to specify tests --- .github/workflows/ci.yml | 5 ++++- README.md | 2 ++ etc/environment.yml | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e821597f..4737710dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,10 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.8, 3.7, 3.6] run-type: [std] - test-pth: [""] + test-pth: ["pst_tests.py", "utils_tests.py", "mat_tests.py", + "en_tests.py", "la_tests.py", "pst_from_tests.py", + "da_tests.py", "moouu_tests.py", "full_meal_deal_tests.py", + "plot_tests.py", "pst_tests_2.py"] nclude: - os: ubuntu-latest python-version: 3.8 diff --git a/README.md b/README.md index 2b328ca5c..f09386925 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,13 @@ pyEMU python modules for model-independent FOSM (first-order, second-moment) (a.k.a linear-based, a.k.a. Bayes linear) uncertainty analyses and data-worth analyses, non-linear uncertainty analyses and interfacing with PEST and PEST++. pyEMU also has a pure python (pandas and numpy) implementation of ordinary kriging for geostatistical interpolation and support for generating high-dimensional PEST(++) model interfaces, including support for (very) high-dimensional ensemble generation and handling Master branch: +![GA CI Status](https://github.com/pypest/pyemu.svg?branch=master)] [![Travis Status](https://travis-ci.org/pypest/pyemu.svg?branch=master)](https://travis-ci.org/pypest/pyemu) [![Appveyor Status](https://ci.appveyor.com/api/projects/status/github/pypest/pyemu?branch=master&svg=true)](https://ci.appveyor.com/project/jtwhite79/pyemu) [![Coverage Status](https://coveralls.io/repos/github/pypest/pyemu/badge.svg?branch=master)](https://coveralls.io/github/pypest/pyemu?branch=master) Develop branch: +![GA CI Status](https://github.com/pypest/pyemu.svg?branch=develop)] [![Travis Status](https://travis-ci.org/pypest/pyemu.svg?branch=develop)](https://travis-ci.org/pypest/pyemu) [![Appveyor Status](https://ci.appveyor.com/api/projects/status/github/pypest/pyemu?branch=develop&svg=true)](https://ci.appveyor.com/project/jtwhite79/pyemu) [![Coverage Status](https://coveralls.io/repos/github/pypest/pyemu/badge.svg?branch=develop)](https://coveralls.io/github/pypest/pyemu?branch=develop) diff --git a/etc/environment.yml b/etc/environment.yml index 10fdac6d7..7d6c833a3 100644 --- a/etc/environment.yml +++ b/etc/environment.yml @@ -6,4 +6,5 @@ dependencies: - pandas - pyshp - nose-timer - - nbsphinx \ No newline at end of file + - nbsphinx + - matplotlib \ No newline at end of file From 94c565930d0f242c456a0d86f2f34e5295fb674e Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 23:03:51 +1300 Subject: [PATCH 09/46] testing tests in series --- .github/workflows/ci.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4737710dd..297e5e51b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,12 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.8, 3.7, 3.6] run-type: [std] - test-pth: ["pst_tests.py", "utils_tests.py", "mat_tests.py", - "en_tests.py", "la_tests.py", "pst_from_tests.py", - "da_tests.py", "moouu_tests.py", "full_meal_deal_tests.py", - "plot_tests.py", "pst_tests_2.py"] - nclude: - - os: ubuntu-latest - python-version: 3.8 - run-type: nb - test-path: autotest_notebooks.py + test-pth: [""] + # include: + #- os: ubuntu-latest + # python-version: 3.8 + # run-type: nb + # test-path: autotest_notebooks.py steps: # check out repo @@ -117,12 +114,13 @@ jobs: run: | echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Run nosetests + - name: "pst tests" + env: TEST_SCRIPT="pst_tests.py" shell: bash -l {0} run: | nosetests -v --with-id --nocapture --with-timer \ --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest ${{ matrix.test-path }} + --cover-xml-file=../coverage.xml -w ./autotest ${{ env.TEST_SCRIPT }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.15 From e55b3031aefbc38a42f23e2e2ce6db64bafe868d Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 23:09:27 +1300 Subject: [PATCH 10/46] more testing tests in series --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 297e5e51b..92bcb0718 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,12 +115,11 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: "pst tests" - env: TEST_SCRIPT="pst_tests.py" shell: bash -l {0} run: | nosetests -v --with-id --nocapture --with-timer \ --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest ${{ env.TEST_SCRIPT }} + --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.15 From 657d8e66a206b6f6dae54718c659244e47e67fe9 Mon Sep 17 00:00:00 2001 From: Brioch Date: Mon, 30 Nov 2020 23:33:29 +1300 Subject: [PATCH 11/46] Trying all tests in series --- .github/workflows/ci.yml | 89 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92bcb0718..8ff2617c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,11 @@ jobs: python-version: [3.8, 3.7, 3.6] run-type: [std] test-pth: [""] - # include: - #- os: ubuntu-latest - # python-version: 3.8 - # run-type: nb - # test-path: autotest_notebooks.py + include: + - os: ubuntu-latest + python-version: 3.8 + run-type: nb + test-path: autotest_notebooks.py steps: # check out repo @@ -89,6 +89,7 @@ jobs: # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd .. + # do we also need to cp to os specific within .local/bin/? probs... find bin -maxdepth 1 -type f -exec cp {} $HOME/.local/bin/. \; cd .. # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh @@ -121,6 +122,84 @@ jobs: --with-coverage --cover-package=pyemu --cover-xml \ --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py + - name: "utils tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest utils_tests.py + + - name: "mat tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest mat_tests.py + + - name: "en tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest en_tests.py + + - name: "la tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest la_tests.py + + - name: "PstFrom tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest pst_from_tests.py + + - name: "da tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest da_tests.py + + - name: "moouu tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest moouu_tests.py + + - name: "full meal deal tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest full_meal_deal_tests.py + + - name: "plot tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest plot_tests.py + + - name: "pst tests 2" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py + + - name: "notebook tests" + if: matrix.run-type == 'nb' + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest autotest_notebooks.py + - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.15 with: From a23224b7c12bb323ed73a8b089614bb2b3291ba3 Mon Sep 17 00:00:00 2001 From: Brioch Hemmings Date: Tue, 1 Dec 2020 07:41:11 +1300 Subject: [PATCH 12/46] Update ci.yml trying windows mkdir fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ff2617c0..fe99b5a4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: shell: bash -l {0} run: | if [[ ! -d "$HOME/.local/bin" ]]; then - mkdir "$HOME/.local/bin"; + mkdir -p "$HOME/.local/bin"; fi # export PATH="$HOME/.local/bin:$PATH" # ln -fs /usr/bin/gfortran-6 "$HOME/.local/bin/gfortran" && gfortran --version From 597c2eacebcdc025e348f46156f3a9e9332df495 Mon Sep 17 00:00:00 2001 From: Brioch Hemmings Date: Tue, 1 Dec 2020 07:55:35 +1300 Subject: [PATCH 13/46] Update ci.yml with ninja? --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe99b5a4a..d11c1c9d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,8 +84,8 @@ jobs: git clone -b develop --depth 1 https://github.com/usgs/pestpp cd pestpp mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j2 + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. + ninja # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd .. From 2f13d020e6610ed177f3a83ee766c91f1607936e Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 10:02:09 +1300 Subject: [PATCH 14/46] update ci.yml xplatform build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ff2617c0..fe99b5a4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: shell: bash -l {0} run: | if [[ ! -d "$HOME/.local/bin" ]]; then - mkdir "$HOME/.local/bin"; + mkdir -p "$HOME/.local/bin"; fi # export PATH="$HOME/.local/bin:$PATH" # ln -fs /usr/bin/gfortran-6 "$HOME/.local/bin/gfortran" && gfortran --version From b5342f1e5bf07f8e7fc5a373247451e96b5743d6 Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 10:12:27 +1300 Subject: [PATCH 15/46] update ci.yml more xplatform --- .github/workflows/ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d11c1c9d1..e37de2a21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,13 @@ jobs: test-path: autotest_notebooks.py steps: + - name: Setup Ninja + if: ${{ martix.os }} == "windows-latest" + uses: ashutoshvarma/setup-ninja@master + with: + # ninja version to download. Default: 1.10.0 + version: 1.10.0 + # check out repo - name: Checkout pyemu repo uses: actions/checkout@v2.3.4 @@ -84,8 +91,12 @@ jobs: git clone -b develop --depth 1 https://github.com/usgs/pestpp cd pestpp mkdir build && cd build - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. - ninja + if [ "$RUNNER_OS" == "Windows" ]; then + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. + ninja + else + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j2 # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd .. From b141e7ba6f83775f6c331308c4a8b9d6cc2a3eaa Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 10:14:31 +1300 Subject: [PATCH 16/46] fix typo in ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e37de2a21..593f786ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Setup Ninja - if: ${{ martix.os }} == "windows-latest" + if: ${{ matrix.os }} == "windows-latest" uses: ashutoshvarma/setup-ninja@master with: # ninja version to download. Default: 1.10.0 From 96fc76dccfb82f0ee78e2f9fcceed27a4fef7f3b Mon Sep 17 00:00:00 2001 From: Brioch Hemmings Date: Tue, 1 Dec 2020 15:34:31 +1300 Subject: [PATCH 17/46] Update ci.yml more ninja trial and error --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 593f786ea..b85ef8c4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,8 +25,8 @@ jobs: steps: - name: Setup Ninja - if: ${{ matrix.os }} == "windows-latest" - uses: ashutoshvarma/setup-ninja@master + if: ${{ runner.os }} == "Windows" + uses: seanmiddleditch/gha-setup-ninja with: # ninja version to download. Default: 1.10.0 version: 1.10.0 From bb4f64e82bf77f0ddfaa24cfc928134aeeb9d81b Mon Sep 17 00:00:00 2001 From: Brioch Hemmings Date: Tue, 1 Dec 2020 15:36:19 +1300 Subject: [PATCH 18/46] Update ci.yml and more --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b85ef8c4e..18cfe3186 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Setup Ninja if: ${{ runner.os }} == "Windows" - uses: seanmiddleditch/gha-setup-ninja + uses: seanmiddleditch/gha-setup-ninja@master with: # ninja version to download. Default: 1.10.0 version: 1.10.0 From c633ba31b19b65724bd040b2b15d2060d96e0abf Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 16:15:31 +1300 Subject: [PATCH 19/46] urgh syntax --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18cfe3186..c7ce6ec11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,12 +91,13 @@ jobs: git clone -b develop --depth 1 https://github.com/usgs/pestpp cd pestpp mkdir build && cd build - if [ "$RUNNER_OS" == "Windows" ]; then + if [[ "$RUNNER_OS" == "Windows" ]]; then cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. ninja else cmake -DCMAKE_BUILD_TYPE=Release .. make -j2 + fi # cd pestpp/src # bindir=../../../../bin/linux COMPILER=gcc CXX=g++ FC=gfortran STATIC=no make -j 20 install cd .. From a5bfa747e9963fb4e537b12f20208333cccbe85b Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 16:45:20 +1300 Subject: [PATCH 20/46] ninja pathing issues --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7ce6ec11..ac20f98af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Setup Ninja - if: ${{ runner.os }} == "Windows" + if: ${{ runner.os == "Windows" }} uses: seanmiddleditch/gha-setup-ninja@master with: # ninja version to download. Default: 1.10.0 From b57a13465b01493784dd29166a8cd0e6376fb210 Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 16:49:09 +1300 Subject: [PATCH 21/46] more ninja --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac20f98af..2d4a8b25d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Setup Ninja - if: ${{ runner.os == "Windows" }} + if: ${{ runner.os == 'Windows' }} uses: seanmiddleditch/gha-setup-ninja@master with: # ninja version to download. Default: 1.10.0 From 44357815c75ad41b50462045d7f673f7969114d2 Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 17:19:34 +1300 Subject: [PATCH 22/46] ninja version flex --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d4a8b25d..5ac9c8167 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,6 @@ jobs: - name: Setup Ninja if: ${{ runner.os == 'Windows' }} uses: seanmiddleditch/gha-setup-ninja@master - with: - # ninja version to download. Default: 1.10.0 - version: 1.10.0 # check out repo - name: Checkout pyemu repo From a74df5fbfa002148e71254df9605a476f0c8dd9a Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 22:47:26 +1300 Subject: [PATCH 23/46] ninja manual to path --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ac9c8167..4ea36cc80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,8 @@ jobs: - name: Setup Ninja if: ${{ runner.os == 'Windows' }} uses: seanmiddleditch/gha-setup-ninja@master + run: | + echo "${GITHUB_WORKSPACE}/ninja-build" >> $GITHUB_PATH # check out repo - name: Checkout pyemu repo From 991ec9a8982e1f7700fc2dd6c3613fd9d80b73ba Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 22:53:05 +1300 Subject: [PATCH 24/46] lukka cmake test --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ea36cc80..d560403a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,11 +24,9 @@ jobs: test-path: autotest_notebooks.py steps: - - name: Setup Ninja - if: ${{ runner.os == 'Windows' }} - uses: seanmiddleditch/gha-setup-ninja@master - run: | - echo "${GITHUB_WORKSPACE}/ninja-build" >> $GITHUB_PATH + # - name: Setup Ninja + # if: ${{ runner.os == 'Windows' }} + # uses: seanmiddleditch/gha-setup-ninja@master # check out repo - name: Checkout pyemu repo @@ -43,8 +41,9 @@ jobs: path: ~/conda_pkgs_dir key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }} - # - name: Get specific version CMake, v3.19 - # uses: lukka/get-cmake@v3.19 + - name: Get specific version CMake, v3.19 + if: ${{ runner.os == 'Windows' }} + uses: lukka/get-cmake@latest # Standard python fails on windows without GDAL installation # Using custom bash shell ("shell: bash -l {0}") with Miniconda From 75f4c41c54198583c438dc4283f052f7dbdd5f81 Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 23:11:33 +1300 Subject: [PATCH 25/46] working through https://sgeor.me/post/gh-actions-cpp-cmake/ --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d560403a7..aa9e731a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,13 +24,10 @@ jobs: test-path: autotest_notebooks.py steps: + - uses: actions/checkout@v2.3.4 # - name: Setup Ninja # if: ${{ runner.os == 'Windows' }} - # uses: seanmiddleditch/gha-setup-ninja@master - - # check out repo - - name: Checkout pyemu repo - uses: actions/checkout@v2.3.4 + - uses: seanmiddleditch/gha-setup-ninja@master - name: Cache Miniconda uses: actions/cache@v2.1.0 @@ -41,9 +38,12 @@ jobs: path: ~/conda_pkgs_dir key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }} - - name: Get specific version CMake, v3.19 - if: ${{ runner.os == 'Windows' }} - uses: lukka/get-cmake@latest + # - name: Set Windows ENV + # if: runner.os == 'Windows' + # uses: ilammy/msvc-dev-cmd@latest + # - name: Get specific version CMake, v3.19 + # if: ${{ runner.os == 'Windows' }} + # uses: lukka/get-cmake@latest # Standard python fails on windows without GDAL installation # Using custom bash shell ("shell: bash -l {0}") with Miniconda @@ -90,7 +90,7 @@ jobs: cd pestpp mkdir build && cd build if [[ "$RUNNER_OS" == "Windows" ]]; then - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. + cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. ninja else cmake -DCMAKE_BUILD_TYPE=Release .. From 7431137be54c95901e4dccd745a101c17f0eef1a Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 23:30:16 +1300 Subject: [PATCH 26/46] try using cl --- .github/workflows/ci.yml | 264 +++++++++++++++++++-------------------- 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa9e731a7..413e986ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.7, 3.6] + os: [windows-latest] # ubuntu-latest, macos-latest, + python-version: [3.8] # , 3.7, 3.6 run-type: [std] test-pth: [""] include: @@ -38,39 +38,39 @@ jobs: path: ~/conda_pkgs_dir key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }} - # - name: Set Windows ENV - # if: runner.os == 'Windows' - # uses: ilammy/msvc-dev-cmd@latest + - name: Set Windows ENV + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@latest # - name: Get specific version CMake, v3.19 # if: ${{ runner.os == 'Windows' }} # uses: lukka/get-cmake@latest # Standard python fails on windows without GDAL installation # Using custom bash shell ("shell: bash -l {0}") with Miniconda - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2.0.0 - with: - python-version: ${{ matrix.python-version }} - mamba-version: "*" - channels: conda-forge - auto-update-conda: true - activate-environment: pyemu - use-only-tar-bz2: true - - - name: Add jupyter and jupytext to notebooks run - if: matrix.run-type == 'nb' - shell: bash -l {0} - run: | - mamba install --name pyemu jupyter jupytext - - - name: Add packages to pyemu environment using mamba or conda - shell: bash -l {0} - run: | - if [ "$RUNNER_OS" == "Windows" ]; then - conda env update --name pyemu --file etc/environment.yml - else - mamba env update --name pyemu --file etc/environment.yml - fi + # - name: Setup Miniconda + # uses: conda-incubator/setup-miniconda@v2.0.0 + # with: + # python-version: ${{ matrix.python-version }} + # mamba-version: "*" + # channels: conda-forge + # auto-update-conda: true + # activate-environment: pyemu + # use-only-tar-bz2: true + + # - name: Add jupyter and jupytext to notebooks run + # if: matrix.run-type == 'nb' + # shell: bash -l {0} + # run: | + # mamba install --name pyemu jupyter jupytext + + # - name: Add packages to pyemu environment using mamba or conda + # shell: bash -l {0} + # run: | + # if [ "$RUNNER_OS" == "Windows" ]; then + # conda env update --name pyemu --file etc/environment.yml + # else + # mamba env update --name pyemu --file etc/environment.yml + # fi - name: PESTPP exe install shell: bash -l {0} @@ -90,7 +90,7 @@ jobs: cd pestpp mkdir build && cd build if [[ "$RUNNER_OS" == "Windows" ]]; then - cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. + cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DCMAKE_Fortran_COMPILER=cl -DCMAKE_BUILD_TYPE=Release .. ninja else cmake -DCMAKE_BUILD_TYPE=Release .. @@ -110,109 +110,109 @@ jobs: # - "export DISPLAY=:99.0" # - "sh -e /etc/init.d/xvfb start" - - name: Install Flopy & pyemu? - shell: bash -l {0} - run: | - git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git - cd flopy - python setup.py install - cd .. - pip install https://github.com/modflowpy/pymake/zipball/master - python setup.py install - - - name: Add executables directory to path - shell: bash - run: | - echo "$HOME/.local/bin" >> $GITHUB_PATH - - - name: "pst tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py - - - name: "utils tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest utils_tests.py - - - name: "mat tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest mat_tests.py - - - name: "en tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest en_tests.py - - - name: "la tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest la_tests.py - - - name: "PstFrom tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest pst_from_tests.py - - - name: "da tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest da_tests.py - - - name: "moouu tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest moouu_tests.py - - - name: "full meal deal tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest full_meal_deal_tests.py + # - name: Install Flopy & pyemu? + # shell: bash -l {0} + # run: | + # git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git + # cd flopy + # python setup.py install + # cd .. + # pip install https://github.com/modflowpy/pymake/zipball/master + # python setup.py install + + # - name: Add executables directory to path + # shell: bash + # run: | + # echo "$HOME/.local/bin" >> $GITHUB_PATH + + # - name: "pst tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py + + # - name: "utils tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest utils_tests.py + + # - name: "mat tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest mat_tests.py + + # - name: "en tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest en_tests.py + + # - name: "la tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest la_tests.py + + # - name: "PstFrom tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest pst_from_tests.py + + # - name: "da tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest da_tests.py + + # - name: "moouu tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest moouu_tests.py + + # - name: "full meal deal tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest full_meal_deal_tests.py - - name: "plot tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest plot_tests.py - - - name: "pst tests 2" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py - - - name: "notebook tests" - if: matrix.run-type == 'nb' - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest autotest_notebooks.py + # - name: "plot tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest plot_tests.py + + # - name: "pst tests 2" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py + + # - name: "notebook tests" + # if: matrix.run-type == 'nb' + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest autotest_notebooks.py - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1.0.15 - with: - file: ./coverage.xml + # - name: Upload coverage to Codecov + # uses: codecov/codecov-action@v1.0.15 + # with: + # file: ./coverage.xml From 492090f6e79bf9b1214fca292dd535cb8b323198 Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 23:33:43 +1300 Subject: [PATCH 27/46] try using cl 2 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 413e986ab..5cddeec69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,8 @@ jobs: - name: Set Windows ENV if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@latest + uses: ilammy/msvc-dev-cmd@v1 + # - name: Get specific version CMake, v3.19 # if: ${{ runner.os == 'Windows' }} # uses: lukka/get-cmake@latest From ac43b431e04b5bde654ba0a36a6444baa6c1f560 Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 23:43:36 +1300 Subject: [PATCH 28/46] try using cl 3 --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cddeec69..4fa21e60d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,11 @@ jobs: python-version: [3.8] # , 3.7, 3.6 run-type: [std] test-pth: [""] - include: - - os: ubuntu-latest - python-version: 3.8 - run-type: nb - test-path: autotest_notebooks.py + # include: + # - os: ubuntu-latest + # python-version: 3.8 + # run-type: nb + # test-path: autotest_notebooks.py steps: - uses: actions/checkout@v2.3.4 @@ -91,7 +91,7 @@ jobs: cd pestpp mkdir build && cd build if [[ "$RUNNER_OS" == "Windows" ]]; then - cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DCMAKE_Fortran_COMPILER=cl -DCMAKE_BUILD_TYPE=Release .. + cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DDCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release .. ninja else cmake -DCMAKE_BUILD_TYPE=Release .. @@ -204,7 +204,7 @@ jobs: # --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py # - name: "notebook tests" - # if: matrix.run-type == 'nb' + # if: ${{ runner.os == 'Linux' && matrix.python-version == '3.8' }} # shell: bash -l {0} # run: | # nosetests -v --with-id --nocapture --with-timer \ From ebfe5aeb07649266420bc80fa632f6f1d1029f39 Mon Sep 17 00:00:00 2001 From: Brioch Date: Tue, 1 Dec 2020 23:59:52 +1300 Subject: [PATCH 29/46] bin dir test --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fa21e60d..aa9a15c65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,10 +91,10 @@ jobs: cd pestpp mkdir build && cd build if [[ "$RUNNER_OS" == "Windows" ]]; then - cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DDCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release .. + cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release ../../../bin ninja else - cmake -DCMAKE_BUILD_TYPE=Release .. + cmake -DCMAKE_BUILD_TYPE=Release ../../../bin make -j2 fi # cd pestpp/src From cf99565609adbb0fa869fb1c3593c2c34fb1640b Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 00:32:14 +1300 Subject: [PATCH 30/46] more on pestpp compile --- .github/workflows/ci.yml | 258 +++++++++++++++++++-------------------- 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa9a15c65..a471a116f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest] # ubuntu-latest, macos-latest, + os: [windows-latest, ubuntu-latest, macos-latest] python-version: [3.8] # , 3.7, 3.6 run-type: [std] test-pth: [""] @@ -48,30 +48,30 @@ jobs: # Standard python fails on windows without GDAL installation # Using custom bash shell ("shell: bash -l {0}") with Miniconda - # - name: Setup Miniconda - # uses: conda-incubator/setup-miniconda@v2.0.0 - # with: - # python-version: ${{ matrix.python-version }} - # mamba-version: "*" - # channels: conda-forge - # auto-update-conda: true - # activate-environment: pyemu - # use-only-tar-bz2: true - - # - name: Add jupyter and jupytext to notebooks run - # if: matrix.run-type == 'nb' - # shell: bash -l {0} - # run: | - # mamba install --name pyemu jupyter jupytext - - # - name: Add packages to pyemu environment using mamba or conda - # shell: bash -l {0} - # run: | - # if [ "$RUNNER_OS" == "Windows" ]; then - # conda env update --name pyemu --file etc/environment.yml - # else - # mamba env update --name pyemu --file etc/environment.yml - # fi + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2.0.0 + with: + python-version: ${{ matrix.python-version }} + mamba-version: "*" + channels: conda-forge + auto-update-conda: true + activate-environment: pyemu + use-only-tar-bz2: true + + - name: Add jupyter and jupytext to notebooks run + if: ${{ runner.os == 'Linux' && matrix.python-version == '3.8' }} + shell: bash -l {0} + run: | + mamba install --name pyemu jupyter jupytext + + - name: Add packages to pyemu environment using mamba or conda + shell: bash -l {0} + run: | + if [ "$RUNNER_OS" == "Windows" ]; then + conda env update --name pyemu --file etc/environment.yml + else + mamba env update --name pyemu --file etc/environment.yml + fi - name: PESTPP exe install shell: bash -l {0} @@ -91,10 +91,10 @@ jobs: cd pestpp mkdir build && cd build if [[ "$RUNNER_OS" == "Windows" ]]; then - cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release ../../../bin + cmake -GNinja -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release .. ninja else - cmake -DCMAKE_BUILD_TYPE=Release ../../../bin + cmake -DCMAKE_BUILD_TYPE=Release .. make -j2 fi # cd pestpp/src @@ -111,109 +111,109 @@ jobs: # - "export DISPLAY=:99.0" # - "sh -e /etc/init.d/xvfb start" - # - name: Install Flopy & pyemu? - # shell: bash -l {0} - # run: | - # git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git - # cd flopy - # python setup.py install - # cd .. - # pip install https://github.com/modflowpy/pymake/zipball/master - # python setup.py install - - # - name: Add executables directory to path - # shell: bash - # run: | - # echo "$HOME/.local/bin" >> $GITHUB_PATH - - # - name: "pst tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py - - # - name: "utils tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest utils_tests.py - - # - name: "mat tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest mat_tests.py - - # - name: "en tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest en_tests.py - - # - name: "la tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest la_tests.py - - # - name: "PstFrom tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest pst_from_tests.py - - # - name: "da tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest da_tests.py - - # - name: "moouu tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest moouu_tests.py - - # - name: "full meal deal tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest full_meal_deal_tests.py + - name: Install Flopy & pyemu? + shell: bash -l {0} + run: | + git clone -b develop --depth 1 https://github.com/modflowpy/flopy.git + cd flopy + python setup.py install + cd .. + pip install https://github.com/modflowpy/pymake/zipball/master + python setup.py install + + - name: Add executables directory to path + shell: bash + run: | + echo "$HOME/.local/bin" >> $GITHUB_PATH + + - name: "pst tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py + + - name: "utils tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest utils_tests.py + + - name: "mat tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest mat_tests.py + + - name: "en tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest en_tests.py + + - name: "la tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest la_tests.py + + - name: "PstFrom tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest pst_from_tests.py + + - name: "da tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest da_tests.py + + - name: "moouu tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest moouu_tests.py + + - name: "full meal deal tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest full_meal_deal_tests.py - # - name: "plot tests" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest plot_tests.py - - # - name: "pst tests 2" - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py - - # - name: "notebook tests" - # if: ${{ runner.os == 'Linux' && matrix.python-version == '3.8' }} - # shell: bash -l {0} - # run: | - # nosetests -v --with-id --nocapture --with-timer \ - # --with-coverage --cover-package=pyemu --cover-xml \ - # --cover-xml-file=../coverage.xml -w ./autotest autotest_notebooks.py + - name: "plot tests" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest plot_tests.py + + - name: "pst tests 2" + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py + + - name: "notebook tests" + if: ${{ runner.os == 'Linux' && matrix.python-version == '3.8' }} + shell: bash -l {0} + run: | + nosetests -v --with-id --nocapture --with-timer \ + --with-coverage --cover-package=pyemu --cover-xml \ + --cover-xml-file=../coverage.xml -w ./autotest autotest_notebooks.py - # - name: Upload coverage to Codecov - # uses: codecov/codecov-action@v1.0.15 - # with: - # file: ./coverage.xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.15 + with: + file: ./coverage.xml From 9976d99ea416fe06457fcb0bd22765a29c40dbd4 Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 07:27:27 +1300 Subject: [PATCH 31/46] moving PESTPP bin for tests --- .github/workflows/ci.yml | 1 + autotest/pst_from_tests.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a471a116f..0089f7e5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,6 +102,7 @@ jobs: cd .. # do we also need to cp to os specific within .local/bin/? probs... find bin -maxdepth 1 -type f -exec cp {} $HOME/.local/bin/. \; + cp -r bin ../bin cd .. # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda diff --git a/autotest/pst_from_tests.py b/autotest/pst_from_tests.py index e2768319a..13b16990b 100644 --- a/autotest/pst_from_tests.py +++ b/autotest/pst_from_tests.py @@ -2384,13 +2384,13 @@ def test_get_filepath(): if __name__ == "__main__": - #freyberg_test() + freyberg_test() #freyberg_prior_build_test() #mf6_freyberg_test() #mf6_freyberg_shortnames_test() - mf6_freyberg_da_test() + # mf6_freyberg_da_test() #mf6_freyberg_direct_test() #mf6_freyberg_varying_idomain() #xsec_test() - mf6_freyberg_short_direct_test() + # mf6_freyberg_short_direct_test() From 239f592657e5b7497ef9c00345ddb9ef38b9c87e Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 08:46:04 +1300 Subject: [PATCH 32/46] removing explicit definition of pestpp paths --- .github/workflows/ci.yml | 18 ++---------------- autotest/pst_from_tests.py | 10 ++++++---- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0089f7e5d..753dbcb00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: [3.8] # , 3.7, 3.6 + python-version: [3.8, 3.7, 3.6] run-type: [std] test-pth: [""] # include: @@ -79,14 +79,7 @@ jobs: if [[ ! -d "$HOME/.local/bin" ]]; then mkdir -p "$HOME/.local/bin"; fi - # export PATH="$HOME/.local/bin:$PATH" - # ln -fs /usr/bin/gfortran-6 "$HOME/.local/bin/gfortran" && gfortran --version - # ls -l /usr/bin/gfortran-6 - # ln -fs /usr/bin/gcc-6 "$HOME/.local/bin/gcc" && gcc --version - # ls -l /usr/bin/gcc-6 - # ln -fs /usr/bin/g++-6 "$HOME/.local/bin/g++" && g++ --version - # ls -l /usr/bin/g++-6 - # export CXX="g++" + git clone -b develop --depth 1 https://github.com/usgs/pestpp cd pestpp mkdir build && cd build @@ -104,13 +97,6 @@ jobs: find bin -maxdepth 1 -type f -exec cp {} $HOME/.local/bin/. \; cp -r bin ../bin cd .. - # might be able to get away without this line? wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - # might be able to get away without this line? bash miniconda.sh -b -p $HOME/miniconda - # might be able to get away without this line? export PATH="$HOME/miniconda/bin:$PATH" - # export PATH="$HOME/pestpp/bin/linux:$PATH" - # might be able to get away without this line? conda update --yes conda - # - "export DISPLAY=:99.0" - # - "sh -e /etc/init.d/xvfb start" - name: Install Flopy & pyemu? shell: bash -l {0} diff --git a/autotest/pst_from_tests.py b/autotest/pst_from_tests.py index 13b16990b..b3e3e2e83 100644 --- a/autotest/pst_from_tests.py +++ b/autotest/pst_from_tests.py @@ -12,13 +12,15 @@ import shutil ext = '' -bin_path = os.path.join("..", "..", "bin") +bin_path = '' # os.path.join("..", "..", "bin") if "linux" in platform.platform().lower(): - bin_path = os.path.join(bin_path, "linux") + pass + # bin_path = os.path.join(bin_path, "linux") elif "darwin" in platform.platform().lower() or 'macos' in platform.platform().lower(): - bin_path = os.path.join(bin_path, "mac") + pass + # bin_path = os.path.join(bin_path, "mac") else: - bin_path = os.path.join(bin_path, "win") + # bin_path = os.path.join(bin_path, "win") ext = '.exe' mf_exe_path = os.path.join(bin_path, "mfnwt") From 262e689aee54206bb5c25985a2638d0e1b7d7763 Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 11:45:34 +1300 Subject: [PATCH 33/46] more exe path changes in tests --- autotest/full_meal_deal_tests.py | 66 ++++++++++++++++---------------- autotest/pst_from_tests.py | 2 +- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/autotest/full_meal_deal_tests.py b/autotest/full_meal_deal_tests.py index 87bbf20f3..26af5b977 100644 --- a/autotest/full_meal_deal_tests.py +++ b/autotest/full_meal_deal_tests.py @@ -2,13 +2,15 @@ import platform ext = '' -bin_path = os.path.join("..","..","bin") +bin_path = '' # os.path.join("..","..","bin") if "linux" in platform.platform().lower(): - bin_path = os.path.join(bin_path,"linux") -elif "darwin" in platform.platform().lower(): - bin_path = os.path.join(bin_path,"mac") + pass + # bin_path = os.path.join(bin_path,"linux") +elif "darwin" in platform.platform().lower() or 'macos' in platform.platform().lower(): + pass + # bin_path = os.path.join(bin_path,"mac") else: - bin_path = os.path.join(bin_path,"win") + # bin_path = os.path.join(bin_path,"win") ext = '.exe' @@ -32,15 +34,15 @@ def freyberg_test(): return import pyemu - ext = '' - bin_path = os.path.join("..", "..", "bin") - if "linux" in platform.platform().lower(): - bin_path = os.path.join(bin_path, "linux") - elif "darwin" in platform.platform().lower(): - bin_path = os.path.join(bin_path, "mac") - else: - bin_path = os.path.join(bin_path, "win") - ext = '.exe' + # ext = '' + # bin_path = os.path.join("..", "..", "bin") + # if "linux" in platform.platform().lower(): + # bin_path = os.path.join(bin_path, "linux") + # elif "darwin" in platform.platform().lower(): + # bin_path = os.path.join(bin_path, "mac") + # else: + # bin_path = os.path.join(bin_path, "win") + # ext = '.exe' org_model_ws = os.path.join("..", "examples", "freyberg_sfr_update") nam_file = "freyberg.nam" @@ -157,15 +159,15 @@ def freyberg_kl_pp_compare(): return import pyemu - ext = '' - bin_path = os.path.join("..", "..", "bin") - if "linux" in platform.platform().lower(): - bin_path = os.path.join(bin_path, "linux") - elif "darwin" in platform.platform().lower(): - bin_path = os.path.join(bin_path, "mac") - else: - bin_path = os.path.join(bin_path, "win") - ext = '.exe' + # ext = '' + # bin_path = os.path.join("..", "..", "bin") + # if "linux" in platform.platform().lower(): + # bin_path = os.path.join(bin_path, "linux") + # elif "darwin" in platform.platform().lower(): + # bin_path = os.path.join(bin_path, "mac") + # else: + # bin_path = os.path.join(bin_path, "win") + # ext = '.exe' org_model_ws_base = os.path.join("..", "examples", "freyberg_sfr_update") nam_file = "freyberg.nam" @@ -241,15 +243,15 @@ def freyberg_diff_obs_test(): return import pyemu - ext = '' - bin_path = os.path.join("..", "..", "bin") - if "linux" in platform.platform().lower(): - bin_path = os.path.join(bin_path, "linux") - elif "darwin" in platform.platform().lower(): - bin_path = os.path.join(bin_path, "mac") - else: - bin_path = os.path.join(bin_path, "win") - ext = '.exe' + # ext = '' + # bin_path = os.path.join("..", "..", "bin") + # if "linux" in platform.platform().lower(): + # bin_path = os.path.join(bin_path, "linux") + # elif "darwin" in platform.platform().lower(): + # bin_path = os.path.join(bin_path, "mac") + # else: + # bin_path = os.path.join(bin_path, "win") + # ext = '.exe' oorg_model_ws = os.path.join("..", "examples", "freyberg_sfr_update") nam_file = "freyberg.nam" diff --git a/autotest/pst_from_tests.py b/autotest/pst_from_tests.py index b3e3e2e83..392240e66 100644 --- a/autotest/pst_from_tests.py +++ b/autotest/pst_from_tests.py @@ -12,7 +12,7 @@ import shutil ext = '' -bin_path = '' # os.path.join("..", "..", "bin") +bin_path = '' # os.path.join("..", "..", "bin") if "linux" in platform.platform().lower(): pass # bin_path = os.path.join(bin_path, "linux") From 4a221fff3c538c90a071029e6a91a92f188e93cc Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 23:18:09 +1300 Subject: [PATCH 34/46] some more test path temp(?) edits\n\nrunning tests in matrix --- .github/workflows/ci.yml | 195 +++++++++++++++++-------------- autotest/full_meal_deal_tests.py | 16 +-- autotest/pst_from_tests.py | 7 +- 3 files changed, 120 insertions(+), 98 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 753dbcb00..b068aec46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,14 +14,17 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest, macos-latest] - python-version: [3.8, 3.7, 3.6] + python-version: [3.8] # , 3.7, 3.6] run-type: [std] - test-pth: [""] - # include: - # - os: ubuntu-latest - # python-version: 3.8 - # run-type: nb - # test-path: autotest_notebooks.py + test-path: ["pst_tests.py", "utils_tests.py", "mat_tests.py", + "en_tests.py", "la_tests.py", "pst_from_tests.py", + "da_tests.py", "moouu_tests.py", "full_meal_deal_tests.py", + "plot_tests.py", "pst_tests_2.py", "autotest_notebooks.py"] + include: + - os: ubuntu-latest + python-version: 3.8 + run-type: nb + test-path: autotest_notebooks.py steps: - uses: actions/checkout@v2.3.4 @@ -59,7 +62,7 @@ jobs: use-only-tar-bz2: true - name: Add jupyter and jupytext to notebooks run - if: ${{ runner.os == 'Linux' && matrix.python-version == '3.8' }} + if: matrix.run-type == 'nb' shell: bash -l {0} run: | mamba install --name pyemu jupyter jupytext @@ -79,7 +82,14 @@ jobs: if [[ ! -d "$HOME/.local/bin" ]]; then mkdir -p "$HOME/.local/bin"; fi - + # copy modflow bins to local dir to add to PATH later + if [ "$RUNNER_OS" == "Windows" ]; then + $d="win" + elif [ "$RUNNER_OS" == "Mac" ]; then + $d="mac" + elif [ "$RUNNER_OS" == "Mac" ]; then + $d="linux" + cp "bin/$d/". "$HOME/.local/bin/" git clone -b develop --depth 1 https://github.com/usgs/pestpp cd pestpp mkdir build && cd build @@ -95,7 +105,7 @@ jobs: cd .. # do we also need to cp to os specific within .local/bin/? probs... find bin -maxdepth 1 -type f -exec cp {} $HOME/.local/bin/. \; - cp -r bin ../bin + # cp -r bin ../bin cd .. - name: Install Flopy & pyemu? @@ -112,91 +122,100 @@ jobs: shell: bash run: | echo "$HOME/.local/bin" >> $GITHUB_PATH + ls $GITHUB_PATH - name: "pst tests" shell: bash -l {0} run: | nosetests -v --with-id --nocapture --with-timer \ --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py - - - name: "utils tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest utils_tests.py - - - name: "mat tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest mat_tests.py - - - name: "en tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest en_tests.py - - - name: "la tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest la_tests.py - - - name: "PstFrom tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest pst_from_tests.py - - - name: "da tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest da_tests.py - - - name: "moouu tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest moouu_tests.py - - - name: "full meal deal tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest full_meal_deal_tests.py + --cover-xml-file=../coverage.xml -w ./autotest ${{ martix.test-path }} + + + # - name: "pst tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest pst_tests.py + + # - name: "utils tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest utils_tests.py + + # - name: "mat tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest mat_tests.py + + # - name: "en tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest en_tests.py + + # - name: "la tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest la_tests.py + + # - name: "PstFrom tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest pst_from_tests.py + + # - name: "da tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest da_tests.py + + # - name: "moouu tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest moouu_tests.py + + # - name: "full meal deal tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest full_meal_deal_tests.py - - name: "plot tests" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest plot_tests.py - - - name: "pst tests 2" - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py - - - name: "notebook tests" - if: ${{ runner.os == 'Linux' && matrix.python-version == '3.8' }} - shell: bash -l {0} - run: | - nosetests -v --with-id --nocapture --with-timer \ - --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest autotest_notebooks.py + # - name: "plot tests" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest plot_tests.py + + # - name: "pst tests 2" + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest pst_tests_2.py + + # - name: "notebook tests" + # if: ${{ runner.os == 'Linux' && matrix.python-version == '3.8' }} + # shell: bash -l {0} + # run: | + # nosetests -v --with-id --nocapture --with-timer \ + # --with-coverage --cover-package=pyemu --cover-xml \ + # --cover-xml-file=../coverage.xml -w ./autotest autotest_notebooks.py - name: Upload coverage to Codecov uses: codecov/codecov-action@v1.0.15 diff --git a/autotest/full_meal_deal_tests.py b/autotest/full_meal_deal_tests.py index 26af5b977..fb10f9030 100644 --- a/autotest/full_meal_deal_tests.py +++ b/autotest/full_meal_deal_tests.py @@ -80,10 +80,10 @@ def freyberg_test(): temporal_bc_props=temp_bc_props, remove_existing=True, model_exe_name="mfnwt") - tmp = mf_exe_name.split(os.sep) - tmp = os.path.join(*tmp[1:])+ext - assert os.path.exists(tmp),tmp - shutil.copy2(tmp,os.path.join(new_model_ws,"mfnwt"+ext)) + # tmp = mf_exe_name.split(os.sep) + # tmp = os.path.join(*tmp[1:])+ext + # assert os.path.exists(tmp),tmp + # shutil.copy2(tmp,os.path.join(new_model_ws,"mfnwt"+ext)) ph.pst.control_data.noptmax = 0 ph.pst.write(os.path.join(new_model_ws,"test.pst")) print("{0} {1}".format(pp_exe_name,"test.pst"), new_model_ws) @@ -325,10 +325,10 @@ def freyberg_diff_obs_test(): ph.write_forward_run() - tmp = mf_exe_name.split(os.sep) - tmp = os.path.join(*tmp[1:])+ext - assert os.path.exists(tmp),tmp - shutil.copy2(tmp,os.path.join(new_model_ws,"mfnwt"+ext)) + # tmp = mf_exe_name.split(os.sep) + # tmp = os.path.join(*tmp[1:])+ext + # assert os.path.exists(tmp),tmp + # shutil.copy2(tmp,os.path.join(new_model_ws,"mfnwt"+ext)) ph.pst.control_data.noptmax = 0 ph.pst.write(os.path.join(new_model_ws,"test.pst")) print("{0} {1}".format(pp_exe_name,"test.pst"), new_model_ws) diff --git a/autotest/pst_from_tests.py b/autotest/pst_from_tests.py index 392240e66..5c16a1caa 100644 --- a/autotest/pst_from_tests.py +++ b/autotest/pst_from_tests.py @@ -125,7 +125,9 @@ def freyberg_test(): sfodf_c.columns = sfodf_c.columns.str.lower() assert (sfrobs_p == sfodf_c.loc[sfrobs_p.index, sfrobs_p.columns]).all().all(), ( - "Mis-match between expected and processed obs values") + "Mis-match between expected and processed obs values\n", + sfrobs_p.head(), + sfodf_c.loc[sfrobs_p.index, sfrobs_p.columns].head()) pf.tmp_files.append(f"{m.name}.sfr.out") pf.extra_py_imports.append('flopy') @@ -2293,7 +2295,8 @@ def test_add_direct_array_parameters(self): # first delete the model file that was in the template ws model_file = df['model_file'].values[mult2model_row] - assert model_file == dest_file + assert model_file == dest_file, (f"model_file: {model_file} " + f"differs from dest_file {dest_file}") os.remove(model_file) # pretend that PEST created the input files From 45e452d7fcd19b27b2e47d1608211fd631d94158 Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 23:20:34 +1300 Subject: [PATCH 35/46] fixing dyslexia attacks --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b068aec46..3e861f336 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,7 @@ jobs: $d="win" elif [ "$RUNNER_OS" == "Mac" ]; then $d="mac" - elif [ "$RUNNER_OS" == "Mac" ]; then + elif [ "$RUNNER_OS" == "Linux" ]; then $d="linux" cp "bin/$d/". "$HOME/.local/bin/" git clone -b develop --depth 1 https://github.com/usgs/pestpp @@ -129,7 +129,7 @@ jobs: run: | nosetests -v --with-id --nocapture --with-timer \ --with-coverage --cover-package=pyemu --cover-xml \ - --cover-xml-file=../coverage.xml -w ./autotest ${{ martix.test-path }} + --cover-xml-file=../coverage.xml -w ./autotest ${{ matrix.test-path }} # - name: "pst tests" From e53bf03d56c8fbaacca001edbf94fba6598c8883 Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 23:31:11 +1300 Subject: [PATCH 36/46] more bin dir hackery --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e861f336..1ffa10125 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,7 @@ jobs: $d="mac" elif [ "$RUNNER_OS" == "Linux" ]; then $d="linux" - cp "bin/$d/". "$HOME/.local/bin/" + cp -r bin/$d/. "$HOME/.local/bin/" git clone -b develop --depth 1 https://github.com/usgs/pestpp cd pestpp mkdir build && cd build @@ -124,7 +124,7 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH ls $GITHUB_PATH - - name: "pst tests" + - name: ${{ matrix.test-path }} shell: bash -l {0} run: | nosetests -v --with-id --nocapture --with-timer \ From 97012e93c70ece04c48af0dec2e51c2c453b924e Mon Sep 17 00:00:00 2001 From: Brioch Date: Wed, 2 Dec 2020 23:42:56 +1300 Subject: [PATCH 37/46] bash syntax stupidity --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ffa10125..28aa4e49d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: test-path: ["pst_tests.py", "utils_tests.py", "mat_tests.py", "en_tests.py", "la_tests.py", "pst_from_tests.py", "da_tests.py", "moouu_tests.py", "full_meal_deal_tests.py", - "plot_tests.py", "pst_tests_2.py", "autotest_notebooks.py"] + "plot_tests.py", "pst_tests_2.py"] include: - os: ubuntu-latest python-version: 3.8 @@ -84,11 +84,12 @@ jobs: fi # copy modflow bins to local dir to add to PATH later if [ "$RUNNER_OS" == "Windows" ]; then - $d="win" + d="win" elif [ "$RUNNER_OS" == "Mac" ]; then - $d="mac" + d="mac" elif [ "$RUNNER_OS" == "Linux" ]; then - $d="linux" + d="linux" + fi cp -r bin/$d/. "$HOME/.local/bin/" git clone -b develop --depth 1 https://github.com/usgs/pestpp cd pestpp From 5077120b4b9518481f66083d322a27c3780b279b Mon Sep 17 00:00:00 2001 From: Brioch Date: Thu, 3 Dec 2020 00:02:48 +1300 Subject: [PATCH 38/46] macOS bin fix --- .github/workflows/ci.yml | 5 ++++- etc/environment.yml | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28aa4e49d..9dcb26be3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,10 +85,13 @@ jobs: # copy modflow bins to local dir to add to PATH later if [ "$RUNNER_OS" == "Windows" ]; then d="win" - elif [ "$RUNNER_OS" == "Mac" ]; then + elif [ "$RUNNER_OS" == "macOS" ]; then d="mac" elif [ "$RUNNER_OS" == "Linux" ]; then d="linux" + else + d="unexpectedos" + exit 1 fi cp -r bin/$d/. "$HOME/.local/bin/" git clone -b develop --depth 1 https://github.com/usgs/pestpp diff --git a/etc/environment.yml b/etc/environment.yml index 7d6c833a3..25e6b35be 100644 --- a/etc/environment.yml +++ b/etc/environment.yml @@ -7,4 +7,5 @@ dependencies: - pyshp - nose-timer - nbsphinx - - matplotlib \ No newline at end of file + - matplotlib + - coverage From fa1fd460c88258a055f358f1f178b2053296004b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Dec 2020 13:59:20 -0700 Subject: [PATCH 39/46] fix for windows pandas line term in pstfrom tests --- autotest/pst_from_tests.py | 16 +++++++++++++--- examples/freyberg_sfr_update/freyberg.lmt6 | 1 - 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/autotest/pst_from_tests.py b/autotest/pst_from_tests.py index 5c16a1caa..881c60878 100644 --- a/autotest/pst_from_tests.py +++ b/autotest/pst_from_tests.py @@ -84,9 +84,9 @@ def freyberg_test(): "Processed into tabular form using the lines:\n", "sfo = flopy.utils.SfrFile('freyberg.sfr.out')\n", "sfo.get_dataframe().to_csv('freyberg.sfo.dat')\n"]) - sfodf.sort_index(1).to_csv(fp, sep=' ', index_label='idx') + sfodf.sort_index(1).to_csv(fp, sep=' ', index_label='idx',line_terminator='\n') sfodf.sort_index(1).to_csv(os.path.join(m.model_ws, 'freyberg.sfo.csv'), - index_label='idx') + index_label='idx',line_terminator='\n') template_ws = "new_temp" # sr0 = m.sr sr = pyemu.helpers.SpatialReference.from_namfile( @@ -142,7 +142,7 @@ def freyberg_test(): "'Processed into tabular form using the lines:\\n', " "'sfo = flopy.utils.SfrFile(`freyberg.sfr.out`)\\n', " "'sfo.get_dataframe().to_csv(`freyberg.sfo.dat`)\\n'])", - " sfodf.sort_index(1).to_csv(fp, sep=' ', index_label='idx')"]) + " sfodf.sort_index(1).to_csv(fp, sep=' ', index_label='idx',line_terminator='\\n')"]) # csv version of sfr obs # sfr outputs to obs pf.add_observations('freyberg.sfo.csv', insfile=None, @@ -2388,7 +2388,17 @@ def test_get_filepath(): assert result == expected +def invest(): + import os + import pyemu + + i = pyemu.pst_utils.InstructionFile(os.path.join("new_temp","freyberg.sfo.dat.ins")) + i.read_output_file(os.path.join("new_temp","freyberg.sfo.dat")) + + + if __name__ == "__main__": + #invest() freyberg_test() #freyberg_prior_build_test() #mf6_freyberg_test() diff --git a/examples/freyberg_sfr_update/freyberg.lmt6 b/examples/freyberg_sfr_update/freyberg.lmt6 index 00e0a86a9..7d7614a53 100644 --- a/examples/freyberg_sfr_update/freyberg.lmt6 +++ b/examples/freyberg_sfr_update/freyberg.lmt6 @@ -3,4 +3,3 @@ OUTPUT_FILE_NAME mt3d_link.ftl OUTPUT_FILE_UNIT 54 OUTPUT_FILE_HEADER extended OUTPUT_FILE_FORMAT formatted -PACKAGE_FLOWS SFR From 931e842997a4c478c3a798711fd93533b47cd778 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Dec 2020 15:03:26 -0700 Subject: [PATCH 40/46] fix for path assert --- autotest/pst_from_tests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/autotest/pst_from_tests.py b/autotest/pst_from_tests.py index 881c60878..45546cae6 100644 --- a/autotest/pst_from_tests.py +++ b/autotest/pst_from_tests.py @@ -2295,7 +2295,7 @@ def test_add_direct_array_parameters(self): # first delete the model file that was in the template ws model_file = df['model_file'].values[mult2model_row] - assert model_file == dest_file, (f"model_file: {model_file} " + assert Path(model_file) == Path(dest_file), (f"model_file: {model_file} " f"differs from dest_file {dest_file}") os.remove(model_file) @@ -2399,13 +2399,17 @@ def invest(): if __name__ == "__main__": #invest() - freyberg_test() + #freyberg_test() #freyberg_prior_build_test() #mf6_freyberg_test() #mf6_freyberg_shortnames_test() - # mf6_freyberg_da_test() #mf6_freyberg_direct_test() #mf6_freyberg_varying_idomain() #xsec_test() - # mf6_freyberg_short_direct_test() + #mf6_freyberg_short_direct_test() + tpf = TestPstFrom() + tpf.setup() + tpf.test_add_direct_array_parameters() + + From f6e5b2250b154bbdcb82363fadcd2aeb405cd3df Mon Sep 17 00:00:00 2001 From: Brioch Date: Thu, 3 Dec 2020 13:46:29 +1300 Subject: [PATCH 41/46] Mod tests to allow manual def. of binaraies when running locally --- autotest/full_meal_deal_tests.py | 54 +++++++++----------------------- autotest/pst_from_tests.py | 24 ++++++++------ 2 files changed, 30 insertions(+), 48 deletions(-) diff --git a/autotest/full_meal_deal_tests.py b/autotest/full_meal_deal_tests.py index fb10f9030..876db592a 100644 --- a/autotest/full_meal_deal_tests.py +++ b/autotest/full_meal_deal_tests.py @@ -2,16 +2,22 @@ import platform ext = '' -bin_path = '' # os.path.join("..","..","bin") -if "linux" in platform.platform().lower(): - pass - # bin_path = os.path.join(bin_path,"linux") -elif "darwin" in platform.platform().lower() or 'macos' in platform.platform().lower(): - pass - # bin_path = os.path.join(bin_path,"mac") +local_bins = False # change if wanting to test with local binary exes +if local_bins: + bin_path = os.path.join("..", "..", "bin") + if "linux" in platform.platform().lower(): + pass + bin_path = os.path.join(bin_path, "linux") + elif "darwin" in platform.platform().lower() or 'macos' in platform.platform().lower(): + pass + bin_path = os.path.join(bin_path, "mac") + else: + bin_path = os.path.join(bin_path, "win") + ext = '.exe' else: - # bin_path = os.path.join(bin_path,"win") - ext = '.exe' + bin_path = '' + if "windows" in platform.platform().lower(): + ext = '.exe' mf_exe_name = os.path.join(bin_path,"mfnwt") @@ -34,16 +40,6 @@ def freyberg_test(): return import pyemu - # ext = '' - # bin_path = os.path.join("..", "..", "bin") - # if "linux" in platform.platform().lower(): - # bin_path = os.path.join(bin_path, "linux") - # elif "darwin" in platform.platform().lower(): - # bin_path = os.path.join(bin_path, "mac") - # else: - # bin_path = os.path.join(bin_path, "win") - # ext = '.exe' - org_model_ws = os.path.join("..", "examples", "freyberg_sfr_update") nam_file = "freyberg.nam" m = flopy.modflow.Modflow.load(nam_file, model_ws=org_model_ws, check=False,forgive=False, @@ -159,16 +155,6 @@ def freyberg_kl_pp_compare(): return import pyemu - # ext = '' - # bin_path = os.path.join("..", "..", "bin") - # if "linux" in platform.platform().lower(): - # bin_path = os.path.join(bin_path, "linux") - # elif "darwin" in platform.platform().lower(): - # bin_path = os.path.join(bin_path, "mac") - # else: - # bin_path = os.path.join(bin_path, "win") - # ext = '.exe' - org_model_ws_base = os.path.join("..", "examples", "freyberg_sfr_update") nam_file = "freyberg.nam" m = flopy.modflow.Modflow.load(nam_file, model_ws=org_model_ws_base, check=False, forgive=False, @@ -243,16 +229,6 @@ def freyberg_diff_obs_test(): return import pyemu - # ext = '' - # bin_path = os.path.join("..", "..", "bin") - # if "linux" in platform.platform().lower(): - # bin_path = os.path.join(bin_path, "linux") - # elif "darwin" in platform.platform().lower(): - # bin_path = os.path.join(bin_path, "mac") - # else: - # bin_path = os.path.join(bin_path, "win") - # ext = '.exe' - oorg_model_ws = os.path.join("..", "examples", "freyberg_sfr_update") nam_file = "freyberg.nam" m = flopy.modflow.Modflow.load(nam_file, model_ws=oorg_model_ws, check=False,forgive=False, diff --git a/autotest/pst_from_tests.py b/autotest/pst_from_tests.py index 45546cae6..7ff12b6fc 100644 --- a/autotest/pst_from_tests.py +++ b/autotest/pst_from_tests.py @@ -12,16 +12,22 @@ import shutil ext = '' -bin_path = '' # os.path.join("..", "..", "bin") -if "linux" in platform.platform().lower(): - pass - # bin_path = os.path.join(bin_path, "linux") -elif "darwin" in platform.platform().lower() or 'macos' in platform.platform().lower(): - pass - # bin_path = os.path.join(bin_path, "mac") +local_bins = False # change if wanting to test with local binary exes +if local_bins: + bin_path = os.path.join("..", "..", "bin") + if "linux" in platform.platform().lower(): + pass + bin_path = os.path.join(bin_path, "linux") + elif "darwin" in platform.platform().lower() or 'macos' in platform.platform().lower(): + pass + bin_path = os.path.join(bin_path, "mac") + else: + bin_path = os.path.join(bin_path, "win") + ext = '.exe' else: - # bin_path = os.path.join(bin_path, "win") - ext = '.exe' + bin_path = '' + if "windows" in platform.platform().lower(): + ext = '.exe' mf_exe_path = os.path.join(bin_path, "mfnwt") mt_exe_path = os.path.join(bin_path, "mt3dusgs") From 00e0852669c921f39839b8fe0804edb892cc81fb Mon Sep 17 00:00:00 2001 From: Brioch Date: Thu, 3 Dec 2020 15:21:01 +1300 Subject: [PATCH 42/46] adding py37 for windows and linux trying to reorder runs --- .github/workflows/ci.yml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9dcb26be3..031b75e8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,15 +16,41 @@ jobs: os: [windows-latest, ubuntu-latest, macos-latest] python-version: [3.8] # , 3.7, 3.6] run-type: [std] - test-path: ["pst_tests.py", "utils_tests.py", "mat_tests.py", - "en_tests.py", "la_tests.py", "pst_from_tests.py", - "da_tests.py", "moouu_tests.py", "full_meal_deal_tests.py", - "plot_tests.py", "pst_tests_2.py"] + test-path: [ + "pst_tests_2.py", + "utils_tests.py", + "pst_from_tests.py", + "pst_tests.py", + "full_meal_deal_tests.py", + "en_tests.py", + "la_tests.py", + "plot_tests.py", + "moouu_tests.py", + "mat_tests.py", + "da_tests.py" + ] include: - os: ubuntu-latest - python-version: 3.8 + python-version: [3.8, 3.7] run-type: nb test-path: autotest_notebooks.py + include: + - os: [windows-latest, ubuntu-latest] + python-version: 3.7 + run-type: nb + test-path: [ + "pst_tests_2.py", + "utils_tests.py", + "pst_from_tests.py", + "pst_tests.py", + "full_meal_deal_tests.py", + "en_tests.py", + "la_tests.py", + "plot_tests.py", + "moouu_tests.py", + "mat_tests.py", + "da_tests.py" + ] steps: - uses: actions/checkout@v2.3.4 From 245c712dce52fa323d421db302cc61bb4d0c5c96 Mon Sep 17 00:00:00 2001 From: Brioch Date: Thu, 3 Dec 2020 15:27:07 +1300 Subject: [PATCH 43/46] try again py37 on linux and windows --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 031b75e8b..aade453b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,10 +34,8 @@ jobs: python-version: [3.8, 3.7] run-type: nb test-path: autotest_notebooks.py - include: - os: [windows-latest, ubuntu-latest] python-version: 3.7 - run-type: nb test-path: [ "pst_tests_2.py", "utils_tests.py", From 44ca1062ccffd80ea1d55bf4c232ea12921d7ac8 Mon Sep 17 00:00:00 2001 From: Brioch Date: Thu, 3 Dec 2020 15:37:15 +1300 Subject: [PATCH 44/46] tweeking mac only 3.8 --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aade453b7..42d7a51bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - python-version: [3.8] # , 3.7, 3.6] + os: [windows-latest, ubuntu-latest] + python-version: [3.8, 3.7] # , 3.7, 3.6] run-type: [std] test-path: [ "pst_tests_2.py", @@ -31,11 +31,11 @@ jobs: ] include: - os: ubuntu-latest - python-version: [3.8, 3.7] + python-version: 3.8 run-type: nb test-path: autotest_notebooks.py - - os: [windows-latest, ubuntu-latest] - python-version: 3.7 + - os: macos-latest + python-version: 3.8 test-path: [ "pst_tests_2.py", "utils_tests.py", From a1eeeeeb1cc2062bf0bd3ab3824f2a55de303d23 Mon Sep 17 00:00:00 2001 From: Brioch Hemmings Date: Thu, 3 Dec 2020 15:51:19 +1300 Subject: [PATCH 45/46] Update ci.yml more matrix-include trial and error --- .github/workflows/ci.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42d7a51bf..a157755b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,25 +30,14 @@ jobs: "da_tests.py" ] include: + - os: macos-latest + python-version: 3.8 + run-type: mac - os: ubuntu-latest python-version: 3.8 run-type: nb test-path: autotest_notebooks.py - - os: macos-latest - python-version: 3.8 - test-path: [ - "pst_tests_2.py", - "utils_tests.py", - "pst_from_tests.py", - "pst_tests.py", - "full_meal_deal_tests.py", - "en_tests.py", - "la_tests.py", - "plot_tests.py", - "moouu_tests.py", - "mat_tests.py", - "da_tests.py" - ] + steps: - uses: actions/checkout@v2.3.4 From a1d309af57149e476cd540792c0156832cdcecf9 Mon Sep 17 00:00:00 2001 From: Brioch Hemmings Date: Thu, 3 Dec 2020 17:39:06 +1300 Subject: [PATCH 46/46] Update ci.yml using exclude to slim down matrix --- .github/workflows/ci.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a157755b1..811cf92f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, ubuntu-latest] - python-version: [3.8, 3.7] # , 3.7, 3.6] + os: [windows-latest, ubuntu-latest, macos-latest] + python-version: [3.8, 3.7, 3.6] # , 3.7, 3.6] run-type: [std] test-path: [ "pst_tests_2.py", @@ -29,10 +29,16 @@ jobs: "mat_tests.py", "da_tests.py" ] - include: + exclude: - os: macos-latest - python-version: 3.8 - run-type: mac + python-version: 3.7 + - os: macos-latest + python-version: 3.6 + - os: windows-latest + python-version: 3.7 + - os: windows-latest + python-version: 3.6 + include: - os: ubuntu-latest python-version: 3.8 run-type: nb