-
Notifications
You must be signed in to change notification settings - Fork 99
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
Refactor chaco OverlayPlotContainer to inherit from enable OverlayContainer #758
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the trait is already defined in BasePlotContainer but we redefine it in the subclass so that we can eventually stop inheriting from it modified: chaco/plot_containers.py
like before, this trait is already defined in BasePlotContainer but we duplicate it in the subclass so that we can stop inheriting from BasePlotContainer modified: chaco/plot_containers.py
all of the traits defined in BasePlotContainer have been redefined in OverlayPlotContainer. so OverlayPlotContainer can just inherit from Container directly modified: chaco/plot_containers.py
and remove the now redundant definitions of the methods get_preferred_size and _do_layout modified: chaco/plot_containers.py
aaronayres35
approved these changes
Jun 7, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rahulporuri
pushed a commit
that referenced
this pull request
Jun 8, 2021
…tainer (#758) * REF : Redefine container_under_layers in OverlayPlotContainer the trait is already defined in BasePlotContainer but we redefine it in the subclass so that we can eventually stop inheriting from it modified: chaco/plot_containers.py * REF : Redefine draw_layer trait in subclass like before, this trait is already defined in BasePlotContainer but we duplicate it in the subclass so that we can stop inheriting from BasePlotContainer modified: chaco/plot_containers.py * REF : Stop inheriting from BasePlotContainer all of the traits defined in BasePlotContainer have been redefined in OverlayPlotContainer. so OverlayPlotContainer can just inherit from Container directly modified: chaco/plot_containers.py * REF : Make OverlayPlotContainer inherit from enable OverlayContainer and remove the now redundant definitions of the methods get_preferred_size and _do_layout modified: chaco/plot_containers.py
rahulporuri
pushed a commit
that referenced
this pull request
Jun 8, 2021
* Refactor chaco OverlayPlotContainer to inherit from enable OverlayContainer (#758) * REF : Redefine container_under_layers in OverlayPlotContainer the trait is already defined in BasePlotContainer but we redefine it in the subclass so that we can eventually stop inheriting from it modified: chaco/plot_containers.py * REF : Redefine draw_layer trait in subclass like before, this trait is already defined in BasePlotContainer but we duplicate it in the subclass so that we can stop inheriting from BasePlotContainer modified: chaco/plot_containers.py * REF : Stop inheriting from BasePlotContainer all of the traits defined in BasePlotContainer have been redefined in OverlayPlotContainer. so OverlayPlotContainer can just inherit from Container directly modified: chaco/plot_containers.py * REF : Make OverlayPlotContainer inherit from enable OverlayContainer and remove the now redundant definitions of the methods get_preferred_size and _do_layout modified: chaco/plot_containers.py * Use stack layout helpers from enable (#757) * CLN : Use stack layout helpers from enable there was duplicate code sitting in chaco that handled getting the preferred stacked container size and that handled doing the layout. this commit updates chaco to make use of the existing helper functions in enable modified: chaco/plot_containers.py * Fix bad merge * Make chaco v/h plot containers inherit from enable v/h stacked containers (#764) * REF : Redefine class-level attr on StackedPlotContainer subclasses specifically, HPlotContainer and VPlotContainer subclasses. this is a small step towards removing the inheritance from StackedPlotContainer modified: chaco/plot_containers.py * REF : Redefine methods defined on StackedPlotContainer specifically, we redefine get_preferred_size and _do_stack_layout methods on the subclasses of StackedPlotContainer modified: chaco/plot_containers.py * REF : Redefine stack_dimension and other_dimension on subclasses with these two traits, we have finally duplicated all methods and traits defined on the StackedPlotContainer in its subclasses. In the next step, we can finally remove the inheritance from StackedPlotContainer modified: chaco/plot_containers.py * CLN : Remove inheritance from StackedPlotContainer and make the subclasses inherit directly from BasePlotContainer instead. also remove the StackedPlotContainer class. We don't need to worry about external users of StackedPlotContainer as the class is private to this module and isn't exposed outside of this module. See __all__ in chaco.plot_containers modified: chaco/plot_containers.py * REF : Redefine BasePlotContainer traits on subclasses and with this, we can remove their dependence on BasePlotContainer as well modified: chaco/plot_containers.py * REF : chaco stacked plot containers now inherit from enable Container we can now start the process of using stacked container classes in enable modified: chaco/plot_containers.py * CLN : Make HPlotContainer inherit from enable HStackedContainer and remove a number of now redundant trait definitions and methods modified: chaco/plot_containers.py * REF : Make VPlotContainer inherit from enable VStackedContainer and remove a number of now redundant trait and methods definitions. also remove unused imports from enable. modified: chaco/plot_containers.py * FIX : Define necessary private cache trait on VPlotContainer _cached_preferred_size is expected and set by the layout machinery. it is defined explicitly on the HPlotContainer and OverlayPlotContainer but not on the VPlotContainer earlier modified: chaco/plot_containers.py * FIX : Dont import stacked containers from enable.api the classes were added to enable.api on the main branch - and they arent available in a released version yet modified: chaco/plot_containers.py * FIX : Install enable from maint/5.2 branch from git source instead of installing enable 5.1.1 via edm this is a temporary solution until enable 5.2.0 is available via edm - at which point the changes in ci should be removed modified: ci/edmtool.py * FIX : Install GL dependencies even on null toolkit because CI now needs to build enable from source modified: .github/workflows/test-with-edm.yml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the chaco
OverlayPlotContainer
to inherit from the enableOverlayContainer
. This PR makes small changes in each commit that slowly moveOverlayPlotContainer
away from the chacoBasePlotContainer
by redefining the traits on the latter on the former. Finally, we update the inheritance and remove redundant methods on theOverlayPlotContainer
.Note that we would like this PR to be backported to the
maint/5.0
branch so that it can be included in the finalmaint/5.0
release.