-
Notifications
You must be signed in to change notification settings - Fork 4
Fix Octave/MATLAB Demos and Add Integration Tests #15
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
Merged
Conversation
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
- Refactored `measure_LCD.m` to support flexible input arguments (directory path vs image arrays) using `varargin`, matching demo usage. - Fixed observer instantiation loop to correctly handle object instances, preventing crashes when observers are passed as objects. - Updated `measure_LCD` to return a `table` (in MATLAB) or struct (in Octave) with `diameter` and `dose_level` columns, ensuring compatibility with `write_lcd_results`. - Updated `demo_01_singlerecon_LCD.m` and `demo_02_tworecon_LCD.m` to explicitly set `dose_level` in results. - Added comprehensive unit tests (`tests/test_measure_LCD.m`) covering directory inputs, array inputs, and observer handling. - Added GitHub Actions workflow (`.github/workflows/matlab_tests.yml`) to run tests on Ubuntu using Octave.
…ty-15639152124994219495
- Refactored `measure_LCD.m` to support flexible input arguments (directory path vs image arrays) using `varargin`, matching demo usage. - Fixed observer instantiation loop to correctly handle object instances, preventing crashes when observers are passed as objects. - Updated `measure_LCD` to return a `table` (in MATLAB) or struct (in Octave) with `diameter` and `dose_level` columns, ensuring compatibility with `write_lcd_results`. - Updated `demo_01_singlerecon_LCD.m` and `demo_02_tworecon_LCD.m` to explicitly set `dose_level` in results. - Added comprehensive unit tests (`tests/test_measure_LCD.m`) covering directory inputs, array inputs, and observer handling. - Added GitHub Actions workflow (`.github/workflows/matlab_tests.yml`) to run tests on Ubuntu using Octave. - Added comprehensive Python unit tests (`tests/test_lcd_python.py`) covering basic functionality, different observers, and object inputs. - Added GitHub Actions workflow (`.github/workflows/python_tests.yml`) to run Python tests on multiple Python versions.
…ty-15639152124994219495 Fix compatibility issues in measure_LCD and demos and add unit tests
…ult writing for recon and observer fields, and standardize table creation in the measurement function.
- Added `liboctave-dev` to `apt-get install` in `.github/workflows/matlab_tests.yml` to resolve "missing mkoctfile" error during tablicious installation. - Updated `tablicious` version from 0.3.7 to 0.4.5 in `.github/workflows/matlab_tests.yml`. - Updated `tablicious` version from 0.3.7 to 0.4.5 in `install.sh`.
- Added `octave-dev` to `apt-get install` in `.github/workflows/matlab_tests.yml` to resolve "missing mkoctfile" error during tablicious installation. - Updated `tablicious` version from 0.3.7 to 0.4.5 in `.github/workflows/matlab_tests.yml`. - Updated `tablicious` version from 0.3.7 to 0.4.5 in `install.sh`.
- Added `octave-dev` to `apt-get install` in `.github/workflows/matlab_tests.yml` to resolve "missing mkoctfile" error during tablicious installation. - Updated `tablicious` version from 0.3.7 to 0.4.5 in `.github/workflows/matlab_tests.yml` and `install.sh`. - Updated `tests/test_measure_LCD.m` to correctly handle `tablicious` table outputs in Octave (using `istable` instead of `isfield`).
…l-12027862352368848439 Fix Octave CI missing headers and update tablicious
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 addresses multiple issues preventing the Octave/MATLAB demos from running successfully, specifically targeting the bugs reported in Issue #14. It also adds a comprehensive integration test suite to ensure all demos (Python and Octave) continue to work in the future.
Fixes for Issue #14
This PR resolves the following specific points raised in Issue #14:
src/lcdct/measure_LCD.mto explicitly return a table (using struct2table) instead of a struct when running in Octave. This resolves the downstream compatibility issues with writetable and plot_results.src/lcdct/write_lcd_results.mto robustly handle cell-array string columns (like recon and observer) which can occur in Octave tables, preventing type errors during CSV generation.Additional Changes
Integration Tests: Added
which runs:
Verification
Ran pytest tests/test_integration_demos.py locally.
Confirmed all 6 tests (3 Python, 3 Octave) passed.
Closes #14