Skip to content

Commit

Permalink
Merge pull request #4168 from meeseeksmachine/auto-backport-of-pr-416…
Browse files Browse the repository at this point in the history
…0-on-yt-4.1.x

Backport PR #4160 on branch yt-4.1.x (BUG: hotfix iterative plot annotations)
  • Loading branch information
neutrinoceros authored Oct 14, 2022
2 parents d69f889 + 1123b46 commit e4957fa
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit e4957fa

Please sign in to comment.