Open peterstangl opened 4 years ago
I actually find the implementation with the two classes Parameter and ParameterConstraints a bit confusing for the user and I think it might be more intuitive if the Parameter class would be analogous to Measurement, i.e. if it would be itself a subclass of Constraints and one would completely drop the ParameterConstraints class. Even though the value of a parameter can change while its metadata stays the same and this is not true for a measurement, this different treatment of Measurement and Parameter could be implemented on the level of these two classes.
I agree that it's confusing; but Measurement
is essentially a collection of ProbabilityDistribution
s associated with Observables
; a ParameterConstraints
(I always hated that name) a collection of ProbabilityDistribution
s associated with Parameter
s. So just like the Observable
is something that exists even without a measurement, the Parameter
is something that exists without a constraint. Merging Parameter
and ParameterConstraint
to me seems more like merging Measurement
and Observable
.
But the analogy with Measurements
is perhaps still useful. The main difference between ParameterConstraints
and Measurement
is that, at the moment, there is only a single instance of the former in every instance, e.g. default_parameters
. One could move to a scheme where they are treated more like Measurement
where there is a single file with many different "parameter collections", that would then each have a distinct citation associated with them.
Apart from this, I was also thinking about whether the functions in falvio.measurements and flavio.parameters could be made class methods of the Measurement and Parameter classes. This might also be more intuitive since at least I always got confused by the fact that there is both flavio.Measurement and flavio.measurements as well as flavio.Parameter and flavio.parameters.
Yes, fully agree, parameters.py
and measurements.py
are a horrible mess.
I agree that it's confusing; but
Measurement
is essentially a collection ofProbabilityDistribution
s associated withObservables
; aParameterConstraints
(I always hated that name) a collection ofProbabilityDistribution
s associated withParameter
s. So just like theObservable
is something that exists even without a measurement, theParameter
is something that exists without a constraint. MergingParameter
andParameterConstraint
to me seems more like mergingMeasurement
andObservable
.But the analogy with
Measurements
is perhaps still useful. The main difference betweenParameterConstraints
andMeasurement
is that, at the moment, there is only a single instance of the former in every instance, e.g.default_parameters
. One could move to a scheme where they are treated more likeMeasurement
where there is a single file with many different "parameter collections", that would then each have a distinct citation associated with them.
Yes, I think this is a very good idea! One could e.g. have one "parameter collection" for each correlated set of parameters and one collection each for the uncorrelated parameters from the PDG, from FLAG, etc.. And each of these collections could be implemented exactly like a measurement and would have an inspire ID (and one could rename the key "experiment" into "collaboration" to make it apply to both measurements and parameter collections).
Then one could also rename ParameterConstraints
into ParameterCollection
. And the parameters in a ParameterCollection
(like the measured observables in a Measurement
) could still correspond to instances of a new Constraint
class (that associates a single ProbabilityDistrubution
with one or multiple parameters or measured observales).
This issue is based on the discussion in PR #123:
@MJKirk:
@DavidMStraub:
I actually find the implementation with the two classes
Parameter
andParameterConstraints
a bit confusing for the user and I think it might be more intuitive if theParameter
class would be analogous toMeasurement
, i.e. if it would be itself a subclass ofConstraints
and one would completely drop theParameterConstraints
class. Even though the value of a parameter can change while its metadata stays the same and this is not true for a measurement, this different treatment ofMeasurement
andParameter
could be implemented on the level of these two classes. Then one could again merge the three parameter YAML files into one file analogous tomeasurements.yaml
, which I think would also be more intuitive.I think it is actually a very good idea then to use a
Constraint
class instead of the_parameters
dict and the_constraints
list. This might make it also easier to access theProbabilityDistrubution
, e.g. for plotting experimental data.Apart from this, I was also thinking about whether the functions in
falvio.measurements
andflavio.parameters
could be made class methods of theMeasurement
andParameter
classes. This might also be more intuitive since at least I always got confused by the fact that there is bothflavio.Measurement
andflavio.measurements
as well asflavio.Parameter
andflavio.parameters
.@DavidMStraub what do you think?