Repository navigation
MNT: raise typed stochastic exceptions instead of bare AssertionError - #1221
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1221 +/- ##
===========================================
+ Coverage 86.71% 86.86% +0.14%
===========================================
Files 131 131
Lines 18292 18307 +15
===========================================
+ Hits 15862 15902 +40
+ Misses 2430 2405 -25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Looks good. One thing before merging: the commit adds three empty files at the repo root, which look like test outputs committed by accident:
Can you remove them from the branch? After that I am fine with merging. |
eecb254 to
611a304
Compare
611a304 to
be07cd1
Compare
|
Removed the three |
The stochastic validators raised AssertionError for every bad input, which says nothing about whether the type or the value was wrong. They now raise StochasticTypeError or StochasticValueError from rocketpy.exceptions, which are also TypeError/ValueError and still AssertionError, so existing `except AssertionError` code keeps working. Messages are unchanged. Related to #1209. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW575d9C9zpS7Z1v2KXVq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW577mr8JSrJHguXrmXzw
Wrong types in the positive-int list, ensemble members and parachute trigger now raise StochasticTypeError, and an empty trigger list raises StochasticValueError. The last plain TypeErrors in StochasticRocket and StochasticFlight become StochasticTypeError, and the tests assert the specific class for each of these sites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDW577mr8JSrJHguXrmXzw
8aacf9d to
cb9130b
Compare
Related to #1209
Covers the Exceptions item of the v1.14.0 checklist. The 48
raise AssertionErrorinrocketpy/stochasticnow raiseStochasticTypeError(wrong type or format) orStochasticValueError(right type, invalid value), as asked in #1194. Both live inrocketpy.exceptionsand also subclassTypeError/ValueErrorandAssertionError, so existingexcept AssertionErrorcode keeps working; the messages are unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01XDW575d9C9zpS7Z1v2KXVq