Closed jgrewe closed 7 years ago
Thanks for making an issue out of this and opening the discussion. We discussed this a few times and I think you summarised everything we mentioned nicely, so we all know the options.
I wonder if it would be reasonable to give users a choice when creating a file of turning off SI unit support. This could be a top level file attribute that when set disables unit scaling but allows anything to be entered into unit properties.
This is just a new idea that I haven't considered much, so feel free to dismiss it if it sounds terrible.
closed via pr #704
In NIX we do only accept SI units or compound units consisting of only SI where ever a unit can be set. This is very strict and could be relaxed (user request) a bit.
We need to ensure scalability for the data access functions at
Tag
andMultiTag
so setting non-scalable units in these entities as well as the dimension descriptors will make it impossible to return the correct slices. I see two options if we want to relax unit handling:Allow non-SI in everywhere: In this case we need to check at the critical places (e.g. dimensions, tag positions/extents) and maybe warn if this will lead to problems. Question here, how should the data access methods respond to this? We could skip scaling and just assume 1:1 matching (maybe even check on equality and go on and throw an exception if no match). We could throw an exception when using these functions (quite rude)
Allow non-SI in metadata and DataArray values. Caveat: Things will break in
AliasRange
where the DataArray unit is used for calculating the index during data access.If we don't want to go that way we still may decide to switch to a more potent library for unit conversions (boost::units)...