"Unit not specified" VS "Unitless"
cpascual opened this issue · 3 comments
Hi,
This issue is related to a previous discussion in the forum.
Basically we would like Tango to provide a mechanism (e.g. a constant) to indicate that a given attribute is "unitless" and differentiate this situation from the "unit not specified" concept which is the one that is currently assumed implicitly in Tango.
The difference between both concepts is explained in the mentioned forum thread:
2 related-but-different cases regarding value units:
A) no one defined (yet) the units for the attribute (e.g. due to lazy/incomplete configuration in the DB)B) the attribute value is "unitless" (e.g. it is a unitless and dimensionless factor)
As for the solution, the same post proposes:
(...) Tango should clarify this in its docs and should support some standard way of explicitly configuring unitless values (maybe "unitless" or "None" or "No unit").
Also, I think that it would be better if PyTango returned PyTango.constants.UnitNotSpec instead of "No unit" for the case A.Update: see #8 (comment)
Just one clarification:
an alternative solution to that of differentiating cases A) and B) would be to clearly state in the docs that the current constants for "unit not specified" covers both cases. This implies less changes and would also be ok for us.
For the moment in Taurus we are assuming this last case.
PS: but still, we think that even if both A) and B) are treated as equivalent, PyTango should return Update: see #8 (comment)PyTango.constants.UnitNotSpec
instead of "No unit"
Some extra info:
We just found that PyTango.constants.UnitNotSpec is "No unit"
for PyTango < 9 , and ""
(empty string) for PyTango 9.
Therefore the inconsistency that we described above is not really present in PyTango as we believed: PyTango is consistent within a version, and the inconsistency only happens when using different versions for the Server/Database and the client.
So, from our side, we withdraw the request of changes in PyTango9.
It looks like the UnitNotSpec constant change did not make it to JTango so the Java device servers are still returning "No Unit" if nothing was specified.
If UnitNotSpec is set to "" (empty string) in JTango as well, then I think we should not differentiate cases A) and B) and we could indeed improve the documentation and clarify that there is no distinction between cases A) and B).