Skip to content

Commit 2a25ba6

Browse files
authored
v1.0.0 develop into main
v1.0.0 # MHKiT v1.0.0 ## New Features * Sound Exposure Level by @jmcvey3 in MHKiT-Software#388 * Add discharge function to MHKiT by @jmcvey3 in MHKiT-Software#385 ## Functionality enhancements * Fix for corrupted Nortek files by @jmcvey3 in MHKiT-Software#372 * Update integral length scale function by @jmcvey3 in MHKiT-Software#376 * Fix ever-changing RDI RiverPro depth bin ranges by @jmcvey3 in MHKiT-Software#378 * Allow clean functions to handle _avg variables by @jmcvey3 in MHKiT-Software#377 * IEC TS 62600 updates by @akeeste in MHKiT-Software#382 * MLER explanation updates/corrections by @rgcoe in MHKiT-Software#393 * Improve Nortek2 index file creator functions by @jmcvey3 in MHKiT-Software#397 * Read Sentinel V specific data packets by @jmcvey3 in MHKiT-Software#396 * Short list of VMDAS updates by @jmcvey3 in MHKiT-Software#405 * Allow user to specify universal Kolmogorov constant for TKE dissipation rate function by @jmcvey3 in MHKiT-Software#406 * Nortek Dual Profile Dataset Rotation by @jmcvey3 in MHKiT-Software#414 ## Source code improvements * Lint Tidal by @ssolson in MHKiT-Software#386 * Lint river module by @ssolson in MHKiT-Software#389 * Lint hindcast by @ssolson in MHKiT-Software#398 * Modernize Package Configuration by @ssolson in MHKiT-Software#400 * Configure specific warnings by @ssolson in MHKiT-Software#401 ## Bug fixes * Avoid failing to scan very large files by @jmcvey3 in MHKiT-Software#371 * Acoustics SPL bugfix by @jmcvey3 in MHKiT-Software#379 * DOLfYN/RDI: Set `fs` to NaN when typical calculation methods yield error (MHKiT-Software#408) by @simmsa in MHKiT-Software#409 ## Testing and Continuous Integration Updates * Fix Jupyter Notebook tests running Python 3.13 by @ssolson in MHKiT-Software#380 * CI Test Clean Up: Mock USGS, Acoustic Tolerances by @ssolson in MHKiT-Software#404 * Speed up tests with concurrency checks to prevent duplicate workflows on PRs from develop into main or from main into develop by @akeeste * Define MPLBACKEND to decrease intermittent matplotlib errors in tests by @akeeste ## Documentation and Examples * Add WEC-Sim power performance example by @akeeste in MHKiT-Software#395 * Update dolfyn function docstrings and associated notebooks by @jmcvey3 in MHKiT-Software#412 * Update examples by @akeeste in MHKiT-Software#417 * Update installation instructions in README.md by @akeeste * Adjust acoustics test tolerances by @akeeste in MHKiT-Software#420 **Full Changelog**: MHKiT-Software/MHKiT-Python@v0.9.0...v1.0.0
2 parents bc1eadc + fe6cd10 commit 2a25ba6

File tree

150 files changed

+16971
-6959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+16971
-6959
lines changed

.github/workflows/main.yml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
name: Py 3.10, 3.11, 3.12 | Windows Mac Linux
22

33
on:
4-
push:
4+
pull_request:
55
branches:
66
- main
77
- develop
8-
pull_request:
8+
push:
99
branches:
1010
- main
1111
- develop
1212

13+
concurrency:
14+
group: ${{ github.event.pull_request.number }} # Use the pull request number as the concurrency group
15+
cancel-in-progress: true # Cancel any in-progress jobs for the same group. Prevents duplicate workflows on PRs from develop into main or from main into develop.
16+
1317
jobs:
1418
set-os:
1519
runs-on: ubuntu-latest
@@ -83,7 +87,7 @@ jobs:
8387
shell: bash -l {0}
8488
run: |
8589
conda activate mhkit-env
86-
pip install -e . --no-deps
90+
pip install -e ".[all,dev]" --no-deps
8791
8892
- name: Prepare non-hindcast API data
8993
shell: bash -l {0}
@@ -134,7 +138,7 @@ jobs:
134138
shell: bash -l {0}
135139
run: |
136140
conda activate mhkit-env
137-
pip install -e . --no-deps
141+
pip install -e ".[all,dev]" --no-deps
138142
139143
- name: Prepare Wave Hindcast data
140144
shell: bash -l {0}
@@ -183,7 +187,7 @@ jobs:
183187
shell: bash -l {0}
184188
run: |
185189
conda activate mhkit-env
186-
pip install -e . --no-deps
190+
pip install -e ".[all,dev]" --no-deps
187191
188192
- name: Prepare Wind Hindcast data
189193
shell: bash -l {0}
@@ -286,7 +290,7 @@ jobs:
286290
shell: bash -l {0}
287291
run: |
288292
python -m pip install --upgrade pip wheel
289-
pip install coverage pytest coveralls .
293+
pip install -e ".[all,dev]"
290294
291295
- name: Install setuptools for Python 3.12
292296
if: matrix.python-version == '3.12'
@@ -354,7 +358,7 @@ jobs:
354358
shell: bash -l {0}
355359
run: |
356360
conda activate mhkit-env
357-
pip install -e . --no-deps
361+
pip install -e ".[all,dev]" --no-deps
358362
359363
- name: Download Wave Hindcast data from artifact
360364
uses: actions/download-artifact@v4
@@ -390,6 +394,41 @@ jobs:
390394
parallel: true
391395
path-to-lcov: ./coverage.lcov
392396

397+
test-optional-pip-dependencies:
398+
needs: [set-os, prepare-nonhindcast-cache]
399+
runs-on: ubuntu-latest
400+
strategy:
401+
matrix:
402+
module:
403+
[wave, tidal, river, dolfyn, power, loads, mooring, acoustics, utils]
404+
python-version: ['3.12']
405+
406+
steps:
407+
- uses: actions/checkout@v4
408+
409+
- name: Set up Python ${{ matrix.python-version }}
410+
uses: actions/setup-python@v5
411+
with:
412+
python-version: ${{ matrix.python-version }}
413+
414+
- name: Download non-hindcast data
415+
uses: actions/download-artifact@v4
416+
with:
417+
name: data
418+
path: ~/.cache/mhkit
419+
420+
- name: Install MHKiT with optional dependency
421+
run: |
422+
python -m pip install --upgrade pip
423+
pip install "mhkit[${{ matrix.module }}]"
424+
pip install pytest
425+
426+
- name: Run tests for ${{ matrix.module }}
427+
env:
428+
MPLBACKEND: Agg
429+
run: |
430+
python -m pytest -c .github/workflows/pytest.ini mhkit/tests/${{ matrix.module }}/
431+
393432
notebook-matrix:
394433
runs-on: ubuntu-latest
395434
needs:
@@ -455,7 +494,8 @@ jobs:
455494
with:
456495
miniconda-version: 'latest'
457496
auto-update-conda: true
458-
python-version: '3.11'
497+
python-version: '3.12'
498+
channels: conda-forge
459499
activate-environment: TESTconda
460500
use-only-tar-bz2: false
461501

@@ -475,7 +515,7 @@ jobs:
475515
shell: bash -l {0}
476516
run: |
477517
conda activate mhkit-env
478-
pip install -e . --no-deps
518+
pip install -e ".[all,dev]" --no-deps
479519
480520
- name: Download non-hindcast data
481521
uses: actions/download-artifact@v4

.github/workflows/pylint.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip wheel
21-
pip install pylint
22-
pip install .
21+
pip install ".[all,dev]"
2322
2423
- name: Run Pylint on mhkit/loads/
2524
run: |
@@ -36,3 +35,15 @@ jobs:
3635
- name: Run Pylint on mhkit/acoustics/
3736
run: |
3837
pylint mhkit/acoustics/
38+
39+
- name: Run Pylint on mhkit/tidal/
40+
run: |
41+
pylint mhkit/tidal/
42+
43+
- name: Run Pylint on mhkit/river/
44+
run: |
45+
pylint --extension-pkg-allow-list=netCDF4 mhkit/river/
46+
47+
- name: Run Pylint on mhkit/wave/io/hindcast/
48+
run: |
49+
pylint mhkit/wave/io/hindcast/

README.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,54 @@ See the [MHKiT documentation](https://mhkit-software.github.io/MHKiT) for more i
3232

3333
## Installation
3434

35-
MHKiT-Python requires Python (3.10, 3.11, 3.12) along with several Python
36-
package dependencies. MHKiT-Python can be installed using the Conda package manager:
35+
[MHKiT-Python](https://github.com/MHKiT-Software/MHKiT-Python) requires [Python (3.10-3.12)](https://www.python.org/).
36+
It is recommended to use the [Anaconda Python Distribution](https://www.anaconda.com/distribution/) (a fully featured Python installer with a GUI)
37+
or [Miniconda](https://docs.anaconda.com/miniconda/#quick-command-line-install) (a lightweight installer with the ``conda`` command line utility).
38+
Both will include most of MHKiT-Python's package dependencies.
39+
MHKiT can be installed several ways:
40+
41+
### Option 1: Install from Python
42+
43+
This option is recommended as a fast installation for MHKiT-Python users.
44+
To install MHKiT-Python using ``conda``, in an Anaconda Prompt:
45+
46+
```bash
47+
conda install -c conda-forge mhkit
48+
```
49+
50+
### Option 2: Clone Repository from GitHub
51+
52+
This option is recommended for MHKiT-Python users who want access to example notebooks and developers.
53+
Download and install your preferred version of [git](https://git-scm.com/).
54+
To clone MHKiT-Python:
3755

3856
```bash
39-
conda install -c conda-forge mhkit
57+
git clone https://github.com/MHKiT-Software/MHKiT-Python
58+
cd MHKiT-Python
4059
```
4160

42-
MHKiT can alternatively be installed from PyPi using pip:
61+
To install a local, editable version of MHKiT-Python using [pip](https://pip.pypa.io/en/stable/):
4362

4463
```bash
45-
pip install mhkit
64+
pip install -e .["all"]
4665
```
4766

67+
An [environment YAML file](https://github.com/MHKiT-Software/MHKiT-Python/blob/main/environment.yml) is also provided that can create the base environment required by MHKiT.
68+
MHKiT can then be installed into that environment using any of the provided methods.
69+
70+
### Option 3: Module-specific Install from Python
71+
72+
A slim version of MHKiT-Python can be installed to reduce the number of dependencies and potential conflicts with other software.
73+
This installation utilizes pip's optional dependencies installation.
74+
To install a single MHKiT module, e.g. the wave module, and its dependencies, use:
75+
76+
pip install mhkit["wave"]
77+
78+
Note that ``pip install mhkit`` only installs the base MHKiT dependencies and not the entire software.
79+
To install all MHKiT dependencies use:
80+
81+
pip install mhkit["all"]
82+
4883
See [installation instructions](https://mhkit-software.github.io/MHKiT/installation.html) for more information.
4984

5085
## Copyright and license

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- python>=3.10
6+
- python>=3.10,<3.13
77
- pip
88
- numpy>=2.0.0
99
- pandas>=2.2.2
@@ -25,3 +25,4 @@ dependencies:
2525
- matplotlib>=3.9.1
2626
- fatpack
2727
- nrel-rex
28+
- cartopy

0 commit comments

Comments
 (0)