Conversation
- Solver stats are now returned to javascript - The binding is now imported using the bindings package, so switching between debug/release no longer requires changes to the code - added micm tests
|
📄 Documentation for this branch is available at: https://ncar.github.io/musica/branch/javascript_solver_stats/ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #690 +/- ##
==========================================
+ Coverage 81.44% 81.52% +0.08%
==========================================
Files 113 114 +1
Lines 9840 9921 +81
==========================================
+ Hits 8014 8088 +74
- Misses 1826 1833 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds JavaScript solver statistics support to the MUSICA library, enabling JavaScript users to access detailed solver performance metrics after each solve operation. This brings the JavaScript bindings closer to feature parity with the Python bindings.
Key Changes
- Implements
SolverResult,SolverStats, andSolverStateclasses in JavaScript to mirror Python functionality - Updates C++ wrapper to return solver results instead of void from the
Solve()method - Switches to using the
bindingsnpm package for more robust native addon loading - Adds comprehensive unit tests validating solver result structure and statistics
- Removes debug print statement from Python integration tests
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
python/test/integration/test_analytical.py |
Removed debug print statement |
package.json |
Added bindings dependency and quoted test glob pattern |
package-lock.json |
Added bindings and file-uri-to-path package entries |
javascript/tests/unit/micm/micm.test.js |
New comprehensive unit tests for MICM class and solver results |
javascript/src/micm/solver_result_wrapper.h |
New header defining wrapper for converting C++ solver results to JavaScript |
javascript/src/micm/solver_result_wrapper.cpp |
Implementation of solver result conversion to JavaScript objects |
javascript/src/micm/micm_wrapper.h |
Updated Solve() signature to return micm::SolverResult |
javascript/src/micm/micm_wrapper.cpp |
Updated Solve() implementation to return results and removed C-API usage |
javascript/src/micm/micm.h |
Added include for solver_result_wrapper |
javascript/src/micm/micm.cpp |
Updated to return solver results instead of undefined/null |
javascript/micm/solver_result.js |
New module defining SolverState enum, SolverStats, and SolverResult classes |
javascript/micm/micm.js |
Updated to use bindings package and convert native results to JavaScript classes |
javascript/index.js |
Updated to export new solver result types and use bindings package |
javascript/CMakeLists.txt |
Added solver_result_wrapper.cpp to build targets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow on to #687
Returns the solver stats to javascript and allows them to be used. Adds a test for micm, also fixes something in package.json that was preventing all tests from running. The
node-bindingspackage is now used to import the addon so we don't have to change the path for debug/release, which probably should have been addressed in #647closes #646