X Tutup
Skip to content

ENH: Clean Plots and Prints Subpackages init files#457

Merged
MateusStano merged 1 commit intodevelopfrom
enh/clean-plots-print-init
Nov 13, 2023
Merged

ENH: Clean Plots and Prints Subpackages init files#457
MateusStano merged 1 commit intodevelopfrom
enh/clean-plots-print-init

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.

@MateusStano MateusStano merged commit 6f544bb into develop Nov 13, 2023
@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

No open projects
Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup