Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
db3cbf4
First attempt at hacking in GitHub Actions
briochh Nov 30, 2020
1fb4e16
env.yml req.
briochh Nov 30, 2020
c28b86b
Working in cmake for pestpp exes
briochh Nov 30, 2020
440e07c
python 3.6+ and cp pestpp exe
briochh Nov 30, 2020
711f731
cp typo fix
briochh Nov 30, 2020
07e5b01
idiot forgot how to bash
briochh Nov 30, 2020
04d0056
trying to get pestpp bins into right place
briochh Nov 30, 2020
387afb2
trying to specify tests
briochh Nov 30, 2020
94c5659
testing tests in series
briochh Nov 30, 2020
e55b303
more testing tests in series
briochh Nov 30, 2020
657d8e6
Trying all tests in series
briochh Nov 30, 2020
a23224b
Update ci.yml
briochh Nov 30, 2020
597c2ea
Update ci.yml
briochh Nov 30, 2020
2f13d02
update ci.yml xplatform build
briochh Nov 30, 2020
3e63e82
Merge branch 'feature_ghactions' of https://github.com/briochh/pyemu …
briochh Nov 30, 2020
b5342f1
update ci.yml more xplatform
briochh Nov 30, 2020
b141e7b
fix typo in ci.yml
briochh Nov 30, 2020
96fc76d
Update ci.yml
briochh Dec 1, 2020
bb4f64e
Update ci.yml
briochh Dec 1, 2020
c633ba3
urgh syntax
briochh Dec 1, 2020
a5bfa74
ninja pathing issues
briochh Dec 1, 2020
b57a134
more ninja
briochh Dec 1, 2020
4435781
ninja version flex
briochh Dec 1, 2020
a74df5f
ninja manual to path
briochh Dec 1, 2020
991ec9a
lukka cmake test
briochh Dec 1, 2020
75f4c41
working through https://sgeor.me/post/gh-actions-cpp-cmake/
briochh Dec 1, 2020
7431137
try using cl
briochh Dec 1, 2020
492090f
try using cl 2
briochh Dec 1, 2020
ac43b43
try using cl 3
briochh Dec 1, 2020
ebfe5ae
bin dir test
briochh Dec 1, 2020
cf99565
more on pestpp compile
briochh Dec 1, 2020
9976d99
moving PESTPP bin for tests
briochh Dec 1, 2020
239f592
removing explicit definition of pestpp paths
briochh Dec 1, 2020
262e689
more exe path changes in tests
briochh Dec 1, 2020
4a221ff
some more test path temp(?) edits\n\nrunning tests in matrix
briochh Dec 2, 2020
45e452d
fixing dyslexia attacks
briochh Dec 2, 2020
e53bf03
more bin dir hackery
briochh Dec 2, 2020
97012e9
bash syntax stupidity
briochh Dec 2, 2020
5077120
macOS bin fix
briochh Dec 2, 2020
fa1fd46
fix for windows pandas line term in pstfrom tests
jtwhite79 Dec 2, 2020
931e842
fix for path assert
jtwhite79 Dec 2, 2020
62e1ae0
Merge pull request #2 from jtwhite79/feature_ghactions
briochh Dec 2, 2020
f6e5b22
Mod tests to allow manual def. of binaraies when running locally
briochh Dec 3, 2020
00e0852
adding py37 for windows and linux
briochh Dec 3, 2020
245c712
try again py37 on linux and windows
briochh Dec 3, 2020
44ca106
tweeking mac only 3.8
briochh Dec 3, 2020
a1eeeee
Update ci.yml
briochh Dec 3, 2020
a1d309a
Update ci.yml
briochh Dec 3, 2020
6982a2b
Merge branch 'develop' of https://github.com/pypest/pyemu into featur…
briochh Dec 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 248 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
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: [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",
"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"
]
exclude:
- os: macos-latest
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
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

- 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') }}

- name: Set Windows ENV
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

# - 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: PESTPP exe install
shell: bash -l {0}
run: |
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" == "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
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 ..
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 ..
# 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 ..

- 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
ls $GITHUB_PATH

- name: ${{ matrix.test-path }}
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 }}


# - 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: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.15
with:
file: ./coverage.xml


2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
68 changes: 23 additions & 45 deletions autotest/full_meal_deal_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@
import platform

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() or "macos" in platform.platform().lower():
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")
Expand All @@ -32,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() or "macos" 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,
Expand Down Expand Up @@ -78,10 +76,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)
Expand Down Expand Up @@ -157,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,
Expand Down Expand Up @@ -241,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,
Expand Down Expand Up @@ -323,10 +301,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)
Expand Down
Loading