Skip to content

ENH: Refactoring Flight Plots #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Gui-FernandesBR
Copy link
Member

Pull request type

Please check the type of change your PR introduces:

  • Code maintenance (refactoring, formatting, renaming, tests)

Pull request checklist

Please check if your PR fulfills the following requirements, depending on the type of PR:

  • Code base maintenance (refactoring, formatting, renaming):

    • Docs have been reviewed and added / updated if needed
    • Lint (black rocketpy) has passed locally and any fixes were made
    • All tests (pytest --runslow) have passed locally
  • Code base additions (for bug fixes / features):

    • Tests for the changes have been added
    • Docs have been reviewed and added / updated if needed
    • Lint (black rocketpy) has passed locally and any fixes were made
    • All tests (pytest --runslow) have passed locally

What is the current behavior?

It's quite hard to compare different aspects of a flight when you have more than 1 stage rocket.
Also, a lot of code lines at Flight.py are dedicated exclusively

What is the new behavior?

  • Print and Plot functions were mode from Flight.py to a submodule called rocketpy.plots.flight_plots
  • The old Print ad Plot functions of Flight.py now are calling the functions available at the new file
  • Now there's a for loop inside each plot, allowing you to generate the outputs for n flight objects
  • Also, several compare functions were added, allowing the user to se different flights in a specific chart. Let's say, if you have 10 flight objects, you can plot all the flight.speed at once, in a single figure.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Quite large pull request... But I swear, once you get the idea of one plot, you'll definetely understand the other. The trick part is only about how to initialize the flight_plots class, I confess that I'm not so pround of the difficult to initialize the class, but it's working properly anyway.

Many thanks to github copilot, this little guys has worked like hell past couple days.

@Gui-FernandesBR Gui-FernandesBR added Enhancement New feature or request, including adjustments in current codes Refactor Outputs Dedicated to visualizations enhancements like prints and plots labels Oct 5, 2022
@Gui-FernandesBR Gui-FernandesBR added this to the RocketPy at EuroC 2022 milestone Oct 5, 2022
@Gui-FernandesBR
Copy link
Member Author

Tests are working offline but not on github, I have no clue of what is going on

@Gui-FernandesBR
Copy link
Member Author

Gui-FernandesBR commented Nov 12, 2022

This PR will be desconsidered. @MateusStano is about to create another PR based on beta\v1.0.0 where we will be refactoring all rocketpy plots instead of only those from flight class. I'll link that PR here as soon as he opens it.

The branch will be preserved so we can use the code in the future if needed.

@Gui-FernandesBR
Copy link
Member Author

#287

@Gui-FernandesBR Gui-FernandesBR deleted the enh/complex_simulations_refactor_plots branch January 7, 2023 02:36
@Gui-FernandesBR Gui-FernandesBR removed this from the Release v1.0.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request, including adjustments in current codes Outputs Dedicated to visualizations enhancements like prints and plots Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants