flav-io / flavio

A Python package for flavour physics phenomenology in the Standard model and beyond
http://flav-io.github.io/
MIT License
71 stars 62 forks source link

Gamma distributions #210

Closed peterstangl closed 1 year ago

peterstangl commented 1 year ago

This PR is a first step to address issue #209.

The inheritance is now as follows:

DavidMStraub commented 1 year ago

I would suggest avoiding GeneralGammaDistributionPositiveTemporary because even if you have deprecation warnings, it will not be possible for users to migrate to the new class without introducing another breaking change in the future when you rename it back. You can't avoid a breaking change, so just announce it and make a clear cut; ideally, make all arguments of the new class's constructor keyword only, to make sure non-migrated code will raise rather than silently calculating a wrong distribution.

peterstangl commented 1 year ago

I think since GeneralGammaDistributionPositive was not used directly in flavio so far (only as base class of GeneralGammaUpperLimit, which is used for some measurements), and it probably is also not used much outside of flavio, it should be safe to break backward compatibility there. In any case, I made the new arguments of GeneralGammaDistributionPositive keyword only such that using the old interface will raise an error.