Conversation
Co-authored-by: Jiwon Gim <[email protected]>
Co-authored-by: Jiwon Gim <[email protected]>
K20shores
left a comment
There was a problem hiding this comment.
Good first pass, but definitely need to fix a few things before we can move on
|
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
…CAR/musica into TAMU_CapstoneFA25_JS_interface
boulderdaze
left a comment
There was a problem hiding this comment.
Looks good! Just have a question
| 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'); |
There was a problem hiding this comment.
Curious, why are solve errors thrown as TypeError, while config path error throws a general Error?
There was a problem hiding this comment.
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.
closes #623
closes #647