Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UoM add units for humidity #4157

Closed
wants to merge 3 commits into from
Closed

Conversation

andrewfg
Copy link
Contributor

Resolves #4155

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg requested a review from a team as a code owner March 20, 2024 17:52
@andrewfg andrewfg changed the title UoM add unit for humidity UoM add units for humidity Mar 20, 2024
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@mherwege
Copy link
Contributor

I think the g/kg unit makes sense. I am more reluctant about % r.H. To me this is still %, nothing else.
If you want this to mean relative humidity, it should be called that way as channel name and item name, not by tweaking the unit.
another channel would be called absolute humidity and have a unit hint of g/kg. (I hope that PR gets merged eventually)
I would not have the UOM system convert between them, as it is only an approximative conversion. If you want such a conversion, it could be done in the binding, between the channels, with the clear disclaimer that it is only valid at 20°C. Another binding may be linked to a device that gives a more accurate value for both absolute and relative humidity, and keeping it in two distinct channels therefore feels more natural to me.

@andrewfg
Copy link
Contributor Author

I think the g/kg unit makes sense. I am more reluctant about % r.H.

Honestly if we choose not to do relative humidity then absolute humidity "by mass ratio" should probably also be cancelled. There are in fact three humidity measures -- namely relative humidity (%rH), absolute humidity "by mass ratio" (g/Kg), and absolute humidity "by volume" (g/m³). You don't like the former. The latter is already a standard unit of density. So if we drop those two, we may as well drop them all.

I would not have the UOM system convert between them, as it is only an approximative conversion.

Yeah. I only really did that because I could not find a way to PREVENT conversion (i.e. make it throw an exception). Given that I could not prevent conversion I thought it best to at least return something that more-or-less correct -- rather than absolutely wrong..

@mherwege
Copy link
Contributor

mherwege commented Mar 31, 2024

@andrewfg I don’t agree with this.
First, relative humidity is a fraction, typically expressed in %. Whether you put r.H. behind it does not make a difference. It is a percentage. It would be nice to be able to put it behind the text, but it does not make a difference in meaning.
Second, converting between incompatible measurements, even in the same unit, is an error. For absolute humidity, while g/kg is a customary (dimensionless) unit, expressing it as kg/kg or % is valid as well. 1% of absolute humidity would be 10 g/kg. I agree adding g/kg as a customary unit because it otherwise is not supported for Number:Dimensionless, and it is a valid dimensionless unit.
If you think about it, also dB is a dimensionless unit. Everyone would agree it does not make sense to convert certain dimensionless measurements to dB, just like you would not convert number of apples to number of pears because it is the same dimensionless unit of ONE.

So creating an almost arbitrary conversion between incompatible measurements is a total no go to me.

see also:
https://en.wikipedia.org/wiki/Humidity?wprov=sfti1

@andrewfg
Copy link
Contributor Author

Closing this.

@andrewfg andrewfg closed this Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[rfc] UoM shall I create a new unit(s) for humidity??
2 participants