From 62c5f8ef6ec1562c945fb8052057f83ff56c7789 Mon Sep 17 00:00:00 2001 From: WenzDaniel Date: Mon, 20 Nov 2023 07:22:49 -0600 Subject: [PATCH 1/3] Add warning --- strax/context.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/strax/context.py b/strax/context.py index 5b69ba13a..ae8ad0038 100644 --- a/strax/context.py +++ b/strax/context.py @@ -340,10 +340,13 @@ def register(self, plugin_class): # If we booted a plugin from a datatype, we must boot it from other # datatypes it makes too, to preserve a one-to-one mapping between # datatypes and registered plugins. - for old_plugin in deregistered: + for old_plugin in set(deregistered): for d in old_plugin.provides: currently_registered = self._plugin_class_registry.get(d) if old_plugin == currently_registered: + # Must be equal here, because we are only looking for the remanants which were + # not overwritten above. + warnings.warn(f'Provides of multi-output plugins overlap dregister plugin {old_plugin}.') del self._plugin_class_registry[d] already_seen = [] From c0cecbbe3c872c23ff1ae33484e1a574cc06de6d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:37:32 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- strax/context.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/strax/context.py b/strax/context.py index ae8ad0038..3127788ca 100644 --- a/strax/context.py +++ b/strax/context.py @@ -344,9 +344,11 @@ def register(self, plugin_class): for d in old_plugin.provides: currently_registered = self._plugin_class_registry.get(d) if old_plugin == currently_registered: - # Must be equal here, because we are only looking for the remanants which were + # Must be equal here, because we are only looking for the remanants which were # not overwritten above. - warnings.warn(f'Provides of multi-output plugins overlap dregister plugin {old_plugin}.') + warnings.warn( + f"Provides of multi-output plugins overlap dregister plugin {old_plugin}." + ) del self._plugin_class_registry[d] already_seen = [] From b5500581678ddbdcca8ec4c543c263c9e192ed6d Mon Sep 17 00:00:00 2001 From: WenzDaniel Date: Thu, 14 Dec 2023 00:52:51 -0600 Subject: [PATCH 3/3] Fixed typo --- strax/context.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/strax/context.py b/strax/context.py index ae8ad0038..c3eddb706 100644 --- a/strax/context.py +++ b/strax/context.py @@ -344,9 +344,12 @@ def register(self, plugin_class): for d in old_plugin.provides: currently_registered = self._plugin_class_registry.get(d) if old_plugin == currently_registered: - # Must be equal here, because we are only looking for the remanants which were + # Must be equal here, because we are only looking for the remanants which were # not overwritten above. - warnings.warn(f'Provides of multi-output plugins overlap dregister plugin {old_plugin}.') + warnings.warn( + "Provides of multi-output plugins overlap, deregister old plugins" + f" {old_plugin}." + ) del self._plugin_class_registry[d] already_seen = []