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
[RFC] Prototyping better temperature handling. #177
Conversation
Codecov Report
@@ Coverage Diff @@
## master #177 +/- ##
==========================================
- Coverage 74.77% 74.12% -0.66%
==========================================
Files 15 14 -1
Lines 904 939 +35
==========================================
+ Hits 676 696 +20
- Misses 228 243 +15
Continue to review full report at Codecov.
|
642dea8
to
fee36e7
Compare
fee36e7
to
cbb435d
Compare
cbb435d
to
3a86225
Compare
Thanks! I've only glanced over the general affine quantity implementation, but a few quick comments regarding the temperature-specific bits:
|
Ha, I was borrowing the terminology that #176 used and not thinking. You're absolutely right about that, though. |
…suggestions. - Celsius, Fahrenheit are always affine units now, and do not represent temperature differences.
Alright, now I've switched the terminology around ( |
Enables the following: `10*Unitful.ContextUnits(°C,°C) + 2K == (12//1)°C`
- `zero` is supposed to return the same type; not possible for affine quantities. we could consider loosening that and return `zero(10°C) === 0K`, for instance. - `one` is not allowed since we don't permit multiplication of affine quantities by scalars - `oneunit` similarly not allowed
One comment on the swap of nomenclature: While I appreciate that "absolute Temperature" has a specific meaning in physics, calling temperature points/coordinates in |
Ok, I've tried to be more explicit to say "relative scale" instead of "relative." I think "relative scale" is commonly used and understood terminology but "relative" is indeed an ambiguous term. I'd like to avoid introducing new jargon though and I worry I will merge once tests pass. |
Alternate approach to #176, will merge in a day if no further objections.
To-do:
bikeshed symbol names (isabs°C
tolerable?)No need for new symbol names. Declare
°C
,°F
are relative scales and shouldn't be used to represent temperature differences (that's whatK
andRa
are for)bikeshed how to display quantities that affine transform under unit conversion (e.g. what we've been calling absolute temperatures). Right now they just show(affine)
after the unit symbols, which is ugly.No need for different display.
*
,/
,+
,^
,inv
,sqrt
,cbrt
,zero
(could be allowed if different type could be returned),one
,oneunit
.ContextUnits
,FixedUnits
, etc. are used