Skip to content

Tamu capstone fa25 js interface#642

Merged
K20shores merged 20 commits intomainfrom
TAMU_CapstoneFA25_JS_interface
Oct 30, 2025
Merged

Tamu capstone fa25 js interface#642
K20shores merged 20 commits intomainfrom
TAMU_CapstoneFA25_JS_interface

Conversation

@miles-q-ryder
Copy link
Copy Markdown
Collaborator

@miles-q-ryder miles-q-ryder commented Oct 9, 2025

closes #623
closes #647

Copy link
Copy Markdown
Collaborator

@K20shores K20shores left a comment

Choose a reason for hiding this comment

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

Good first pass, but definitely need to fix a few things before we can move on

@boulderdaze
Copy link
Copy Markdown
Collaborator

Hi @miles-q-ryder, could you please resolve the merge conflicts? I'd love to review your PR after it passes all the tests. Thank you!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.24%. Comparing base (659886a) to head (68d437e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #642   +/-   ##
=======================================
  Coverage   78.24%   78.24%           
=======================================
  Files          54       54           
  Lines        6857     6857           
=======================================
  Hits         5365     5365           
  Misses       1492     1492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

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

Looks good! Just have a question

Comment on lines +16 to +39
if (config_path === null) {
throw new Error('config_path must be provided');
}

// Create native MICM instance
this._nativeMICM = new addon.MICM(config_path, solver_type);
this._solverType = solver_type;
}

solverType() {
return this._solverType;
}

createState(numberOfGridCells = 1) {
const nativeState = this._nativeMICM.createState(numberOfGridCells);
return new State(nativeState);
}

solve(state, timeStep) {
if (!(state instanceof State)) {
throw new TypeError('state must be an instance of State');
}
if (typeof timeStep !== 'number') {
throw new TypeError('timeStep must be a number');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Curious, why are solve errors thrown as TypeError, while config path error throws a general Error?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's a list of javascript errors available. Error is a general error which in this case most closely represents a missing file path. TypeError is to indicate that something isn't of an expected type and just happens to be an error type that is specific enough that we can use it here.

@K20shores K20shores merged commit 8b72219 into main Oct 30, 2025
84 checks passed
@K20shores K20shores deleted the TAMU_CapstoneFA25_JS_interface branch October 30, 2025 21:21
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.

Make JavaScript addon importable Develop the javascript interface

5 participants