Skip to content

ENH: Restore power_off/on_drag as Function objects; add _input attributes for raw user input and update changelog#941

Open
Copilot wants to merge 3 commits intorel/v1.12.0from
copilot/sub-pr-935-again
Open

ENH: Restore power_off/on_drag as Function objects; add _input attributes for raw user input and update changelog#941
Copilot wants to merge 3 commits intorel/v1.12.0from
copilot/sub-pr-935-again

Conversation

Copy link

Copilot AI commented Mar 18, 2026

Pull request type

  • Code changes (bugfix, features)
  • Code maintenance (refactoring, formatting, tests)
  • ReadMe, Docs and GitHub updates
  • Other (please describe):

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

Rocket.power_off_drag and Rocket.power_on_drag had been changed to store raw user input, which broke backward compatibility because these public attributes were historically Function objects. This also created type inconsistency depending on construction path (for example, from_dict could still pass a Function).

New behavior

  • Restores Rocket.power_off_drag and Rocket.power_on_drag as Mach-only Function objects (aliasing power_off_drag_by_mach and power_on_drag_by_mach) to preserve the public API.
  • Preserves original user-provided drag inputs via new attributes:
    • power_off_drag_input
    • power_on_drag_input
  • Updates related docstrings in:
    • rocketpy/rocket/rocket.py
    • rocketpy/rocket/point_mass_rocket.py
  • Adds an Unreleased → Fixed changelog entry in CHANGELOG.md for this PR.

Breaking change

  • Yes
  • No

Additional information

This stacked PR targets rel/v1.12.0 and includes the follow-up changelog update requested in review feedback.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

… raw user input

Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback from review on PR #935 for rel/v1.12.0 adjustments ENH: Restore power_off/on_drag as Function objects; add _input attributes for raw user input Mar 18, 2026
Copilot AI requested a review from MateusStano March 18, 2026 01:37
@MateusStano
Copy link
Member

@copilot add pr to changelog

Co-authored-by: MateusStano <69485049+MateusStano@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 18, 2026

@copilot add pr to changelog

Done in e750b18. Added this PR to CHANGELOG.md under UnreleasedFixed.

@MateusStano MateusStano marked this pull request as ready for review March 18, 2026 01:56
@MateusStano MateusStano requested a review from a team as a code owner March 18, 2026 01:56
Copilot AI changed the title ENH: Restore power_off/on_drag as Function objects; add _input attributes for raw user input ENH: Restore power_off/on_drag as Function objects; add _input attributes for raw user input and update changelog Mar 18, 2026
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.06%. Comparing base (1618fb0) to head (e750b18).

Additional details and impacted files
@@             Coverage Diff              @@
##           rel/v1.12.0     #941   +/-   ##
============================================
  Coverage        81.05%   81.06%           
============================================
  Files              107      107           
  Lines            13891    13893    +2     
============================================
+ Hits             11260    11262    +2     
  Misses            2631     2631           

☔ View full report in Codecov by Sentry.
📢 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.

Comment on lines +385 to +386
self.power_off_drag_input = power_off_drag
self.power_on_drag_input = power_on_drag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe?

Suggested change
self.power_off_drag_input = power_off_drag
self.power_on_drag_input = power_on_drag
self._power_off_drag_input = power_off_drag
self._power_on_drag_input = power_on_drag

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.

3 participants