Open mlincett opened 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.
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.
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:
sensitivity-value
,sensitivity-error
,discovery-potential-5sigma-value
, etc.) or a nested structure (['sensitivity']['value']
, etc.)? While the nested structure is more intuitive, it is also more complicate to implement and may not really make the object more usable;dataclasses
or be bold and open the door to the use ofpydantic
inflarestack
(after @robertdstein suggestion)?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.