Repository navigation
Conversation
…re_length_matrix
Contributor
|
Still in draft but ready for @akeeste review. Should be only a few lines per function that are most relevant |
…e_module_to_native_matlab
Functionally identical to python, MATLAB uses fzero instead of scipy fsolve, but both functions have the same intended use case
This separates out MATLAB native and python calling functions into separate test files
This separates out MATLAB native and new MATLAB only utility functions into one test file that can be tested separately on actions
Fix small typos
This adds per variable reads and auto retries and more deterministic error messages
simmsa
marked this pull request as ready for review
September 29, 2026 16:04
Contributor
Author
|
@akeeste, apologies for the delay here. This is ready for review. The two test failures are expected, those are running the older python tests. There are new tests that are passing for the native MATLAB functions and examples:
|
…e_module_to_native_matlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR converts numeric MHKiT-Python wave module functions into native MATLAB functions.
Overall the intent is to maintain the same API, and helper functions for common operations and leverage native matlab functionality, and fill in gaps where necessary.
Tasks:
read_NDBC_file: Rewrite to native MATLABswan_read_block: Rewrite to native MATLABcapture_length: Rewrite to native MATLABcapture_length_matrix: Rewrite to native MATLABcapture_width: Rewrite to native MATLAB, deprecate capture widthcapture_width_matrix: Rewrite to native MATLAB, deprecate capture width matrixmean_annual_energy_production_matrix: Rewrite to native MATLABmean_annual_energy_production_timeseries: Rewrite to native MATLABpower_matrix: Rewrite to native MATLABwave_energy_flux_matrix: Rewrite to native MATLABwec_reference_power_matrix: Return a DOE reference model WEC power matrix (new)reference_model_power_matrix: Load DOE reference model power matrix data (new)plot_wave_joint_probability_distribution: Dedicated JPD plotting function (new)average_crest_period: Rewrite to native MATLABaverage_wave_period: Rewrite to native MATLABaverage_zero_crossing_period: Rewrite to native MATLABdepth_regime: Rewrite to native MATLABenergy_flux: Rewrite to native MATLABenergy_period_to_peak_period: Define as native MATLAB (new)peak_period: Rewrite to native MATLABspectral_bandwidth: Rewrite to native MATLABspectral_width: Rewrite to native MATLABwave_celerity: Rewrite to native MATLABwave_length: Rewrite to native MATLABwave_number: Rewrite to native MATLABwave_example: Use native functions and DOE reference models, and reorder sectionscdip_example: Rerender with native MATLAB and 1 year of cached CDIP 277 datawecsim_power_performance_example: Use capture width in place of capture lengthWave_TestElevationSpectrum: Hold elevation spectrum tests moved out of resource tests (new)Wave_TestContours: Hold contour tests moved fromWave_TestResourceMetricsWave_TestIO: Mark hindcast tests as assume-failWave_TestIOcdip: Check CDIP metadata within a time windowWave_TestPerformance: Test capture width and seeded annual energy productionWave_TestResourceMetrics: Add joint probability plot tests and use MATLAB logicalsWave_TestResourceSpectrum: Add seeded surface elevation and zero-frequency spectrum testsUtils_TestBinnedStatistic2d: Test 2D binned statistics (new)Utils_TestDefineBins: Test bin size correctness (new)Utils_TestMhkitUtils: Holdmhkit_*helper tests (new)Utils_TestGenUtils: Move helper tests out and skip a flaky NDBC variableExamples_TestMatlabOnly: Add the wave and WEC-Sim examplesrunMatlabOnlyTests: Add native wave tests to the MATLAB-only suitemhkit_binned_statistic_2d: Compute a 2D binned statistic on a bin grid (new)mhkit_define_bins_1d: Compute bin centers and edges for one axis (new)mhkit_define_bins_2d: Define a 2D bin grid (new)mhkit_frequency_to_column_names: Convert frequencies to valid table column names (new)mhkit_standardize_spectrum_input: Convert any supported spectrum input to plain arrays (new)mhkit_restore_spectrum_output: Return results in the caller's original spectrum format (new)mhkit_standardize_user_input_to_column_vectors: Convert vector inputs to column vectors (new)mhkit_restore_column_vectors_to_user_input: Restore the caller's original vector orientation (new)mhkit_verify_is_column_vector: Check that a value is a column vector (new)mhkit_colormap: Return an RGB colormap by name (new)mhkit_plot_matrix: Plot a binned matrix, one colored cell per bin (new)