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 derigister plugins #560

Merged
merged 5 commits into from Oct 29, 2021
Merged

Add derigister plugins #560

merged 5 commits into from Oct 29, 2021

Conversation

WenzDaniel
Copy link
Collaborator

What is the problem / what does the code in this PR do
In this PR we add a small function which cleans the plugin class registry in case some data types are not provided. This can be handy if for example the user would like to replace the DAQReader with some simulation plugin which does not provide for example an output for the muon and neutron-veto.

Can you briefly describe how it works?
Loops over plugin class registry until all plugin provides are provided by other plugins. Added also a test for it

Copy link
Member

@JoranAngevaare JoranAngevaare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Daniel, looks simple.

We could make it more efficient by first making a list of all provided plugins, then check which plugins have a dependency which is not in that list, and follow their provides and depends to increase the total list of to delete the plugins, then you don't have to do this lengthy while loop.

Not that it matters, probably this is also very fast but it seems a bit more complex than it has to 😉

strax/context.py Outdated Show resolved Hide resolved
WenzDaniel and others added 2 commits October 29, 2021 11:27
Co-authored-by: Joran Angevaare <jorana@nikhef.nl>
@WenzDaniel WenzDaniel merged commit c8e9185 into master Oct 29, 2021
@WenzDaniel WenzDaniel deleted the add_derigister_plugins branch October 29, 2021 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants