Skip to content

Commit f03302b

Browse files
authored
Merge branch 'develop' into main
2 parents bc1eadc + 56e86e8 commit f03302b

150 files changed

Lines changed: 16962 additions & 6956 deletions

File tree

Some content is hidden

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

.github/workflows/main.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
shell: bash -l {0}
8484
run: |
8585
conda activate mhkit-env
86-
pip install -e . --no-deps
86+
pip install -e ".[all,dev]" --no-deps
8787
8888
- name: Prepare non-hindcast API data
8989
shell: bash -l {0}
@@ -134,7 +134,7 @@ jobs:
134134
shell: bash -l {0}
135135
run: |
136136
conda activate mhkit-env
137-
pip install -e . --no-deps
137+
pip install -e ".[all,dev]" --no-deps
138138
139139
- name: Prepare Wave Hindcast data
140140
shell: bash -l {0}
@@ -183,7 +183,7 @@ jobs:
183183
shell: bash -l {0}
184184
run: |
185185
conda activate mhkit-env
186-
pip install -e . --no-deps
186+
pip install -e ".[all,dev]" --no-deps
187187
188188
- name: Prepare Wind Hindcast data
189189
shell: bash -l {0}
@@ -286,7 +286,7 @@ jobs:
286286
shell: bash -l {0}
287287
run: |
288288
python -m pip install --upgrade pip wheel
289-
pip install coverage pytest coveralls .
289+
pip install -e ".[all,dev]"
290290
291291
- name: Install setuptools for Python 3.12
292292
if: matrix.python-version == '3.12'
@@ -354,7 +354,7 @@ jobs:
354354
shell: bash -l {0}
355355
run: |
356356
conda activate mhkit-env
357-
pip install -e . --no-deps
357+
pip install -e ".[all,dev]" --no-deps
358358
359359
- name: Download Wave Hindcast data from artifact
360360
uses: actions/download-artifact@v4
@@ -390,6 +390,39 @@ jobs:
390390
parallel: true
391391
path-to-lcov: ./coverage.lcov
392392

393+
test-optional-pip-dependencies:
394+
needs: [set-os, prepare-nonhindcast-cache]
395+
runs-on: ubuntu-latest
396+
strategy:
397+
matrix:
398+
module:
399+
[wave, tidal, river, dolfyn, power, loads, mooring, acoustics, utils]
400+
python-version: ['3.12']
401+
402+
steps:
403+
- uses: actions/checkout@v4
404+
405+
- name: Set up Python ${{ matrix.python-version }}
406+
uses: actions/setup-python@v5
407+
with:
408+
python-version: ${{ matrix.python-version }}
409+
410+
- name: Download non-hindcast data
411+
uses: actions/download-artifact@v4
412+
with:
413+
name: data
414+
path: ~/.cache/mhkit
415+
416+
- name: Install MHKiT with optional dependency
417+
run: |
418+
python -m pip install --upgrade pip
419+
pip install "mhkit[${{ matrix.module }}]"
420+
pip install pytest
421+
422+
- name: Run tests for ${{ matrix.module }}
423+
run: |
424+
python -m pytest -c .github/workflows/pytest.ini mhkit/tests/${{ matrix.module }}/
425+
393426
notebook-matrix:
394427
runs-on: ubuntu-latest
395428
needs:
@@ -455,7 +488,8 @@ jobs:
455488
with:
456489
miniconda-version: 'latest'
457490
auto-update-conda: true
458-
python-version: '3.11'
491+
python-version: '3.12'
492+
channels: conda-forge
459493
activate-environment: TESTconda
460494
use-only-tar-bz2: false
461495

@@ -475,7 +509,7 @@ jobs:
475509
shell: bash -l {0}
476510
run: |
477511
conda activate mhkit-env
478-
pip install -e . --no-deps
512+
pip install -e ".[all,dev]" --no-deps
479513
480514
- name: Download non-hindcast data
481515
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)