Add MATLAB reference implementation and Octave validation#2
Open
maresb wants to merge 1 commit into
Open
Conversation
pc_min.m runs unmodified under Octave, so add a reproducible way to exercise it without a MATLAB license: - matlab_scripts/run_pc_min.m: a core-Octave driver that runs pc_min.m on five soundings from data/sample_data.nc and asserts the PMIN/VMAX/TO/LNB/IFL outputs match the reference values the original MATLAB code stored there. It exits non-zero on any drift, so it is safe to use in CI. - pyproject.toml: an `octave` pixi feature/environment (Linux + macOS only; Octave is not packaged for win-64 on conda-forge) plus a `pc-min-octave` task that runs the driver. - .github/workflows/pytest.yaml: a CI job running the task on ubuntu and macos. - matlab_scripts/README.md: documents the scripts and how to run them. pixi.lock is regenerated by the installed pixi (0.72.2), which also upgrades it from lock-file format v6 to v7; existing environments keep their exact locked package versions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ag9bDj6GuRN8fNsDULbBkQ
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.
Summary
This PR adds Kerry Emanuel's original MATLAB potential-intensity algorithm (BE02/pcmin) as a reference implementation and introduces validation testing under GNU Octave to ensure the Python port produces consistent results.
Key Changes
Added
matlab_scripts/directory with the original MATLAB implementation:pc_min.m: Kerry Emanuel's pcmin algorithm from Bister & Emanuel (2002)run_pc_min.m: Validation driver that tests pc_min.m against reference values from sample dataREADME.md: Documentation describing the MATLAB scripts and their purposeUpdated CI/CD pipeline (
.github/workflows/pytest.yaml):octavejob to run MATLAB validation testsUpdated project configuration (
pyproject.toml):octavefeature with Octave dependencyImplementation Details
run_pc_min.mscript validates the MATLAB implementation against reference PMIN/VMAX/TO/LNB/IFL values stored indata/sample_data.nchttps://claude.ai/code/session_01Ag9bDj6GuRN8fNsDULbBkQ