XENONnT / straxen

Streaming analysis for XENON
BSD 3-Clause "New" or "Revised" License
20 stars 32 forks source link

Add xedocs version to context config, only if xedocs is called #1393

Closed Ananthu-Ravindran closed 3 months ago

Ananthu-Ravindran commented 3 months ago

Part of this PR, following this old conversation.

What does the code in this PR do / what does it improve?

Very minor addition: It adds the global version used in the context to the straxen context_configs. This is just to help to know what global version they are on, because some analysis have frozen global versions (Warnings when a frozen global version is not the same as the specified version is given by the cutax PR 429 as well)

Note: Doing st.set_context_config() after the initialization still does not change the global version (and it is not encouraged to change it mid-analysis). This addition does nothing to the actual processing other than make this information available :)

Can you briefly describe how it works?

Only adds a new key 'xedocs_version' to the context_configs, and only if the analysis actually uses xedocs during initialization.

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

On this branch of straxen,

st=cutax.xenonnt_offline() #or any other context st.context_config

Please include the following if applicable:

Notes on testing

All italic comments can be removed from this template.

Ananthu-Ravindran commented 3 months ago

I think the tests are failing because of the issue with requirements' versions?

coveralls commented 3 months ago

Coverage Status

coverage: 91.067% (-0.07%) from 91.133% when pulling 6941a1d203ba00240f8e889d5903363acd89b418 on xedocs_version_in_config into 0286b80b3d1aa36984725bab98d589c6fb2b10ff on master.

coveralls commented 3 months ago

Coverage Status

coverage: 91.134% (+0.001%) from 91.133% when pulling 6941a1d203ba00240f8e889d5903363acd89b418 on xedocs_version_in_config into 0286b80b3d1aa36984725bab98d589c6fb2b10ff on master.

coveralls commented 3 months ago

Coverage Status

coverage: 91.093% (-0.04%) from 91.133% when pulling 6941a1d203ba00240f8e889d5903363acd89b418 on xedocs_version_in_config into 0286b80b3d1aa36984725bab98d589c6fb2b10ff on master.

coveralls commented 3 months ago

Coverage Status

coverage: 91.134% (+0.001%) from 91.133% when pulling 6941a1d203ba00240f8e889d5903363acd89b418 on xedocs_version_in_config into 0286b80b3d1aa36984725bab98d589c6fb2b10ff on master.

Ananthu-Ravindran commented 3 months ago

Just to document before we merge this, because xedocs version is added to the context config and it basically does nothing other than just make that information available, this warning will appear everytime a context with xedocs version is initialized: Unknown config option xedocs_version; will do nothing. Invalid context option xedocs_version; will do nothing.

This doesn't affect anything else in any way :)