icecube / flarestack

Unbinned likelihood analysis code for astroparticle physics datasets
https://flarestack.readthedocs.io/en/latest/?badge=latest
MIT License
8 stars 7 forks source link

Improve `ResultsHandler` #295

Open mlincett opened 1 year ago

mlincett commented 1 year ago

Following up on #178 I would like to improve ResultsHandler.

As a first step, instead of using class ad-hoc named attributes to store sensitivity, discovery potentials and other outputs I would like to wrap all this in a single object.

Then I would like to add the calculation of the 3 sigma discovery potential (or at least make the significance threshold configurable).

Questions:

I will start by converting https://github.com/icecube/flarestack/blob/d93f5111baa4a3aa2eff0659d834a48cfa9cbac4/flarestack/core/results.py#L104-L114 to a dictionary but I would appreciate some feedback before moving onto more radical improvements.

JannisNe commented 1 year ago

I would really love to use a pydantic model. That way, it would also be really easy to export all the results as a json. I think it should not be that complicated to implement.

JannisNe commented 1 year ago

Re the nested-vs-flat question: I think a nested structure is not that much more useful or intuitive so I think a flat structure is better in terms of complication to usefulness.