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

Improve ResultsHandler #295

Open
mlincett opened this issue Aug 18, 2023 · 2 comments
Open

Improve ResultsHandler #295

mlincett opened this issue Aug 18, 2023 · 2 comments

Comments

@mlincett
Copy link
Collaborator

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:

  • should the result object have a flat structure (for example fields like 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;
  • should we standardize the structure using native python dataclasses or be bold and open the door to the use of pydantic in flarestack (after @robertdstein suggestion)?

I will start by converting

self.sensitivity = np.nan
self.sensitivity_err = np.nan
self.bkg_median = np.nan
self.frac_over = np.nan
self.disc_potential = np.nan
self.disc_err = np.nan
self.disc_potential_25 = np.nan
self.disc_ts_threshold = np.nan
self.extrapolated_sens = False
self.extrapolated_disc = False
self.flux_to_ns = np.nan
to a dictionary but I would appreciate some feedback before moving onto more radical improvements.

@JannisNe
Copy link
Collaborator

JannisNe commented Aug 18, 2023

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
Copy link
Collaborator

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.

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

No branches or pull requests

2 participants