consolidate dataclasses #1571
Replies: 3 comments
-
I would not mind if we started a |
Beta Was this translation helpful? Give feedback.
-
I will try to provide a bit of information about the status in The containers used in fit_results = cabinetry.fit.fit(model, data)
cabinetry.visualize.pulls(fit_results) # plot needs best-fit parameters and uncertainties
cabinetry.visualize.correlation_matrix(fit_results) # plot needs parameter correlations
# model prediction needs best-fit parameters, uncertainties, correlations
model_prediction = cabinetry.model_utils.prediction(model, fit_results=fit_results) This approach means that users do not need to think about all the details about which function needs which aspects of a MLE result, but they can access individual parts of it if needed. Since the containers were written with the You can also find the containers in the code / documentation. They are all simple named tuples at the moment. Here is a list of the current containers used in
There is also a fairly new All the containers in |
Beta Was this translation helpful? Give feedback.
-
IMO dataclasses are often useful (just as named tuples are) because they communicate composite return values clearly, in a static way. Regarding where to put them, I dont think this has to be pre-planned big hairy project. Regarding where dataclasses might be good to have, @lukasheinrich has many good suggestions. Especially useful from a user perspective:
As far as harmonizing with |
Beta Was this translation helpful? Give feedback.
-
continue discussion from #1554 cc @lhenkelm @alexander-held @matthewfeickert
there seems to be a need for container objects/dataclasses/tuples to carry around some details of internal things
examples:
OptimizerResult
FitResult (from cabinetry)
HypoTestResult (like the one from ROOT)
HypoTestScan (for CLs plots)
CalculatorDetails (like BestFitParameters from @lhenkelm in #1554)
others could even be
FitConfig (S+B configuratiion, B-only configuration, like ROOT or our (init_pars,par_bounds,fixed_pars) tuple)
Data (like ROOT's RooDataset)
this could be designed in a rather pyhf-independent way (like tensorlib)
this discussin should try to tackle
Beta Was this translation helpful? Give feedback.
All reactions