Closed KatieWoe closed 9 months ago
@AgustinVallejo let me know if you need help with this.
Here is some investigation I did in a patch. I know nothing about Kepler's Laws, but is seems like a target orbit cannot have a negative semi major axis. I wasn't sure about if it is allowed to be zero. With the new approach to validation in the patch, here is the error I get in studio (non fatal this time) when trying to set a negative semi major axis. It is challenging to internalize how Property validation will be client-facing for cases like these, but validationMessage
can help communicate things. I also recommend adding the phetioDocumentation about the supported values of a target orbit.
I know that in the past we have differed on opinion about how thoroughly to add assertions, but in my opinion the assertions added in the patch (if correct) are no-brainers. I don't like assuming that values passed in are as expected, especially when they can be provided by phet-io clients or coworkers untrained in astronomical physics (me). The "Should be a finite Vector2" was about 4 steps downstream of the actual problem. Let me know if you want to discuss further.
@KatieWoe. A note about how studio error handling works for the future: In studio there are two types of error alerts that you can receive from trying to set a value.
In your post above, each addition error that was alerted ("mismatch. . ." and "reentry") were because the sim was already broken and unusable from the first setting error. Please update the QA book/communicate this studio feature to the QA team as you see fit. Feel free to unassign yourself once noting this.
To clarify, fatal errors are bugs and should be reported, correct?
I looked on main, and I don't see this pop-up. Studio crashes and the assertion errors are in the console, but nothing shows up visually in studio
To clarify, fatal errors are bugs and should be reported, correct?
Yes correct. I will say though fatal errors should be reported, there are many ways to break PhET-iO that we don't necessarily need to fix. An issue will help us determine if it is worth supporting/solving.
I looked on main, and I don't see this pop-up. Studio crashes and the assertion errors are in the console, but nothing shows up visually in studio
@KatieWoe told me on slack that she was testing with this link:
What you described is expected because your link includes phetioWrapperDebug=true
, which will just fail out on fatal errors instead of reporting them back to studio for the alert dialog.
Changed a bit @zepumph's patch and committed. Assigning back for review, thanks!
Things look pretty good on main,
Test device Dell Operating System Win 11 Browser Firefox Problem description For https://github.com/phetsims/qa/issues/1023 I noticed that, when setting a target of an orbit, it is oriented in the opposite direction of the default orbit. I'm not sure of a legitimate way of changing this. If I make the semimajor axis value negative it throws assertions/errors, and then the target orbit looks how I intended. However, any further attempts to change the target orbit fail. Steps to reproduce
Visuals