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

Warn for non saved plugins, fix #379 #387

Merged

Conversation

JoranAngevaare
Copy link
Contributor

What is the problem / what does the code in this PR do
Warn if targets are not saved. Otherwise people might get the wrong impression.

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

st=straxen.contexts.xenonnt_online()
st.context_config['check_available'] = strax.to_str_tuple(list(st._plugin_class_registry.keys()))
st.select_runs()
Peaks-plugin is SaveWhen.NEVER. Therefore peaks is most likely not stored!
EventInfoDouble-plugin is SaveWhen.NEVER. Therefore event_info_double is most likely not stored!
nVETOPulseProcessing-plugin is SaveWhen.TARGET. Therefore records_nv is most likely not stored!
PeakPositionsNT-plugin is SaveWhen.NEVER. Therefore peak_positions is most likely not stored!
nVETORecorder-plugin is SaveWhen.TARGET. Therefore raw_records_coin_nv is most likely not stored!
nVETORecorder-plugin is SaveWhen.TARGET. Therefore lone_raw_records_nv is most likely not stored!
PeaksHighEnergy-plugin is SaveWhen.NEVER. Therefore peaks_he is most likely not stored!
nVETORecorder-plugin is SaveWhen.TARGET. Therefore lone_raw_record_statistics_nv is most likely not stored!
muVETOPulseProcessing-plugin is SaveWhen.TARGET. Therefore records_mv is most likely not stored!
AqmonHits-plugin is SaveWhen.TARGET. Therefore aqmon_hits is most likely not stored!
Fetching run info from MongoDB: 100%|██████████| 4881/4881 [00:05<00:00, 924.25it/s]

@JoranAngevaare
Copy link
Contributor Author

@WenzDaniel , you think this makes sense?

Copy link
Collaborator

@WenzDaniel WenzDaniel left a comment

Choose a reason for hiding this comment

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

Yes, I think it make sense. I do not know much about log.warnings. Is this warning just shown once when called st.select_runs ? I do not want to spam people.

@JoranAngevaare
Copy link
Contributor Author

Only if you request for availability of a plugin that is not set by default. I here set it to all plugins:

st.context_config['check_available'] = strax.to_str_tuple(list(st._plugin_class_registry.keys()))

@WenzDaniel
Copy link
Collaborator

Okay perfect, looks fine. Thanks a lot.

@JoranAngevaare JoranAngevaare merged commit e9d3778 into AxFoundation:master Jan 28, 2021
@JoranAngevaare JoranAngevaare deleted the non_saved_targets branch January 28, 2021 15:41
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.

St.select_runs for strax.SaveWhen = Never does not make sense
2 participants