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

Add warning #776

Merged
merged 8 commits into from Dec 20, 2023
8 changes: 7 additions & 1 deletion strax/context.py
Expand Up @@ -340,10 +340,16 @@ 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(
"Provides of multi-output plugins overlap, deregister old plugins"
f" {old_plugin}."
)
del self._plugin_class_registry[d]

already_seen = []
Expand Down