Skip to content

ENH: restore concrete generic Parachute class#1061

Open
Gui-FernandesBR wants to merge 5 commits into
developfrom
enh/generic-parachute
Open

ENH: restore concrete generic Parachute class#1061
Gui-FernandesBR wants to merge 5 commits into
developfrom
enh/generic-parachute

Conversation

@Gui-FernandesBR

Copy link
Copy Markdown
Member

Summary

Addresses @MateusStano's pre-release review comments on #1048 (the HemisphericalParachute design concern, the noise parameter, and the drag_coefficient docstring), before the v1.13.0 tag is published.

The #958 refactor effectively renamed the concrete Parachute into HemisphericalParachute and left the old name as an abstract base — the hemispherical added-mass physics has been Parachute's behavior since at least v1.11 (the old hard-coded R = 1.5). That made Parachute(...) un-instantiable (a breaking change) without adding modeling capability, since there is only one concrete geometry.

Changes

  • Parachute is 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_type is now a class attribute ("generic").
  • HemisphericalParachute becomes 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 the noise parameter — noisy trigger readings should come from the Sensors infrastructure instead. Its drag_coefficient docs no longer suggest flat-circular/extended-skirt values (those stay on the generic class, where they make sense).
  • Legacy Rocket.add_parachute(name, cd_s, ...) builds a generic Parachute again, keeping the FutureWarning nudge towards the object-passing API.
  • Serialization: legacy .rpy signatures (rocketpy.rocket.parachute.Parachute) remap to the generic class at its new module path; round-trips preserve the concrete class.
  • Docs: user guides and example notebooks return to the generic Parachute (several pass noise, which the subclass no longer accepts — including hedy_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

  • Full unit suite: 1690 passed, 13 skipped.
  • Parachute-related flight integration tests: 4 passed.
  • End-to-end smoke: generic Parachute with historical signature reproduces the v1.12 radius/added-mass values; legacy kwargs path emits exactly one FutureWarning and returns a Parachute; legacy .rpy decode reconstructs a generic Parachute with the noise field preserved.

Release note

This PR should be merged to develop and flow to master through #1060 before tagging v1.13.0, so the release ships without the parachute breaking change.

🤖 Generated with Claude Code

Gui-FernandesBR and others added 4 commits July 9, 2026 23:57
…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>
@Gui-FernandesBR Gui-FernandesBR requested a review from a team as a code owner July 10, 2026 03:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.77419% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.83%. Comparing base (f464601) to head (3e84998).

Files with missing lines Patch % Lines
rocketpy/rocket/parachutes/parachute.py 96.49% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant