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 a function to purge unused configs #800

Merged
merged 6 commits into from
Apr 3, 2024
Merged

Add a function to purge unused configs #800

merged 6 commits into from
Apr 3, 2024

Conversation

dachengx
Copy link
Collaborator

@dachengx dachengx commented Feb 2, 2024

What is the problem / what does the code in this PR do

Sometimes we see a lot of warnings from

self.log.warning(f"Option {k} not taken by any registered plugin")
because some unnecessary configs are set. Examples: https://xenonnt.slack.com/archives/C016DM0JPK9/p1702545417958799 and https://xenonnt.slack.com/archives/C016DM0JPK9/p1705510467687369.

WARNING:strax:Option check_raw_record_overlaps not taken by any registered plugin
WARNING:strax:Option gain_model not taken by any registered plugin
WARNING:strax:Option gain_model_nv not taken by any registered plugin
...

Can you briefly describe how it works?

This PR provides a function to purge those configs. But be cautious with it! Only use it when you stop registering more new plugins.

Can you give a minimal working example (or illustrate with a figure)?

Please include the following if applicable:

  • Update the docstring(s)
  • Update the documentation
  • Tests to check the (new) code is working as desired.
  • Does it solve one of the open issues on github?

Please make sure that all automated tests have passed before asking for a review (you can save the PR as a draft otherwise).

@dachengx dachengx marked this pull request as ready for review February 2, 2024 14:35
@coveralls
Copy link

coveralls commented Feb 2, 2024

Coverage Status

coverage: 91.502% (+0.03%) from 91.47%
when pulling 31cf51b on remove_configs
into ff81edb on master.

@yuema137 yuema137 self-requested a review March 12, 2024 01:58
Copy link
Collaborator

@yuema137 yuema137 left a comment

Choose a reason for hiding this comment

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

Looks good to me as it provides an option for users to clean up the config.

@dachengx dachengx merged commit 1ce8401 into master Apr 3, 2024
9 checks passed
@dachengx dachengx deleted the remove_configs branch April 3, 2024 09:39
@dachengx
Copy link
Collaborator Author

dachengx commented Apr 4, 2024

Before this PR:
image

After this PR:
image

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.

3 participants