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

RFC: Fix Unit Tests #108

Merged
merged 209 commits into from
Jan 8, 2024
Merged

RFC: Fix Unit Tests #108

merged 209 commits into from
Jan 8, 2024

Conversation

simmsa
Copy link
Contributor

@simmsa simmsa commented Nov 17, 2023

Status

  • Request for Comment
    • This pull request is open for comments and feedback. Please review the changes and provide any necessary input.

Summary of Changes

  • Continuation of ebbflood branch
  • Fix GitHub actions/workflow
    • Linux, macOS, and Windows Units are performing nominally
  • Fix/update failing unit tests where possible
    • 100% (151 / 151) of test cases are passing
  • Improve code style
  • Update toolbox to version 0.4.1

Detail of Changes

This PR

Actions/Workflow

  • Separate Unix (MacOS & Linux) and Windows unit tests into separate workflow files
  • Use Anaconda to install Python and required packages
  • Pass Anaconda version of python to MATLAB
  • Add version matrix of MATLAB and Python
    • Python: 3.8 - 3.11
    • MATLAB: R2021b to R2023b
    • Exclude Python/MATLAB combinations that are not supported
      • 15 different combinations on each operating system
    • Exclude combinations that are error out when calling Python from MATLAB
      • Windows MATLAB > 2022a
      • MacOS MATLAB latest
  • Add caching/artifact for hindcast data calls
    • This API is rate limited and the tests make successive requests causes intermittent failures in test_WPTO_point_multiloc and test_WPTO_point_multiparm.
    • Adds a cache_population job that runs a test with caching enable before the main job
      • Caches api call results in mhkit_webread_cache
      • main job reads in mhkit_webread_cache and uses the cache

Tests

Fixed Tests

This PR fixes or adds the following tests:

  • Loads_TestExtreme
  • QC_Test:
  • River_TestDevice
  • River_TestResource
    • test_exceedance_probability (cd0271d)
      • Setup Q as a struct with Discharge and time keys
  • Tidal_TestIO:
  • Tidal_TestResource:
    • test_plot_phase_exceedance (30ead68)
  • Wave_TestResourceMetrics:
  • Wave_TestResourceSpectrum
    • test_surface_elevation_seed (a0cb0ef)
    • test_surface_elevation_phasing (e2f6080)
    • test_surface_elevation_moments (b0d93bb)

Added Tests

  • Python_Import
    • Add test to verify Python import mhkit performs nominally
    • Add test to verify Python import pandas performs nominally
    • Add test to verify Python import h5py performs nominally
    • Add test to verify operation of MHKiT Python per Test MHKiT-Python installation
  • Python_IO
    • Add Tests to verify MATLAB -> Python -> MATLAB serialization for different types
      • This is a WIP/Proof of Concept
      • Finishing this is out of scope for this PR. Future work could/should include expanding these tests

Warnings

  • Fix warnings caused by importing python libraries that have functions with the same name as MATLAB functions (be70376)
    • Remove every call of py.importlib.import_module('numpy');
      • This imports all numpy functions into the global namespace and matplotlib gives the following warning for every function
        • [Warning: The name '<numpy function>' is already in use as a method name. This will become an error in a future release.]

Deprecated Tests

The following tests are not compatible with the latest versions of MHKiT-Python:

Note: Known failing tests use assertFail to force them to pass.

  • Wave_TestResourceMetrics:
    • test_environmental_contour
      • Not compatible with latest version of MHKiT Python
    • test_plot_environmental_contour
      • Not compatible with latest version of MHKiT Python
    • test_plot_environmental_contour_multiyear
      • Not compatible with latest version of MHKiT Python

Code Coverage

Style

  • Fix common spelling errors
  • Trims whitespace in all files
  • Convert files with dos line endings to unix line endings

Documentation

  • Update README and other documentation to reflect changes from the ebbflood branch and this PR
    • Add MATLAB/Python compatibility to README
    • Update Testing Badges
      • Add Linux and macOS Unit Test Badge
      • Add Windows Unit Test Badge

ebbflood Branch #101

Features

Bug Fixes

Other

Caveats

Windows Unit Tests

Deactivation of selected Windows Unit Tests (MATLAB > 2022a) is necessary for the following reasons:

MacOS Unit Tests

Deactivation of selected MacOS Unit Tests for Python 3.11 and MATLAB latest is necessary for the following reasons:

  • Throws the following error on every Python call from MATLAB (macos-latest, MATLAB latest, Python 3.11)
Python Error: ImportError:
      dlopen(/usr/local/miniconda/envs/TEST/lib/python3.11/site-packages/netCDF4/_netCDF4.cpython-311-darwin.so,
      0x0002): Symbol not found: (_SSL_get0_group_name)
        Referenced from: '/usr/local/miniconda/envs/TEST/lib/libcurl.4.dylib'
        Expected in:
        '/Users/runner/hostedtoolcache/MATLAB/2023.2.999/x64/MATLAB.app/bin/maci64/libssl.3.dylib'

Alex-McVey and others added 30 commits December 29, 2021 13:44
* wpto playground

* format changes

* upload temporary test script

* wpto extract with REST API

* fix directional wave spectrum bug

* upload hindcast example

* auto format time_index into datetime array

* add tests for hindcast

* remove temp file

* bug fix for available buoy data vs hindcast

* upload data

* moving test files into hindcast folder

* updating toolbox paths

* updating hindcast example

* Setup CI, v16.2, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.3, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.4, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.5, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.6, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.7, list installed toolboxes and addons

* Setup CI, v17, uninstall all pre-installed toolboxes

* Setup CI, v17.1, uninstall all pre-installed toolboxes

* Setup CI, v17.2, toggle off all pre-installed toolboxes

* Setup CI, v17.3, toggle off all pre-installed toolboxes

* Setup CI, v17.4, toggle off all pre-installed toolboxes

* Setup CI, v17.5, toggle off all pre-installed toolboxes

* Setup CI, v17.6, toggle off all pre-installed toolboxes

* Setup CI, v17.7, toggle off all pre-installed toolboxes

* Setup CI, v17.8, toggle off all pre-installed toolboxes

* Setup CI, v17.9, toggle off all pre-installed toolboxes

* Setup CI, v17.10, list installed addons and toolboxes

* Setup CI, v17.11, start uninstalling toolboxes

* Setup CI, v17.12, start uninstalling toolboxes

* Setup CI, v17.13, start uninstalling toolboxes

* Setup CI, v17.14, start uninstalling toolboxes

* Setup CI, v17.15, start uninstalling toolboxes

* Setup CI, v17.16, start uninstalling toolboxes

* Setup CI, v17.17, start uninstalling toolboxes

* Setup CI, v17.18, start uninstalling toolboxes

* Setup CI, v17.19, start uninstalling toolboxes

* Setup CI, v17.20, start uninstalling toolboxes

* Setup CI, v17.21, start uninstalling toolboxes

* Setup CI, v17.22, start uninstalling toolboxes

* Setup CI, v17.23, start uninstalling toolboxes

* Setup CI, v17.24, start uninstalling toolboxes

* Setup CI, v17.25, start uninstalling toolboxes

* Setup CI, v17.26, start uninstalling toolboxes

* Setup CI, v17.27, start uninstalling toolboxes

* Setup CI, v17.28, start uninstalling toolboxes

* Setup CI, v17.29, start uninstalling toolboxes

* Setup CI, v17.30, start uninstalling toolboxes

* Setup CI, v17.31, start uninstalling toolboxes

* Setup CI, v17.32, start uninstalling toolboxes

* Setup CI, v17.33, start uninstalling toolboxes

* Setup CI, v17.34, start uninstalling toolboxes

* Setup CI, v17.35, start uninstalling toolboxes

* Setup CI, v18, simplify to most basic test

* Setup CI, v19, install mhkit toolbox

* Setup CI, v20, run a single test that uses mhkit

* Setup CI, v21, run a single different test that uses mhkit

* Setup CI, v21.1, run a single different test that uses mhkit

* Setup CI, v21.2, run a single different test that uses mhkit

* Add function to reload python in matlab after python code changes

* Fix paths to python usgs and noaa functions

* Update pierson_moskowitz_spectrum wrapper with additional Hs parameter

* Update create_spectra with additional Hs parameter

* Update tests fixing mostly broken relative file paths

Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: Matthew Boyd <[email protected]>
* Setup CI, v16.2, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.3, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.4, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.5, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.6, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.7, list installed toolboxes and addons

* Setup CI, v17, uninstall all pre-installed toolboxes

* Setup CI, v17.1, uninstall all pre-installed toolboxes

* Setup CI, v17.2, toggle off all pre-installed toolboxes

* Setup CI, v17.3, toggle off all pre-installed toolboxes

* Setup CI, v17.4, toggle off all pre-installed toolboxes

* Setup CI, v17.5, toggle off all pre-installed toolboxes

* Setup CI, v17.6, toggle off all pre-installed toolboxes

* Setup CI, v17.7, toggle off all pre-installed toolboxes

* Setup CI, v17.8, toggle off all pre-installed toolboxes

* Setup CI, v17.9, toggle off all pre-installed toolboxes

* Setup CI, v17.10, list installed addons and toolboxes

* Setup CI, v17.11, start uninstalling toolboxes

* Setup CI, v17.12, start uninstalling toolboxes

* Setup CI, v17.13, start uninstalling toolboxes

* Setup CI, v17.14, start uninstalling toolboxes

* Setup CI, v17.15, start uninstalling toolboxes

* Setup CI, v17.16, start uninstalling toolboxes

* Setup CI, v17.17, start uninstalling toolboxes

* Setup CI, v17.18, start uninstalling toolboxes

* Setup CI, v17.19, start uninstalling toolboxes

* Setup CI, v17.20, start uninstalling toolboxes

* Setup CI, v17.21, start uninstalling toolboxes

* Setup CI, v17.22, start uninstalling toolboxes

* Setup CI, v17.23, start uninstalling toolboxes

* Setup CI, v17.24, start uninstalling toolboxes

* Setup CI, v17.25, start uninstalling toolboxes

* Setup CI, v17.26, start uninstalling toolboxes

* Setup CI, v17.27, start uninstalling toolboxes

* Setup CI, v17.28, start uninstalling toolboxes

* Setup CI, v17.29, start uninstalling toolboxes

* Setup CI, v17.30, start uninstalling toolboxes

* Setup CI, v17.31, start uninstalling toolboxes

* Setup CI, v17.32, start uninstalling toolboxes

* Setup CI, v17.33, start uninstalling toolboxes

* Setup CI, v17.34, start uninstalling toolboxes

* Setup CI, v17.35, start uninstalling toolboxes

* Setup CI, v18, simplify to most basic test

* Setup CI, v19, install mhkit toolbox

* Setup CI, v20, run a single test that uses mhkit

* Setup CI, v21, run a single different test that uses mhkit

* Setup CI, v21.1, run a single different test that uses mhkit

* Setup CI, v21.2, run a single different test that uses mhkit

* Add function to reload python in matlab after python code changes

* Fix paths to python usgs and noaa functions

* Update pierson_moskowitz_spectrum wrapper with additional Hs parameter

* Update create_spectra with additional Hs parameter

* Update tests fixing mostly broken relative file paths

* Adressing issue #65 tidal ebb and flood plots for Matlab

* adding the project file

* updating the function descriptions

* Merge QC_Test into master (#63)

* Add QC_Test.m draft

* check incriment working

* Update qctest file

* test_check_timestep passes

* test_check_delta passes

* cleanup

Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>

* Adding tests to account for the new plot functions plot_tidal_phase_exceedance and plot_tidal_phase_probability

* Bug fix io request data (#78)

* Rewrite usgs data request with no python calls to fix ssl error

* Rewrite noaa data request with no python calls to fix ssl error, WIP

* Split noaa data calls into max day periods

* Rewrite ndbc available data request with no python calls to fix ssl error

* Rewrite ndbc data request with no python calls to fix ssl error, WIP

* Rewrite ndbc data request with no python calls to fix ssl error, include stdmet option

* Handle errors from noaa data query

* Update example with noaa data query after change to options argument

* Check parameter input types to request_usgs_data.m

* minor edits

* Add proxy instructions and remove associated deprecated code

* Handle more NDBC file formats and corruptions

* Filter the NDBC available data by buoy

* Resolve mostly relative file path issues in associated live scripts

* Add automatic retries to usgs, noaa and ndbc data queries

Co-authored-by: rpauly18 <[email protected]>

* Move CI Unit Tests to GitHub Actions (#80)

* Speed up reading of dataframe datetimes

* Add datetime_index_to_ordinal function to pandas_dataframe module to convert the datetime index of dataframes to MATLAB ordinal values
* Convert all methods using cell arrays to get the datetimes index to use datetime_index_to_ordinal function

* Fix test assert to check for POSIX time rather than string

* Skip tests of environmental_contour function which is broken

* Run CI tests with all installed from source and OutOfProcess execution mode

* Rename run_tests to tests and delete main

* Give the workflow a more badge friendly name and add to README

* Minor changes

* Delete TravisCI build

* Remove unused import

* Remove duplicated code

Co-authored-by: Matthew Boyd <[email protected]>
Co-authored-by: McVey <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: Parangat Bhaskar <[email protected]>
Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>
Co-authored-by: Matthew Boyd <[email protected]>
Co-authored-by: Mathew Topper <[email protected]>
* Addressing issue #59 magnitude and phase function for Matlab

* Adding tests for magnitude_phase function

Co-authored-by: McVey <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
* Setup CI, v16.2, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.3, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.4, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.5, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.6, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.7, list installed toolboxes and addons

* Setup CI, v17, uninstall all pre-installed toolboxes

* Setup CI, v17.1, uninstall all pre-installed toolboxes

* Setup CI, v17.2, toggle off all pre-installed toolboxes

* Setup CI, v17.3, toggle off all pre-installed toolboxes

* Setup CI, v17.4, toggle off all pre-installed toolboxes

* Setup CI, v17.5, toggle off all pre-installed toolboxes

* Setup CI, v17.6, toggle off all pre-installed toolboxes

* Setup CI, v17.7, toggle off all pre-installed toolboxes

* Setup CI, v17.8, toggle off all pre-installed toolboxes

* Setup CI, v17.9, toggle off all pre-installed toolboxes

* Setup CI, v17.10, list installed addons and toolboxes

* Setup CI, v17.11, start uninstalling toolboxes

* Setup CI, v17.12, start uninstalling toolboxes

* Setup CI, v17.13, start uninstalling toolboxes

* Setup CI, v17.14, start uninstalling toolboxes

* Setup CI, v17.15, start uninstalling toolboxes

* Setup CI, v17.16, start uninstalling toolboxes

* Setup CI, v17.17, start uninstalling toolboxes

* Setup CI, v17.18, start uninstalling toolboxes

* Setup CI, v17.19, start uninstalling toolboxes

* Setup CI, v17.20, start uninstalling toolboxes

* Setup CI, v17.21, start uninstalling toolboxes

* Setup CI, v17.22, start uninstalling toolboxes

* Setup CI, v17.23, start uninstalling toolboxes

* Setup CI, v17.24, start uninstalling toolboxes

* Setup CI, v17.25, start uninstalling toolboxes

* Setup CI, v17.26, start uninstalling toolboxes

* Setup CI, v17.27, start uninstalling toolboxes

* Setup CI, v17.28, start uninstalling toolboxes

* Setup CI, v17.29, start uninstalling toolboxes

* Setup CI, v17.30, start uninstalling toolboxes

* Setup CI, v17.31, start uninstalling toolboxes

* Setup CI, v17.32, start uninstalling toolboxes

* Setup CI, v17.33, start uninstalling toolboxes

* Setup CI, v17.34, start uninstalling toolboxes

* Setup CI, v17.35, start uninstalling toolboxes

* updates to spectrum and elevation functions

* updating io paths

* Setup CI, v18, simplify to most basic test

* Setup CI, v19, install mhkit toolbox

* Setup CI, v20, run a single test that uses mhkit

* Setup CI, v21, run a single different test that uses mhkit

* Setup CI, v21.1, run a single different test that uses mhkit

* Setup CI, v21.2, run a single different test that uses mhkit

* Add function to reload python in matlab after python code changes

* Fix paths to python usgs and noaa functions

* Update pierson_moskowitz_spectrum wrapper with additional Hs parameter

* Update create_spectra with additional Hs parameter

* Update tests fixing mostly broken relative file paths

* Merge QC_Test into master (#63)

* Add QC_Test.m draft

* check incriment working

* Update qctest file

* test_check_timestep passes

* test_check_delta passes

* cleanup

Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>

* Bug fix io request data (#78)

* Rewrite usgs data request with no python calls to fix ssl error

* Rewrite noaa data request with no python calls to fix ssl error, WIP

* Split noaa data calls into max day periods

* Rewrite ndbc available data request with no python calls to fix ssl error

* Rewrite ndbc data request with no python calls to fix ssl error, WIP

* Rewrite ndbc data request with no python calls to fix ssl error, include stdmet option

* Handle errors from noaa data query

* Update example with noaa data query after change to options argument

* Check parameter input types to request_usgs_data.m

* minor edits

* Add proxy instructions and remove associated deprecated code

* Handle more NDBC file formats and corruptions

* Filter the NDBC available data by buoy

* Resolve mostly relative file path issues in associated live scripts

* Add automatic retries to usgs, noaa and ndbc data queries

Co-authored-by: rpauly18 <[email protected]>

* Move CI Unit Tests to GitHub Actions (#80)

* Speed up reading of dataframe datetimes

* Add datetime_index_to_ordinal function to pandas_dataframe module to convert the datetime index of dataframes to MATLAB ordinal values
* Convert all methods using cell arrays to get the datetimes index to use datetime_index_to_ordinal function

* Fix test assert to check for POSIX time rather than string

* Skip tests of environmental_contour function which is broken

* Run CI tests with all installed from source and OutOfProcess execution mode

* Rename run_tests to tests and delete main

* Give the workflow a more badge friendly name and add to README

* Minor changes

* Delete TravisCI build

* Remove unused import

* Remove duplicated code

* resolving test issues

* Add Windows MATLAB-Actions Runners (#81)

* Put all test output in a single folder and hide from git

* Test windows runner using InProcess mode

Also removed pinning of matplotlib. See #80 (comment)

* Add develop branch to on-push and on-pull_request

Co-authored-by: Matthew Boyd <[email protected]>

* fixing tests

* removing trouble test temporairly

* restarting tests

* updating python calls

Co-authored-by: Matthew Boyd <[email protected]>
Co-authored-by: Parangat Bhaskar <[email protected]>
Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>
Co-authored-by: Matthew Boyd <[email protected]>
Co-authored-by: Mathew Topper <[email protected]>
Co-authored-by: Mathew Topper <[email protected]>
* adding deep flag and wave_length

* adding depth_regime

* updates

* first few tests working

* adding final tests

* updating toolbox

* Setup CI, v16.2, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.3, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.4, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.5, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.6, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.7, list installed toolboxes and addons

* Setup CI, v17, uninstall all pre-installed toolboxes

* Setup CI, v17.1, uninstall all pre-installed toolboxes

* Setup CI, v17.2, toggle off all pre-installed toolboxes

* Setup CI, v17.3, toggle off all pre-installed toolboxes

* Setup CI, v17.4, toggle off all pre-installed toolboxes

* Setup CI, v17.5, toggle off all pre-installed toolboxes

* Setup CI, v17.6, toggle off all pre-installed toolboxes

* Setup CI, v17.7, toggle off all pre-installed toolboxes

* Setup CI, v17.8, toggle off all pre-installed toolboxes

* Setup CI, v17.9, toggle off all pre-installed toolboxes

* Setup CI, v17.10, list installed addons and toolboxes

* Setup CI, v17.11, start uninstalling toolboxes

* Setup CI, v17.12, start uninstalling toolboxes

* Setup CI, v17.13, start uninstalling toolboxes

* Setup CI, v17.14, start uninstalling toolboxes

* Setup CI, v17.15, start uninstalling toolboxes

* Setup CI, v17.16, start uninstalling toolboxes

* Setup CI, v17.17, start uninstalling toolboxes

* Setup CI, v17.18, start uninstalling toolboxes

* Setup CI, v17.19, start uninstalling toolboxes

* Setup CI, v17.20, start uninstalling toolboxes

* Setup CI, v17.21, start uninstalling toolboxes

* Setup CI, v17.22, start uninstalling toolboxes

* Setup CI, v17.23, start uninstalling toolboxes

* Setup CI, v17.24, start uninstalling toolboxes

* Setup CI, v17.25, start uninstalling toolboxes

* Setup CI, v17.26, start uninstalling toolboxes

* Setup CI, v17.27, start uninstalling toolboxes

* Setup CI, v17.28, start uninstalling toolboxes

* Setup CI, v17.29, start uninstalling toolboxes

* Setup CI, v17.30, start uninstalling toolboxes

* Setup CI, v17.31, start uninstalling toolboxes

* Setup CI, v17.32, start uninstalling toolboxes

* Setup CI, v17.33, start uninstalling toolboxes

* Setup CI, v17.34, start uninstalling toolboxes

* Setup CI, v17.35, start uninstalling toolboxes

* Setup CI, v18, simplify to most basic test

* Setup CI, v19, install mhkit toolbox

* Setup CI, v20, run a single test that uses mhkit

* Setup CI, v21, run a single different test that uses mhkit

* Setup CI, v21.1, run a single different test that uses mhkit

* Setup CI, v21.2, run a single different test that uses mhkit

* Add function to reload python in matlab after python code changes

* Fix paths to python usgs and noaa functions

* Update pierson_moskowitz_spectrum wrapper with additional Hs parameter

* Update create_spectra with additional Hs parameter

* Update tests fixing mostly broken relative file paths

* Merge QC_Test into master (#63)

* Add QC_Test.m draft

* check incriment working

* Update qctest file

* test_check_timestep passes

* test_check_delta passes

* cleanup

Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>

* Bug fix io request data (#78)

* Rewrite usgs data request with no python calls to fix ssl error

* Rewrite noaa data request with no python calls to fix ssl error, WIP

* Split noaa data calls into max day periods

* Rewrite ndbc available data request with no python calls to fix ssl error

* Rewrite ndbc data request with no python calls to fix ssl error, WIP

* Rewrite ndbc data request with no python calls to fix ssl error, include stdmet option

* Handle errors from noaa data query

* Update example with noaa data query after change to options argument

* Check parameter input types to request_usgs_data.m

* minor edits

* Add proxy instructions and remove associated deprecated code

* Handle more NDBC file formats and corruptions

* Filter the NDBC available data by buoy

* Resolve mostly relative file path issues in associated live scripts

* Add automatic retries to usgs, noaa and ndbc data queries

Co-authored-by: rpauly18 <[email protected]>

* Move CI Unit Tests to GitHub Actions (#80)

* Speed up reading of dataframe datetimes

* Add datetime_index_to_ordinal function to pandas_dataframe module to convert the datetime index of dataframes to MATLAB ordinal values
* Convert all methods using cell arrays to get the datetimes index to use datetime_index_to_ordinal function

* Fix test assert to check for POSIX time rather than string

* Skip tests of environmental_contour function which is broken

* Run CI tests with all installed from source and OutOfProcess execution mode

* Rename run_tests to tests and delete main

* Give the workflow a more badge friendly name and add to README

* Minor changes

* Delete TravisCI build

* Remove unused import

* Remove duplicated code

* Add Windows MATLAB-Actions Runners (#81)

* Put all test output in a single folder and hide from git

* Test windows runner using InProcess mode

Also removed pinning of matplotlib. See #80 (comment)

* Add develop branch to on-push and on-pull_request

Co-authored-by: Matthew Boyd <[email protected]>

* updating test

Co-authored-by: Matthew Boyd <[email protected]>
Co-authored-by: Parangat Bhaskar <[email protected]>
Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>
Co-authored-by: Matthew Boyd <[email protected]>
Co-authored-by: Mathew Topper <[email protected]>
Co-authored-by: Mathew Topper <[email protected]>
* Setup CI, v16.2, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.3, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.4, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.5, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.6, try to fix HDF5 issue, try fix outlined in Troubleshooting

* Setup CI, v16.7, list installed toolboxes and addons

* Setup CI, v17, uninstall all pre-installed toolboxes

* Setup CI, v17.1, uninstall all pre-installed toolboxes

* Setup CI, v17.2, toggle off all pre-installed toolboxes

* Setup CI, v17.3, toggle off all pre-installed toolboxes

* Setup CI, v17.4, toggle off all pre-installed toolboxes

* Setup CI, v17.5, toggle off all pre-installed toolboxes

* Setup CI, v17.6, toggle off all pre-installed toolboxes

* Setup CI, v17.7, toggle off all pre-installed toolboxes

* Setup CI, v17.8, toggle off all pre-installed toolboxes

* Setup CI, v17.9, toggle off all pre-installed toolboxes

* Setup CI, v17.10, list installed addons and toolboxes

* Setup CI, v17.11, start uninstalling toolboxes

* Setup CI, v17.12, start uninstalling toolboxes

* Setup CI, v17.13, start uninstalling toolboxes

* Setup CI, v17.14, start uninstalling toolboxes

* Setup CI, v17.15, start uninstalling toolboxes

* Setup CI, v17.16, start uninstalling toolboxes

* Setup CI, v17.17, start uninstalling toolboxes

* Setup CI, v17.18, start uninstalling toolboxes

* Setup CI, v17.19, start uninstalling toolboxes

* Setup CI, v17.20, start uninstalling toolboxes

* Setup CI, v17.21, start uninstalling toolboxes

* Setup CI, v17.22, start uninstalling toolboxes

* Setup CI, v17.23, start uninstalling toolboxes

* Setup CI, v17.24, start uninstalling toolboxes

* Setup CI, v17.25, start uninstalling toolboxes

* Setup CI, v17.26, start uninstalling toolboxes

* Setup CI, v17.27, start uninstalling toolboxes

* Setup CI, v17.28, start uninstalling toolboxes

* Setup CI, v17.29, start uninstalling toolboxes

* Setup CI, v17.30, start uninstalling toolboxes

* Setup CI, v17.31, start uninstalling toolboxes

* Setup CI, v17.32, start uninstalling toolboxes

* Setup CI, v17.33, start uninstalling toolboxes

* Setup CI, v17.34, start uninstalling toolboxes

* Setup CI, v17.35, start uninstalling toolboxes

* Setup CI, v18, simplify to most basic test

* Setup CI, v19, install mhkit toolbox

* Setup CI, v20, run a single test that uses mhkit

* Setup CI, v21, run a single different test that uses mhkit

* Setup CI, v21.1, run a single different test that uses mhkit

* Setup CI, v21.2, run a single different test that uses mhkit

* Add function to reload python in matlab after python code changes

* Fix paths to python usgs and noaa functions

* Update pierson_moskowitz_spectrum wrapper with additional Hs parameter

* Update create_spectra with additional Hs parameter

* Update tests fixing mostly broken relative file paths

* Merge QC_Test into master (#63)

* Add QC_Test.m draft

* check incriment working

* Update qctest file

* test_check_timestep passes

* test_check_delta passes

* cleanup

Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>

* Bug fix io request data (#78)

* Rewrite usgs data request with no python calls to fix ssl error

* Rewrite noaa data request with no python calls to fix ssl error, WIP

* Split noaa data calls into max day periods

* Rewrite ndbc available data request with no python calls to fix ssl error

* Rewrite ndbc data request with no python calls to fix ssl error, WIP

* Rewrite ndbc data request with no python calls to fix ssl error, include stdmet option

* Handle errors from noaa data query

* Update example with noaa data query after change to options argument

* Check parameter input types to request_usgs_data.m

* minor edits

* Add proxy instructions and remove associated deprecated code

* Handle more NDBC file formats and corruptions

* Filter the NDBC available data by buoy

* Resolve mostly relative file path issues in associated live scripts

* Add automatic retries to usgs, noaa and ndbc data queries

Co-authored-by: rpauly18 <[email protected]>

* Move CI Unit Tests to GitHub Actions (#80)

* Speed up reading of dataframe datetimes

* Add datetime_index_to_ordinal function to pandas_dataframe module to convert the datetime index of dataframes to MATLAB ordinal values
* Convert all methods using cell arrays to get the datetimes index to use datetime_index_to_ordinal function

* Fix test assert to check for POSIX time rather than string

* Skip tests of environmental_contour function which is broken

* Run CI tests with all installed from source and OutOfProcess execution mode

* Rename run_tests to tests and delete main

* Give the workflow a more badge friendly name and add to README

* Minor changes

* Delete TravisCI build

* Remove unused import

* Remove duplicated code

* Initial commit, WIP

* More progress, WIP

* Make first complete working version of cdip data collector

* Refactor datum_categories function

* Rename categories to groups

* Alphabetize local functions

* Fix a couple issues

* Finish adding data tests, minus plot tests

* Add autoretry

* Refactor autoretry

* Add compendium plot and associated tests

* Add box plot function, not needing statistical toolbox

* Customize boxplot function to look more like Python plot

* Refactor compendium plot

* Add boxplot and associated test

* Handle when no times are given

* Make plots not open in new window when in live script

* Add example live script for CDIP

* Make boxplot look more like Python plot

* Make compendium plot look more like Python plot

* Change plot time parameters from POSIX to datetime

* Remove optional nc object parameter

* Fix docstring

* updating matlab toolbox

* Warn on non-existant parameters

* Fix spelling errors

* Replace a try-catch block

* Add low-level netcdf cdip functions for older matlab versions

* Reduce query size of USGS instantaneous data test to avoid query limit

* Remove USGS instantaneous data test to stop failed CI runs

* Remove Python 3.7 CI jobs as it is no longer supported by hosted runners

* Remove boxplot legend dependency on data file

Co-authored-by: Parangat Bhaskar <[email protected]>
Co-authored-by: kbrode22 <[email protected]>
Co-authored-by: rpauly18 <[email protected]>
Co-authored-by: Bhaskar <[email protected]>
Co-authored-by: Mathew Topper <[email protected]>
@simmsa simmsa changed the title WIP: Fix Unit Tests RFC: Fix Unit Tests Dec 11, 2023
@simmsa simmsa marked this pull request as ready for review December 11, 2023 14:12
@simmsa simmsa requested a review from rpauly18 December 15, 2023 14:59
@rpauly18
Copy link
Contributor

I'll be adding comments as I go through the review -

  1. Please open an issue on the MHKiT-Matlab repo (if you have not already) for the depreciated tests so we can assign someone to address the incompatibility
  2. for the code coverage report, you say it does not run automatically - how do you trigger it?

@simmsa
Copy link
Contributor Author

simmsa commented Dec 21, 2023

@rpauly18,

Copy link
Contributor

@rpauly18 rpauly18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for your hard work on this!

@rpauly18
Copy link
Contributor

@simmsa feel free to merge this if you are 100% done with any additional changes.

@rpauly18 rpauly18 merged commit 21453d1 into MHKiT-Software:master Jan 8, 2024
28 checks passed
@simmsa
Copy link
Contributor Author

simmsa commented Jan 8, 2024

@rpauly18 Thank you for the review and the merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants