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

Fix Failing Actions #148

Merged
merged 25 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2c556bd
Actions: Update numpy version on windows
simmsa Dec 4, 2024
b7ce780
Actions: Prepend dynamic library path with conda lib dir
simmsa Dec 4, 2024
bfe70c7
Actions: Print d3d.get_all_time result and type
simmsa Dec 4, 2024
e051a46
Actions: Convert `d3d.get_all_time` output to a list
simmsa Dec 4, 2024
b64ac67
Actions: Use numpy 1.24.4 on unix
simmsa Dec 4, 2024
50b9fbd
Actions: Use `py.list` to convert `d3d.get_all_time` np array to list
simmsa Dec 4, 2024
7303700
Actions: Use `py.numpy.ndarray` to coerce `d3d.get_all_time` to np array
simmsa Dec 4, 2024
929745a
Actions: Don't try to display class of Python type
simmsa Dec 4, 2024
5106d0f
Actions: Debug `d3d.get_all_time` result output
simmsa Dec 4, 2024
d63ca81
Actions: Remove get_all_time debugging
simmsa Dec 4, 2024
47f50d6
Actions: Fully cleanup delft_3d_get_all_time
simmsa Dec 4, 2024
08ec582
Actions: Use newer numpy on windows
simmsa Dec 4, 2024
44157a6
Actions: Revert to numpy 1.24.4 on windows
simmsa Dec 4, 2024
c137e7b
Actions: Definitively convert `d3d.get_all_time` result to py list
simmsa Dec 4, 2024
f7b6e7c
Delft3d: Convert masked array output to floats
simmsa Dec 4, 2024
8d10b3d
Actions: Install openssl using conda
simmsa Dec 4, 2024
0e32f29
Actions: Install openssl with brew and force MATLAB to use it
simmsa Dec 4, 2024
d8a696f
Actions: Use correct version of macos in openssl conditionals
simmsa Dec 4, 2024
97c259b
Actions: Remove direct calls to `matlab`
simmsa Dec 4, 2024
0e61e08
Actions: Correctly use conda ssl path
simmsa Dec 6, 2024
822f661
Actions: MacOS - Install a specific openssl version with conda
simmsa Dec 6, 2024
2ae226e
Actions: Conditionally install openssl 3.0.* on MacOS
simmsa Dec 6, 2024
4c602c4
Actions: Clean up unused DYLD_LIBRARY_PATH manipulation
simmsa Dec 6, 2024
7ea3a36
Actions: Clean up unused code in Unix action
simmsa Dec 6, 2024
85a2558
Actions: Clean up unused code in Windows action
simmsa Dec 6, 2024
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
78 changes: 14 additions & 64 deletions .github/workflows/unix_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,10 @@ jobs:
run: |
conda activate mhkit_conda_env
conda install numpy==1.24.4 cython pip pytest hdf5 libnetcdf cftime netcdf4
# conda install netcdf4 hdf5
# export PATH="${CONDA_PREFIX}/bin:${CONDA_PREFIX}/Library/bin:$PATH" # so setup.py finds nc-config

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

# - name: Check out MHKiT-Python
# uses: actions/checkout@v4
# with:
# repository: "MHKiT-Software/MHKiT-Python"
# path: ${{env.mhkit-python-dir}}

# - name: pip install mhkit module from source
# shell: bash -l {0}
# run: |
# conda activate mhkit_conda_env
# pip install -e .
# working-directory: ${{env.mhkit-python-dir}}

- name: pip install mhkit from pypi
shell: bash -l {0}
run: |
Expand Down Expand Up @@ -204,12 +189,6 @@ jobs:
- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4

# - name: Check out MHKiT-Python
# uses: actions/checkout@v4
# with:
# repository: "MHKiT-Software/MHKiT-Python"
# path: ${{env.mhkit-python-dir}}

- name: Install & Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -225,41 +204,6 @@ jobs:
run: |
conda activate mhkit_conda_env
conda install numpy==1.24.4 cython pip pytest hdf5 libnetcdf cftime netcdf4
# conda install netcdf4 hdf5
# export PATH="${CONDA_PREFIX}/bin:${CONDA_PREFIX}/Library/bin:$PATH" # so setup.py finds nc-config

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

# - name: Setup MHKiT Dependencies on macOS
# if: ${{ matrix.os == 'macos-13' }}
# run: brew install hdf5 netcdf

# - name: Setup MHKiT Dependencies on ubuntu
# run: sudo apt install libhdf5-serial-dev libnetcdf-dev
# if: ${{ matrix.os == 'ubuntu-latest' }}

# - name: Setup MHKiT Dependencies on ubuntu
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# sudo apt update
# sudo apt upgrade
# sudo apt install build-essential

# - name: Print GCC Version
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: |
# gcc --version
# g++ --version

# - name: Setup MATLAB Path on Ubuntu
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: echo "export LD_LIBRARY_PATH=/usr/local/MATLAB/${{ matrix.matlab-version }}/sys/os/glnxa64" >> "$GITHUB_ENV"

- name: Setup MATLAB Path on Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand All @@ -277,14 +221,6 @@ jobs:
conda activate mhkit_conda_env
python --version

# - name: pip install mhkit module from source
# working-directory: ${{env.mhkit-python-dir}}
# shell: bash -l {0}
# run: |
# conda activate mhkit_conda_env
# export PATH="${CONDA_PREFIX}/bin:${CONDA_PREFIX}/Library/bin:$PATH" # so setup.py finds nc-config
# pip install -e .

- name: pip install mhkit from pypi
shell: bash -l {0}
run: |
Expand Down Expand Up @@ -345,6 +281,16 @@ jobs:
with:
release: ${{ matrix.matlab-version }}

- name: Configure OpenSSL for MacOS/MATLAB
if: matrix.os == 'macos-13'
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
conda install openssl=="3.0.*"
CONDA_LIB_PATH=$(python -c "import sys; import os; print(os.path.join(os.path.dirname(sys.executable), 'lib'))")
export DYLD_LIBRARY_PATH="$CONDA_LIB_PATH:$DYLD_LIBRARY_PATH"
echo "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" >> $GITHUB_ENV

- name: Add Python Dir to Path
shell: bash -l {0}
run: |
Expand All @@ -357,6 +303,10 @@ jobs:
run: |
conda activate mhkit_conda_env
printf 'pyenv(Version="%s", ExecutionMode="OutOfProcess")\n' $(python -c "import sys; print(sys.executable)") >> run.m
# Pass dynamic library paths to MATLAB only on macOS
if [[ $OSTYPE == "darwin"* ]]; then
echo "setenv('DYLD_LIBRARY_PATH', getenv('DYLD_LIBRARY_PATH'));" >> run.m
fi

- name: Add MATLAB test commands
shell: bash
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ jobs:
- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4

# - name: Check out MHKiT-Python
# uses: actions/checkout@v4
# with:
# repository: "MHKiT-Software/MHKiT-Python"
# path: ${{env.mhkit-python-dir}}

# - name: pip install mhkit from source
# working-directory: ${{env.mhkit-python-dir}}
# run: |
# conda activate mhkit_conda_env
# pip3 install -e .

- name: pip install mhkit from pypi
shell: bash -l {0}
run: |
Expand Down Expand Up @@ -194,18 +182,6 @@ jobs:
- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4

# - name: Check out MHKiT-Python
# uses: actions/checkout@v4
# with:
# repository: "MHKiT-Software/MHKiT-Python"
# path: ${{env.mhkit-python-dir}}

# - name: pip install mhkit from source
# working-directory: ${{env.mhkit-python-dir}}
# run: |
# conda activate mhkit_conda_env
# pip3 install -e .

- name: pip install mhkit from pypi
shell: bash -l {0}
run: |
Expand Down
22 changes: 17 additions & 5 deletions mhkit/river/IO/delft_3d/delft_3d_get_all_time.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if ~isa(delft_3d_py_object, 'py.netCDF4._netCDF4.Dataset')
error('MATLAB:delft_3d_get_all_time:InvalidInput', ...
'Invalid input Delft3D data type: `delft_3d_get_all_time` expects a `py.netCDF4._netCDF4.Dataset` object. Please use the `delft_3d_open_netcdf` function to convert Delft3D netCDF files for use with this function.');
end
if ~isa(delft_3d_py_object, 'py.netCDF4._netCDF4.Dataset')
error('MATLAB:delft_3d_get_all_time:InvalidInput', ...
'Invalid input Delft3D data type: `delft_3d_get_all_time` expects a `py.netCDF4._netCDF4.Dataset` object. Please use the `delft_3d_open_netcdf` function to convert Delft3D netCDF files for use with this function.');
end

python_result = py.mhkit.river.io.d3d.get_all_time(delft_3d_py_object);

result = double(python_result);
% Handle masked arrays using numpy.ma.getdata
if isa(python_result, 'py.numpy.ma.MaskedArray')
% Extract the underlying data
data_array = py.numpy.ma.getdata(python_result);
else
% Convert directly if not masked
data_array = py.numpy.array(python_result);
end

% Ensure data is of type float
float_array = data_array.astype('float');

result = double(float_array);
end
Loading