ENH: restore concrete generic Parachute class#1061
Conversation
…a thin subclass Addresses the v1.13.0 pre-release review concerns raised in PR #1048: a geometry-specific class only makes sense alongside a generic case, and making Parachute abstract broke direct instantiation for no modeling gain (the hemispherical added-mass physics has been Parachute's behavior since at least v1.11). - Parachute is concrete again with its historical v1.12.1 signature and physics; u_dot and serialization move back into it. - HemisphericalParachute becomes a thin subclass that only makes the canopy geometry explicit and does not expose the noise parameter (noisy trigger readings should come from Sensors instead). - The legacy Rocket.add_parachute(name, cd_s, ...) path builds a generic Parachute again, keeping the FutureWarning nudge to the object API. - StochasticParachute.create_object returns a generic Parachute. - Legacy .rpy signatures remap to Parachute at its new module path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Class-hierarchy tests replace the abstract-base tests: generic Parachute is instantiable (with noise), HemisphericalParachute rejects noise, and from_dict round-trips both classes. - Legacy .rpy decode tests now expect the generic Parachute. - Fixtures and acceptance tests that pass noise return to the generic Parachute, their pre-refactor form. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
User guides and example notebooks return to the generic Parachute class (several of them pass the noise parameter, which the hemispherical subclass no longer exposes). The v1.13.0 changelog no longer lists the abstract-Parachute breaking change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1061 +/- ##
===========================================
- Coverage 81.84% 81.83% -0.02%
===========================================
Files 118 118
Lines 15254 15241 -13
===========================================
- Hits 12485 12472 -13
Misses 2769 2769 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The more I look at this implementation the more I think we need to revert it It is essentially a breaking change right now, and it is adding nothing new The worst part is that I don´t see this being the way to scale the parachute models as well. By adding this we are definitely going to need another breaking change (or add more big deprecation warnings) Also, we are aiming for implementing parafoils and we will need a more robust architecture, that will definitely collide with what we have here. Just skecthing quickly with claude, and something like this is a much better implementation: rocketpy/rocket/parachutes/ Lets just revert this one |
|
@MateusStano , I understand your concern and overall it makes a lot of sense. The new HemisphericalParachute class thought like a good idea at the begging, but now... I see what your pointing at. The problem, however, is that we still have a lot to process and reflect yet before making any architecture move here. My suggestion is for use to revert the changes made to the Parachute class and then release v1.13.0 without changing Parachute-related feature. If you agree we can move forward to a next PR and close this |
Im reverting it right now |
Summary
Addresses @MateusStano's pre-release review comments on #1048 (the
HemisphericalParachutedesign concern, thenoiseparameter, and thedrag_coefficientdocstring), before the v1.13.0 tag is published.The #958 refactor effectively renamed the concrete
ParachuteintoHemisphericalParachuteand left the old name as an abstract base — the hemispherical added-mass physics has beenParachute's behavior since at least v1.11 (the old hard-codedR = 1.5). That madeParachute(...)un-instantiable (a breaking change) without adding modeling capability, since there is only one concrete geometry.Changes
Parachuteis concrete again, with its exact v1.12.1 signature and physics (u_dot, added mass, serialization move back into it). User code from v1.12.x runs unchanged, warning-free, with identical results.parachute_typeis now a class attribute ("generic").HemisphericalParachutebecomes a thin subclass: it makes the canopy geometry explicit, keeps the door open for future geometry-specific models (parafoil, flat circular, ...), and does not expose thenoiseparameter — noisy trigger readings should come from the Sensors infrastructure instead. Itsdrag_coefficientdocs no longer suggest flat-circular/extended-skirt values (those stay on the generic class, where they make sense).Rocket.add_parachute(name, cd_s, ...)builds a genericParachuteagain, keeping theFutureWarningnudge towards the object-passing API..rpysignatures (rocketpy.rocket.parachute.Parachute) remap to the generic class at its new module path; round-trips preserve the concrete class.Parachute(several passnoise, which the subclass no longer accepts — includinghedy_flight_sim.ipynb, which was never migrated and would break as released). The v1.13.0 changelog no longer lists a breaking change for parachutes.Verification
Parachutewith historical signature reproduces the v1.12 radius/added-mass values; legacy kwargs path emits exactly oneFutureWarningand returns aParachute; legacy.rpydecode reconstructs a genericParachutewith thenoisefield preserved.Release note
This PR should be merged to
developand flow tomasterthrough #1060 before tagging v1.13.0, so the release ships without the parachute breaking change.🤖 Generated with Claude Code