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

BUG: hotfix iterative plot annotations #4160

Merged
merged 2 commits into from
Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion yt/visualization/plot_modifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
)
from yt.utilities.math_utils import periodic_ray
from yt.utilities.on_demand_imports import NotAModule
from yt.visualization._commons import _swap_arg_pair_order, _swap_axes_extents
from yt.visualization._commons import (
_swap_arg_pair_order,
_swap_axes_extents,
invalidate_plot,
)
from yt.visualization.base_plot_types import CallbackWrapper
from yt.visualization.image_writer import apply_colormap
from yt.visualization.plot_window import PWViewerMPL
Expand Down Expand Up @@ -83,6 +87,7 @@ def __init_subclass__(cls, *args, **kwargs):
incompatible_plot_types = cls._incompatible_plot_types
type_name = cls._type_name

@invalidate_plot
def closure(self, *args, **kwargs):
nonlocal supported_geometries
nonlocal incompatible_plot_types
Expand All @@ -101,6 +106,7 @@ def closure(self, *args, **kwargs):
if self._plot_type in incompatible_plot_types:
raise YTUnsupportedPlotCallback(type_name, self._plot_type)
self._callbacks.append(cls(*args, **kwargs))
return self

update_wrapper(
wrapper=closure,
Expand Down