From 529e327ae87fcdce449b9fba7e0fda4febe4a3a9 Mon Sep 17 00:00:00 2001 From: James Varndell Date: Thu, 27 Jun 2024 15:56:03 +0100 Subject: [PATCH] Bugfix: make auto styles work without override kwargs --- src/earthkit/plots/components/subplots.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/earthkit/plots/components/subplots.py b/src/earthkit/plots/components/subplots.py index 519b534..3fe6c21 100644 --- a/src/earthkit/plots/components/subplots.py +++ b/src/earthkit/plots/components/subplots.py @@ -324,7 +324,11 @@ def _extract_plottables( key: kwargs.pop(key) for key in _STYLE_KWARGS if key in kwargs } # These are kwargs which can be overridden without forcing a new Style - override_kwargs = {key: style_kwargs.pop(key) for key in _OVERRIDE_KWARGS} + override_kwargs = { + key: style_kwargs.pop(key) + for key in _OVERRIDE_KWARGS + if key in style_kwargs + } if style_kwargs: style_class = ( Style if not method_name.startswith("contour") else Contour