Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
008cba8
Mooring module (#235)
hivanov-nrel Jul 14, 2023
3491dbb
Compute surface elevation using IFFT (#250)
mbruggs Jul 31, 2023
7845dd2
Dolfyn updates + turbulence analysis (#232)
jmcvey3 Aug 4, 2023
5e0aed8
Tidal power performance (#236)
jmcvey3 Aug 11, 2023
ae2e8bd
Release to pypi github actions workflow (#243)
maxwelllevin Aug 11, 2023
d2a2b66
MHKiT 0.7.0 (#256)
ssolson Aug 11, 2023
f156ffc
Auto PyPi (#257)
ssolson Aug 11, 2023
48af23a
Update the Package (#258)
ssolson Aug 11, 2023
a07ecc4
Auto Publish to PyPi Failed (#259)
ssolson Aug 11, 2023
3c9e090
merge
ssolson Aug 16, 2023
8b61d29
Merge branch 'develop' of https://github.com/MHKiT-Software/MHKiT-Pyt…
ssolson Aug 17, 2023
0fdb640
Merge mhkit `master` into `develop`
ssolson Aug 18, 2023
1c2737a
V07 doc updates (#263)
akeeste Aug 29, 2023
3e66f8f
V07 doc updates (#264)
akeeste Aug 29, 2023
c28f0cc
Merge branch 'master' of https://github.com/MHKiT-Software/MHKiT-Pyth…
ssolson Aug 30, 2023
1284a1a
Merge pull request #266 from ssolson/develop
ssolson Aug 31, 2023
f2c411c
minor linting, module docstring, update parameter validation
akeeste Oct 10, 2023
8db27f5
Improve Testing Time (#241)
ssolson Oct 12, 2023
a82bc3f
Run hindcast tests only on change to hindcast module (#270)
ssolson Oct 16, 2023
58118df
fix upcrossing docstring
akeeste Oct 18, 2023
a7030cc
Merge branch 'develop' of https://github.com/MHKiT-Software/MHKiT-Pyt…
akeeste Oct 18, 2023
234e76a
move upcrossing module to utils
akeeste Oct 18, 2023
4427863
update upcrossing import in example
akeeste Oct 18, 2023
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
139 changes: 116 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Py 3.7 3.8, 3.9 | Windows Mac Linux
name: Py 3.8, 3.9 | Windows Mac Linux

on:
push:
Expand All @@ -9,16 +9,94 @@ on:
branches:
- master
- develop

jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
wave_io_hindcast_changed: ${{ steps.changes.outputs.wave_io_hindcast }}
should-run-hindcast: ${{ steps.hindcast-logic.outputs.should-run-hindcast }}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check for changes in wave/io/hindcast
id: changes
uses: dorny/paths-filter@v2
with:
filters: |
wave_io_hindcast:
- 'mhkit/tests/wave/io/hindcast/**'

- id: hindcast-logic
run: |
if [[ "${{ github.event.pull_request.base.ref }}" == "master" || "${{ steps.changes.outputs.wave_io_hindcast }}" == "true" ]]; then
echo "::set-output name=should-run-hindcast::true"
else
echo "::set-output name=should-run-hindcast::false"
fi

prepare-cache:
needs: [check-changes]
runs-on: ubuntu-latest
env:
PYTHON_VER: 3.9
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
activate-conda: false
conda-channels: conda-forge

- name: Python setup
shell: bash -l {0}
run: |
conda create --name TEST python=${{ env.PYTHON_VER }} numpy cython pip hdf5 libnetcdf cftime netcdf4 --strict-channel-priority
source activate TEST
export PATH="${CONDA_PREFIX}/bin:${CONDA_PREFIX}/Library/bin:$PATH" # so setup.py finds nc-config
pip install -e . --no-deps --force-reinstall

- name: Install dependencies
shell: bash -l {0}
run: |
source activate TEST
python -m pip install --upgrade pip wheel
pip install coverage pytest coveralls .

- name: Prepare data
run: |
source activate TEST
pytest mhkit/tests/river/test_io.py
pytest mhkit/tests/tidal/test_io.py
pytest mhkit/tests/wave/io/test_cdip.py

- name: Prepare Hindcast data
if: (needs.check-changes.outputs.should-run-hindcast == 'true')
run: |
# pytest tests/test_specific_file.py::TestClass::test_function
source activate TEST
pytest mhkit/tests/wave/io/hindcast/test_hindcast.py
pytest mhkit/tests/wave/io/hindcast/test_wind_toolkit.py

- name: Upload data as artifact
uses: actions/upload-artifact@v2
with:
name: data
path: ~/.cache/mhkit

conda-build:
name: conda-${{ matrix.os }}/${{ matrix.python-version }}
needs: [prepare-cache]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]
env:
PYTHON_VER: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2
Expand All @@ -32,20 +110,23 @@ jobs:
- name: Python ${{ matrix.python-version }}
shell: bash -l {0}
run: |
conda create --name TEST python=${{ matrix.python-version }} numpy cython pip pytest hdf5 libnetcdf cftime netcdf4 --strict-channel-priority
conda create --name TEST python=${PYTHON_VER} numpy cython pip hdf5 libnetcdf cftime netcdf4 --strict-channel-priority
source activate TEST
export PATH="${CONDA_PREFIX}/bin:${CONDA_PREFIX}/Library/bin:$PATH" # so setup.py finds nc-config
pip install -e . --no-deps --force-reinstall

- name: Tests
- name: Install dependencies
shell: bash -l {0}
run: |
source activate TEST
python -m pip install --upgrade pip wheel
pip install coverage
pip install pytest
pip install coveralls
pip install .
pip install coverage pytest coveralls .

- name: Download data from artifact
uses: actions/download-artifact@v2
with:
name: data
path: ~/.cache/mhkit

- name: Run pytest
shell: bash -l {0}
Expand All @@ -65,6 +146,7 @@ jobs:

pip-build:
name: pip-${{ matrix.os }}/${{ matrix.python-version }}
needs: [prepare-cache]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -83,13 +165,16 @@ jobs:
- name: Set up Git repository
uses: actions/checkout@v2

- name: Download data from artifact
uses: actions/download-artifact@v2
with:
name: data
path: ~/.cache/mhkit

- name: Update and install packages
run: |
python -m pip install --upgrade pip wheel
pip install coverage
pip install pytest
pip install coveralls
pip install .
pip install coverage pytest coveralls .

- name: Run pytest
run: |
Expand All @@ -104,13 +189,16 @@ jobs:

hindcast-calls:
name: hindcast-${{ matrix.os }}/${{ matrix.python-version }}
needs: [check-changes, prepare-cache]
if: (needs.check-changes.outputs.should-run-hindcast == 'true')

runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
fail-fast: false
matrix:
os: ["windows-latest", "macos-latest"]
python-version: [3.9]
os: ["windows-latest", "macos-latest", "ubuntu-latest"]
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -129,18 +217,18 @@ jobs:
export PATH="${CONDA_PREFIX}/bin:${CONDA_PREFIX}/Library/bin:$PATH" # so setup.py finds nc-config
pip install -e . --no-deps --force-reinstall

- name: Install MHKiT
shell: bash -l {0}
run: |
source activate TEST
python -m pip install --upgrade pip wheel
pip install coveralls
pip install .
- name: Download data from artifact
uses: actions/download-artifact@v2
with:
name: data
path: ~/.cache/mhkit

- name: Run pytest
- name: Install MHKiT and run pytest
shell: bash -l {0}
run: |
source activate TEST
python -m pip install --upgrade pip wheel
pip install coveralls .
coverage run --rcfile=.github/workflows/.coveragehindcastrc -m pytest -c .github/workflows/pytest-hindcast.ini

- name: Upload coverage data to coveralls.io
Expand All @@ -156,6 +244,11 @@ jobs:
coveralls:
name: Indicate completion to coveralls.io
needs: [conda-build, pip-build, hindcast-calls]
if: |
always() &&
needs.conda-build.result == 'success' &&
needs.pip-build.result == 'success' &&
(needs.hindcast-calls.result == 'success' || needs.hindcast-calls.result == 'skipped')
runs-on: ubuntu-latest
container: python:3-slim
steps:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Builds mhkit and publishes to testpypi.org on every commit to master. On tagged commits, also publishes to pypi.org.
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: Build and release 🐍 📦

on:
push:
branches:
- master
release:
types: [published]

jobs:
build-and-publish:
name: Build and release 🐍 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-python@v2
with:
python-version: 3.8

- run: python -m pip install build --user
- run: python -m build --sdist --wheel --outdir dist/ .

- name: Upload to Test PyPI
if: github.event_name != 'release' && github.repository_owner == 'MHKiT-Software'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true

- name: Upload to PyPI (tagged release only)
if:
github.repository_owner == 'MHKiT-Software' && github.event_name == 'release' &&
github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $ cat .gitignore
*.swp
*.tws
*~
*.png

# Directories
**/__pycache__/
Expand All @@ -32,3 +33,6 @@ $ cat .gitignore
# Exemptions
!**/examples/data/wave/*.mat
!**/tests/data/wave/*.mat

# Files created during tests
mhkit/tests/wave/plots/
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
![](figures/logo.png) MHKiT-Python
=====================================

[![Py 3.8,3.9 | Windows Mac Linux](https://github.com/MHKiT-Software/MHKiT-Python/actions/workflows/main.yml/badge.svg)](https://github.com/MHKiT-Software/MHKiT-Python/actions/workflows/main.yml)
[![Coverage Status](https://coveralls.io/repos/github/MHKiT-Software/MHKiT-Python/badge.svg?branch=master)](https://coveralls.io/github/MHKiT-Software/MHKiT-Python?branch=master)
[![Downloads](https://pepy.tech/badge/mhkit)](https://pepy.tech/project/mhkit)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3924683.svg)](https://doi.org/10.5281/zenodo.3924683)

<p align="left">
<a href=https://github.com/MHKiT-Software/MHKiT-Python/actions/workflows/main.yml>
<img src="https://github.com/MHKiT-Software/MHKiT-Python/actions/workflows/main.yml/badge.svg">
</a>
<a href=https://coveralls.io/github/MHKiT-Software/MHKiT-Python?branch=master>
<img src="https://coveralls.io/repos/github/MHKiT-Software/MHKiT-Python/badge.svg?branch=master">
</a>
<a href=https://pepy.tech/project/mhkit>
<img src="https://pepy.tech/badge/mhkit">
</a>
<a href=https://doi.org/10.5281/zenodo.3924683>
<img src="https://zenodo.org/badge/DOI/10.5281/zenodo.3924683.svg">
</a>
</p>

MHKiT-Python is a Python package designed for marine renewable energy applications to assist in
data processing and visualization. The software package include functionality for:
Expand Down
Loading