Skip to content
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

ENH: Clean Plots and Prints Subpackages init files #457

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

MateusStano
Copy link
Member

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 --runslow) have passed locally

Current behavior

Because of some circular imports errors, the __init__.py file of the plots subpackage was changed to be empty. This is not an issue because the plots classes are only meant to be imported in other files of the library. However, the CompareFlights class is in this subpackage, and it is meant to be easily imported.

New behavior

The prints subpackage __init.py__ file is also empty and the imports for the Compare classes have been added

Breaking change

  • Yes
  • No

Additional information

Just to make things clear. Currently, in master we can do:

from rocketpy.plots import _EnvironmentPlots

or

from rocketpy.plots.environment_plots import _EnvironmentPlots

and for compare we had to do

from rocketpy.plots.compare import CompareFlights

With the changes of this PR, we can do only

from rocketpy.plots.environment_plots import _EnvironmentPlots

and for compare we now can do

from rocketpy import CompareFlights

or

from rocketpy.plots import CompareFlights

@MateusStano MateusStano added this to the Release v1.X.0 milestone Nov 9, 2023
@MateusStano MateusStano self-assigned this Nov 9, 2023
Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

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

Well done!
The plots and prints modules are more consistent now.

rocketpy/__init__.py Show resolved Hide resolved
rocketpy/__init__.py Show resolved Hide resolved
@MateusStano MateusStano merged commit 6f544bb into develop Nov 13, 2023
12 checks passed
@MateusStano MateusStano deleted the enh/clean-plots-print-init branch November 13, 2023 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

3 participants