Commit 9da4565
Enh/custom warning no motor parachute aerosurface (#871)
* DOC: Add entry for custom warnings in CHANGELOG.md
Added a placeholder in the [Unreleased] section for the upcoming feature
to add custom warnings when a rocket is missing motors and/or aero-surface. See #285.
* ENH: add custom warning for Rocket with no components
This enhancement adds a warning when a Rocket object has no motors,
parachutes, or AeroSurface components. It notifies the user so that
they can add missing components before running simulations. See #285
* ENH:Add tests for _check_missing_components method in Rocket class
* TST:improve test_check_missing_no_components_missing to correctly handle warnings
* BUG: do not warn for rockets without parachute
Only warn if motor or aerodynamic surfaces are missing. Never raise a warning for no parachute. See #285
* TST:Update the test:do not warn when missing parachute
* MNT: simplify checks and update docstrings in rocket.py
- Removed redundant len() check for aerodynamic_surfaces.
- Added 'Returns: None' section to NumPy-style docstring.
- Removed redundant '[WARNING]' prefix in warnings messages.
* TST:update test_check_missing_no_components_missing to avoid TypeError: exceptions must be derived from Warning, not <class 'NoneType'>
* TST:update test_check_missing_no_components_missing:import the lib at the top of file
* TST:update test_check_missing_no_components_missing:import the lib at the top of file
* Fix lint errors
---------
Co-authored-by: Tang Xiaoyu <[email protected]>
Co-authored-by: Marchma0 <[email protected]>1 parent b451c38 commit 9da4565
File tree
3 files changed
+65
-0
lines changed- rocketpy/rocket
- tests/unit/rocket
3 files changed
+65
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
387 | 416 | | |
388 | 417 | | |
389 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
373 | 407 | | |
374 | 408 | | |
375 | 409 | | |
| |||
0 commit comments