Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MHKiT-Python v0.9.0 Support #149

Merged
merged 93 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
5fde9bd
Clean: Remove unnecessary py.importlib.import_module statements
simmsa Dec 9, 2024
4664bbf
Wave: Remove `.values` accessor where in no longer works
simmsa Dec 9, 2024
9a80223
Actions: Enable MHKiT-Python 0.8.2
simmsa Dec 9, 2024
0c09133
Actions: Install mhkit-python via conda-forge
simmsa Dec 9, 2024
fe030b7
Actions: Fix conda install command on windows
simmsa Dec 9, 2024
168d5a3
Merge remote-tracking branch 'upstream/develop' into 2024-12-support-…
simmsa Dec 12, 2024
3a44625
Clean: Remove unnecessary python import statements
simmsa Dec 12, 2024
03ad749
Actions: Update cache population versions on Windows
simmsa Dec 13, 2024
9dacfef
Actions: Specify mhkit version when installing with conda
simmsa Dec 13, 2024
a8550a9
Actions: Fix - use string for python version 3.10
simmsa Dec 13, 2024
0aed114
Actions; Update MATLAB version in Unix cache_population job
simmsa Dec 13, 2024
090cbd6
Actions: MacOS - Specify mhkit version when installing with conda
simmsa Dec 13, 2024
4ea558b
Actions: Use bash shell on windows conda install command
simmsa Dec 13, 2024
11c1e6e
Actions: Bump python version on unix cache_population job
simmsa Dec 13, 2024
b6e5b51
Actions: Use bash shell to install mhkit-python-utils
simmsa Dec 13, 2024
e3e62cb
Actions: List python packages with conda and pip `list`
simmsa Dec 13, 2024
0ca3fbc
Feat: Initial version of matlab/python type standardization
simmsa Jan 30, 2025
ff203f8
Feat: Add function to sanitize fieldnames from raw string
simmsa Jan 30, 2025
0d590e4
Actions: Improve windows action readability
simmsa Jan 30, 2025
d399c3b
Clean: Remove unnecessary python imports
simmsa Jan 30, 2025
1032515
Clean: Remove unnecessary python imports
simmsa Jan 30, 2025
50bac55
Fix: Remove unused rated_current argument
simmsa Jan 30, 2025
48f6156
Tests: Specify rectwin arg as an int
simmsa Jan 30, 2025
2d1a5fd
Tests: Improve readability
simmsa Jan 30, 2025
2a2b4e3
Tests: Remove deprecated `test_bretschneider_spectrum`
simmsa Jan 30, 2025
4a6aea9
Wave: Use `typecast_spectra_to_mhkit_python`
simmsa Jan 30, 2025
a84053a
Tests: Temporarily disable hindcast testing
simmsa Jan 30, 2025
15c973f
Fix: Plot spectrum should calculate peak period
simmsa Jan 30, 2025
07f509a
Wave: Use typecasting to extract python spectrum output
simmsa Jan 30, 2025
575fe2e
Wave: Typecast capture_length python output
simmsa Jan 30, 2025
0fcfe80
Wave: Typecast capture_length_matrix output
simmsa Jan 30, 2025
19f6893
Wave: Simplify MAEP type conversion
simmsa Jan 30, 2025
aeee104
Wave: Iterate over spectra explicitly
simmsa Jan 30, 2025
8c78d21
Wave: Simplify typecasting in `surface_elevation`
simmsa Jan 30, 2025
5d6ffb9
Wave: Simplify wave_number type conversion
simmsa Jan 30, 2025
ed1d86e
Actions: Set LD_LIBRARY_PATH on unix
simmsa Jan 30, 2025
668c786
Actions: Verify mhkit installs correctly on unix
simmsa Jan 30, 2025
9baa257
Clean: Remove debug print statement
simmsa Jan 30, 2025
90252dd
Wave: Typecast `wave_number`
simmsa Jan 30, 2025
42a4d32
Tests: Transpose frequency columns
simmsa Jan 30, 2025
f67696d
Wave: Typecast mhkit python result
simmsa Jan 30, 2025
24f09f6
Wave: Typecast surface elevation result
simmsa Jan 30, 2025
3d3300c
Actions: Setup library paths on unix
simmsa Jan 30, 2025
fa1b5f7
Actions: Try different methods to force python to load correctly
simmsa Jan 31, 2025
4ab9305
Actions: Use macos for unix cache population job
simmsa Jan 31, 2025
045d5b3
Actions: Don't modify DYLD_LIBRARY_PATH on unix population
simmsa Jan 31, 2025
a11d2bb
Tests: Convert mler validation data to row wise
simmsa Jan 31, 2025
06c2683
Actions: Install MATLAB first on unix
simmsa Jan 31, 2025
40a4ef0
Clean: Remove unnecessary `TestTags`
simmsa Jan 31, 2025
4385965
Actions: Don't set any library paths
simmsa Jan 31, 2025
24ea8ec
Actions: Revert to working unix actions with version bump
simmsa Jan 31, 2025
cf8d777
Tests: Disable `test_bin_statistics`
simmsa Jan 31, 2025
13d494e
Fix: Extra print statements for missing semicolon
simmsa Jan 31, 2025
58bd723
Clean: Fix EOL
simmsa Jan 31, 2025
f6c904a
Wave: typecast frequency moment result
simmsa Jan 31, 2025
3c9907b
Tests: Reenable Hindcast Tests
simmsa Jan 31, 2025
8cbce3f
Tests: Temporarily disable failing loads tests
simmsa Jan 31, 2025
419ebc9
Fix: Unnecessary accessor on scalar
simmsa Jan 31, 2025
cbb1fcb
Clean: Remove debug print statement
simmsa Jan 31, 2025
b34008f
Wave: Typecast surface elevation result
simmsa Jan 31, 2025
58953ca
Actions: Bump MHKiT-Python to latest version
simmsa Jan 31, 2025
b735b96
Fix: Unnecessary accessor on scalar
simmsa Jan 31, 2025
74bb088
Tests: Disable questionable surface elevation tests
simmsa Jan 31, 2025
2820800
Clean: Fix missing semicolon
simmsa Jan 31, 2025
cb63f41
Actions: Use MHKiT-Python 0.9.0 in all builds
simmsa Jan 31, 2025
23138d5
Actions: Deprecate Python 3.8 and 3.9
simmsa Jan 31, 2025
1273bc3
Actions: Update test matrix for MHKiT-Python 0.9.0
simmsa Jan 31, 2025
51d7f0c
Fix: Correctly typecast `damage_equivalent_load` inputs
simmsa Jan 31, 2025
b75f155
Tests: reenable `test_damage_equivalent_loads`
simmsa Jan 31, 2025
b9fdaf9
Actions: Install latest numpy on unix
simmsa Jan 31, 2025
7c34043
Fix: Correctly check for multiple array type instances
simmsa Jan 31, 2025
2b99ede
Types: Convert array to np.array
simmsa Jan 31, 2025
eeeb28d
Tests: Disable test_mler_coefficients
simmsa Jan 31, 2025
d300601
Types: Improve `typecast_spectra_to_mhkit_python` documentation
simmsa Jan 31, 2025
44138e6
Actions: Bump unix scipy version to 1.11.4
simmsa Jan 31, 2025
21fe785
Actions: Bump scipy to 1.12.0 on unix
simmsa Jan 31, 2025
91d933b
Types: Ensure that typecast_spectra_to_mhkit_python works with 2d arrays
simmsa Jan 31, 2025
1894373
Docs: Remove MHKiT-Python 0.7.0 note
simmsa Jan 31, 2025
3bc2ef7
Docs: Update MATLAB/Python Compatibility Table
simmsa Jan 31, 2025
3b055ab
Docs: Update test matrices
simmsa Jan 31, 2025
db50cd6
Actions: Clean up old matrix exclusions
simmsa Jan 31, 2025
7a051a6
Fix: Don't change importlib in this PR
simmsa Jan 31, 2025
3e7c28d
Actions: Add `defaults` to miniconda channel
simmsa Jan 31, 2025
fbeb4aa
Actions: Don't pin scipy on unix
simmsa Jan 31, 2025
21b907f
Actions: Reeanble Scipy downgrade on unix
simmsa Feb 3, 2025
c968d99
Actions: Disable unix, macos-13, Py 3.12, R2024b
simmsa Feb 3, 2025
195f763
Merge remote-tracking branch 'upstream/develop' into 2024-12-support-…
simmsa Feb 3, 2025
6517f42
Updates the mhkit_python_utils/__init__.py file
MShabara Feb 10, 2025
4377099
clears the tmp structure
MShabara Feb 11, 2025
fe5adcd
formating change
MShabara Feb 11, 2025
4839959
formating change
MShabara Feb 11, 2025
cd9b4ad
formating change
MShabara Feb 11, 2025
93722df
removes commented lines
MShabara Feb 11, 2025
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
80 changes: 27 additions & 53 deletions .github/workflows/unix_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

env:
mhkit-python-dir: "MHKiT-Python"
MHKIT_PYTHON_VERSION: '0.7.0'
MHKIT_PYTHON_VERSION: '0.9.0'
steps:
- name: Install & Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -29,13 +29,13 @@ jobs:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: mhkit_conda_env
channels: conda-forge
channels: conda-forge,defaults

- name: "Conda install netcdf4, hdf5"
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
conda install numpy==1.24.4 cython pip pytest hdf5 libnetcdf cftime netcdf4
conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4

- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4
Expand All @@ -57,7 +57,7 @@ jobs:
run: |
conda activate mhkit_conda_env
pip uninstall -y scipy
pip install scipy==1.10.1
pip install scipy==1.12.0

- name: List installed pip modules
shell: bash -l {0}
Expand Down Expand Up @@ -121,64 +121,38 @@ jobs:
strategy:
fail-fast: false

# Expecting 2 * 4 * 7 - (13 * 2) = 30 jobs
matrix:
os: [macos-13, ubuntu-latest]
python-version: [3.8, 3.9, "3.10", 3.11]
python-version: ["3.10", 3.11, 3.12]
# Note: It is preferred to use an actual release name as opposed to 'latest'
matlab-version: [R2021b, R2022a, R2022b, R2023a, R2023b, R2024a]
mhkit-python-version: ["0.7.0"]
matlab-version: [R2022b, R2023a, R2023b, R2024a, R2024b]
mhkit-python-version: ["0.9.0"]
exclude:
- python-version: "3.10" # cache_population job
matlab-version: R2022b
os: ubuntu-latest
- matlab-version: R2024a # Non compatiable versions of Python and MATLAB
python-version: 3.8
# Python 3.12 + MATLAB incompatability
- matlab-version: R2024a
python-version: 3.12
- matlab-version: R2023b
python-version: 3.8
python-version: 3.12
- matlab-version: R2023a
python-version: 3.11
python-version: 3.12
- matlab-version: R2022b
python-version: 3.12
# Python 3.11 + MATLAB incompatability
- matlab-version: R2023a
python-version: 3.11
- matlab-version: R2022a
python-version: 3.11
- matlab-version: R2022a
python-version: "3.10"
- matlab-version: R2021b
python-version: 3.11
- matlab-version: R2021b
python-version: "3.10"
- matlab-version: R2021a
python-version: 3.11
- matlab-version: R2021a
python-version: "3.10"
- matlab-version: R2021a
python-version: 3.9
- matlab-version: R2020b
- matlab-version: R2022b
python-version: 3.11
- matlab-version: R2020b
python-version: "3.10"
- matlab-version: R2020b
python-version: 3.9
# Specific versions of tests that fail consistently. Most likely due to the GitHub actions environment
# - matlab-version: R2024a # Python netcdf4 pip build error: https://github.com/MHKiT-Software/MHKiT-MATLAB/actions/runs/8789749433/job/24123413351
# python-version: 3.11
# os: macos-13
# - matlab-version: R2024a # Working!
# python-version: "3.10"
# os: macos-13
# - matlab-version: R2024a # Java Segfault on Python initialization: https://github.com/MHKiT-Software/MHKiT-MATLAB/actions/runs/8789749433/job/24123411604
# python-version: 3.9
# os: macos-13
# - matlab-version: R2023b # Python netcd4 pip build error: https://github.com/MHKiT-Software/MHKiT-MATLAB/actions/runs/8789749433/job/24123412889
# python-version: 3.11
# os: macos-13
# - matlab-version: R2023b # Java segfault on Python initialization: https://github.com/MHKiT-Software/MHKiT-MATLAB/actions/runs/8789749433/job/24123412352
# python-version: "3.10"
# os: macos-13
# - matlab-version: R2023b # Java segfault on Python initialization: https://github.com/MHKiT-Software/MHKiT-MATLAB/actions/runs/8789749433/job/24123411335
# python-version: 3.9
# os: macos-13
# Specific MATLAB/Python/OS Errors
# Error using _cythonized_array_utils>init
# scipy.linalg._cythonized_array_utils (line 1)
# Python Error: ValueError: numpy.dtype size changed, may indicate binary
# incompatibility. Expected 96 from C header, got 88 from PyObject
- matlab-version: R2024b
python-version: 3.12
os: macos-13

runs-on: ${{ matrix.os }}

Expand All @@ -196,14 +170,14 @@ jobs:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: mhkit_conda_env
channels: conda-forge
channels: conda-forge,defaults

# This is necessary to fix any issues with netcdf4 and hdf5 headers
- name: "Conda install netcdf4, hdf5"
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
conda install numpy==1.24.4 cython pip pytest hdf5 libnetcdf cftime netcdf4
conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4

- name: Setup MATLAB Path on Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down Expand Up @@ -246,7 +220,7 @@ jobs:
run: |
conda activate mhkit_conda_env
pip uninstall -y scipy
pip install scipy==1.10.1
pip install scipy==1.12.0

- name: List installed pip modules
shell: bash -l {0}
Expand Down
109 changes: 53 additions & 56 deletions .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: [3.9]
matlab-version: [R2022a]
python-version: ["3.10"]
matlab-version: [R2023b]
runs-on: ${{ matrix.os }}

env:
mhkit-python-dir: "MHKiT-Python"
MHKIT_PYTHON_VERSION: '0.7.0'
MHKIT_PYTHON_VERSION: '0.9.0'
steps:
- name: Install/Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -27,33 +27,44 @@ jobs:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: mhkit_conda_env
channels: conda-forge
channels: conda-forge,defaults

# This is necessary to fix any issues with netcdf4 and hdf5 headers
- name: "Conda install netcdf4, hdf5"
- name: Conda install mhkit
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
conda install numpy==1.24.4 netcdf4 hdf5
conda install mhkit==$MHKIT_PYTHON_VERSION
- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4

- name: pip install mhkit from pypi
- name: pip install mhkit-python-utils module from source
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
pip install mhkit==$MHKIT_PYTHON_VERSION
pip install -e .

- name: pip install mhkit-python-utils module from source
- name: List Installed Python Packages using Conda
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
pip install -e .
conda list

- name: Pin scipy version
- name: List Installed Python Packages using pip
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
pip uninstall -y scipy
pip install scipy==1.10.1
pip list

- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4

# - name: Pin scipy version
# shell: bash -l {0}
# run: |
# conda activate mhkit_conda_env
# pip uninstall -y scipy
# pip install scipy==1.10.1

# Create the cache and add a dummy file
# The dummy file ensures that the artifact download
Expand All @@ -63,6 +74,7 @@ jobs:
mkdir mhkit_webread_cache
touch mhkit_webread_cache/test.txt
echo "Hello World" > mhkit_webread_cache/test.txt

- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
with:
Expand All @@ -73,10 +85,12 @@ jobs:
shell: pwsh
run: >
"pyenv(Version='{0}', ExecutionMode='OutOfProcess')" -f (python -c "import sys; print(sys.executable)") | Out-File -FilePath run.m

- name: Check Python System Path
shell: bash -l {0}
run: |
echo "py.sys.path" >> run.m

- name: Add MATLAB test commands
shell: bash
run: echo "version,
Expand Down Expand Up @@ -113,41 +127,29 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: [3.8, 3.9, "3.10", 3.11]
matlab-version: [R2021b, R2022a, R2022b, R2023a, R2023b, R2024a]
mhkit-python-version: ["0.7.0"]
python-version: ["3.10", 3.11, 3.12]
matlab-version: [R2022b, R2023a, R2023b, R2024a, R2024b]
mhkit-python-version: ["0.9.0"]
exclude:
# Cache population job
- matlab-version: R2022a
python-version: 3.9
- matlab-version: R2023b
python-version: 3.8
python-version: "3.10"
# - matlab-version: R2023b
# python-version: 3.8
# Python 3.12 + MATLAB incompatability
- matlab-version: R2024a
python-version: 3.12
- matlab-version: R2023b
python-version: 3.12
- matlab-version: R2023a
python-version: 3.11
python-version: 3.12
- matlab-version: R2022b
python-version: 3.12
# Python 3.11 + MATLAB incompatability
- matlab-version: R2023a
python-version: 3.11
- matlab-version: R2022a
python-version: 3.11
- matlab-version: R2022a
python-version: "3.10"
- matlab-version: R2021b
python-version: 3.11
- matlab-version: R2021b
python-version: "3.10"
- matlab-version: R2021a
python-version: 3.11
- matlab-version: R2021a
python-version: "3.10"
- matlab-version: R2021a
python-version: 3.9
- matlab-version: R2020b
- matlab-version: R2022b
python-version: 3.11
- matlab-version: R2020b
python-version: "3.10"
- matlab-version: R2020b
python-version: 3.9
- matlab-version: R2024a
python-version: 3.8
runs-on: ${{ matrix.os }}

env:
Expand All @@ -161,14 +163,14 @@ jobs:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: mhkit_conda_env
channels: conda-forge
channels: conda-forge,defaults

# This is necessary to fix any issues with netcdf4 and hdf5 headers
- name: "Conda install netcdf4, hdf5"
- name: Conda install mhkit
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
conda install numpy==1.24.4 netcdf4 hdf5
conda install mhkit==$MHKIT_PYTHON_VERSION
- name: Output python executable
shell: bash -l {0}
run: |
Expand All @@ -182,24 +184,19 @@ jobs:
- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4

- name: pip install mhkit from pypi
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
pip install mhkit==$MHKIT_PYTHON_VERSION
- name: pip install mhkit-python-utils module from source
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
pip3 install -e .

- name: Pin scipy version
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
pip uninstall -y scipy
pip install scipy==1.10.1

# - name: Pin scipy version
# shell: bash -l {0}
# run: |
# conda activate mhkit_conda_env
# pip uninstall -y scipy
# pip install scipy==1.10.1
#
- name: List installed pip modules
shell: bash -l {0}
run: |
Expand Down
Loading
Loading