pint icon indicating copy to clipboard operation
pint copied to clipboard

Supporting multiple CODATA versions (variants)

Open zerothi opened this issue 2 years ago • 2 comments

Would it make sense to enable Pint to have different table for different requests.

I.e. one could wish to benchmark stuff using CODATA 2014 and 2018 and 2022 against each other. Currently it seems that units are fixed and needs new releases when data is updated.

It would be useful for backwards compatibility of dependent libraries to be able to selectively choose a variant.

zerothi avatar Nov 30 '21 12:11 zerothi

You may create and use your own registry files and load them via pint.UnitRegistry(filename='myreg'). Is that maybe good enough?

see also https://pint.readthedocs.io/en/stable/tutorial.html?highlight=registry#using-pint-in-your-projects

I think it is in general a good idea to derive a smaller domain-adjusted registry and use that instead of the big default one.

dalito avatar Nov 30 '21 13:11 dalito

Agreed about the work-around.

However, the idea here is to have a backward-compatible data-shipped. I think this could be nice. Of course one shouldn't polute the repo with lots of different variants, only some acknowledged set of variants.

zerothi avatar Nov 30 '21 13:11 zerothi