Skip to content

Conversation

CameronBrooks11
Copy link

@CameronBrooks11 CameronBrooks11 commented Aug 27, 2025

Pull request type

  • Code maintenance (refactoring, formatting, tests)

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

Export routines for Flight live as instance methods in rocketpy/simulation/flight.py (export_data, export_pressures, export_sensor_data, export_kml). This mixes simulation with I/O concerns and forces an import-time dependency on simplekml for users who do not export.

New behavior

  • Extracted exporters into a new class FlightDataExporter at rocketpy/simulation/flight_data_exporter.py.
  • Added deprecation wrappers on Flight methods that delegate to FlightDataExporter and emit DeprecationWarning with migration guidance.
  • Re-exported FlightDataExporter in rocketpy/simulation/__init__.py.
  • No functional changes to outputs or signatures aside from deprecation.
  • Deprecation schedule: wrappers remain until v1.12.0.
  • Migration example:
from rocketpy.simulation import FlightDataExporter

exporter = FlightDataExporter(test_flight)
exporter.export_data("out.csv", "angle_of_attack", "mach_number")

Breaking change

  • No

Additional information

  • Local runs show deprecation warnings during integration tests where legacy methods are exercised. Example: Moved to FlightDataExporter.export_data() and will be removed in v1.12.0.
  • Headless plotting for integration tests was configured with MPLBACKEND=Agg.
  • Formatting-only changes were intentionally excluded from this PR to keep the diff focused on the refactor.

@Gui-FernandesBR
Copy link
Member

I really like what I see here... I will take a look at it asap

Copy link

codecov bot commented Aug 27, 2025

Codecov Report

❌ Patch coverage is 82.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.12%. Comparing base (f17893b) to head (1ec0f48).
⚠️ Report is 21 commits behind head on develop.

Files with missing lines Patch % Lines
rocketpy/simulation/flight_data_exporter.py 79.54% 18 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #845      +/-   ##
===========================================
+ Coverage    80.02%   80.12%   +0.09%     
===========================================
  Files           98      104       +6     
  Lines        12004    12552     +548     
===========================================
+ Hits          9606    10057     +451     
- Misses        2398     2495      +97     

☔ 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.

@CameronBrooks11
Copy link
Author

Sounds good, let me know if there's anything that needs to be done or revised before this can be merged to develop...I have some enhancements of the kml export I have in the works and I'd rather not stack the PR branches and have to deal with rebasing later if we can help it :)

@CameronBrooks11
Copy link
Author

@Gui-FernandesBR Sorry if this PR disappeared for a few days...my account got false flagged by the GitHub bots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants