Re: Native support for units [was: custom literals]

On Tue, 5 Apr 2022 at 03:58, Marco Sulla <Marco.Sulla.Python@gmail.com> wrote:
Not sure what you mean by "geometrized", but that would be the same concept as referring to "natural units", wouldn't it? In any case: the speed of light might be 1, but it's still 1 distance divided by 1 time.
Timezone support is a pretty big nightmare too :) ChrisA

On Tue, Apr 05, 2022 at 04:05:36AM +1000, Chris Angelico wrote:
No. https://en.wikipedia.org/wiki/Geometrized_unit_system Time has dimensions of length; so does mass; velocity is dimensionless; acceleration has dimension of inverse length; both pressure and density have dimensions of inverse area. -- Steve

On 5/04/22 6:05 am, Chris Angelico wrote:
If you truly embrace the idea of space and time forming a single 4-dimensional continuum, this makes about as much sense as insisting that north-south and east-west distances are measured in different units. -- Greg

On Tue, Apr 5, 2022 at 5:13 AM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
And they are -- degrees latitude and degrees longitude are very different units :-) -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

On Tue, Apr 5, 2022 at 11:57 AM Steven D'Aprano <steve@pearwood.info> wrote:
People DO sometimes use lat/lon as distances— particularly latitude, where 1 minute is a nautical mile. But anyway, a humorous one-off. But it makes the point that there is no one way to handle units that works for everyone. An astonishing amount of “real work” is done with “squishy” units. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

On 6/04/22 3:47 am, Christopher Barker wrote:
And they are -- degrees latitude and degrees longitude are very different units :-)
I'm thinking more of a local Cartesian coordinate system rather than lat-long. Think about this: You're driving north in a car that's 3m long. You turn east. Do you now have to measure the length of your car in different units? And what about the circumference of a circle? It's going in uncountably many directions at different points. Do we need a similarly uncountable number of units to measure it? Or do we just say "all distances are in metres" and be done with it? -- Greg

On Wed, 6 Apr 2022 at 08:35, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
I would say that degrees latitude and degrees longitude are both the same type of unit: a unit if *angle*. They do not correspond to the same number of meters, but they're not units of distance. There are multiple ways in which you can measure distance by angle, ranging all the way up to the "second of parallax", which is effectively calculating the height of an isosceles triangle based on the interior angle and a base of 1AU. I don't think anyone would ever say that a parsec (several light years) should be considered equivalent to a second of latitude (a handful of meters) just because they both have an angular size of one second! Length is measured in a variety of units, but the degree ain't one of 'em. ChrisA

Length is measured in a variety of units, but the degree ain't one of 'em.
Mostly I was just being silly. But the relevant part is that people do a lot of useful work using values that are not in "proper" units, and don't follow the rules as they should. From things as simple as using kg as weight or lbs as mass, to really oddball stuff like using degrees of latitude as a distance[1]. (or may favorite: API Gravity [2] as a density) Which doesn't mean that proper units are very useful, but a lot of flexibility is needed for many practical uses. -CHB [1] when you are looking at a nautical chart, which are most often in the Mercator Projection, the scale changes with latitude. So it's very handy to use the latitude scale on the map to measure distances -- 1 minute latitude is one nautical mile -- granted, you usually do the conversion directly in your head, or setting it on a dividers, but you ARE measuring distance in latitude minutes. [2] https://en.wikipedia.org/wiki/API_gravity -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

On Wed, 6 Apr 2022 at 13:33, Christopher Barker <pythonchb@gmail.com> wrote:
(or may favorite: API Gravity [2] as a density)
Wow, I have to remember this. I've worked with a lot of APIs in my time, and some of them definitely are more dense than others. ChrisA

On Wed, Apr 06, 2022 at 08:34:35PM +1200, Greg Ewing wrote:
If you've watched the "Solo" movie, then you discover that no, it is actually a unit of distance. He successfully took an impossibly dangerous short-cut that reduced the distance needed to fly. But now we're really off topic :-) -- Steve

On Tue, Apr 05, 2022 at 04:05:36AM +1000, Chris Angelico wrote:
No. https://en.wikipedia.org/wiki/Geometrized_unit_system Time has dimensions of length; so does mass; velocity is dimensionless; acceleration has dimension of inverse length; both pressure and density have dimensions of inverse area. -- Steve

On 5/04/22 6:05 am, Chris Angelico wrote:
If you truly embrace the idea of space and time forming a single 4-dimensional continuum, this makes about as much sense as insisting that north-south and east-west distances are measured in different units. -- Greg

On Tue, Apr 5, 2022 at 5:13 AM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
And they are -- degrees latitude and degrees longitude are very different units :-) -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

On Tue, Apr 5, 2022 at 11:57 AM Steven D'Aprano <steve@pearwood.info> wrote:
People DO sometimes use lat/lon as distances— particularly latitude, where 1 minute is a nautical mile. But anyway, a humorous one-off. But it makes the point that there is no one way to handle units that works for everyone. An astonishing amount of “real work” is done with “squishy” units. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

On 6/04/22 3:47 am, Christopher Barker wrote:
And they are -- degrees latitude and degrees longitude are very different units :-)
I'm thinking more of a local Cartesian coordinate system rather than lat-long. Think about this: You're driving north in a car that's 3m long. You turn east. Do you now have to measure the length of your car in different units? And what about the circumference of a circle? It's going in uncountably many directions at different points. Do we need a similarly uncountable number of units to measure it? Or do we just say "all distances are in metres" and be done with it? -- Greg

On Wed, 6 Apr 2022 at 08:35, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
I would say that degrees latitude and degrees longitude are both the same type of unit: a unit if *angle*. They do not correspond to the same number of meters, but they're not units of distance. There are multiple ways in which you can measure distance by angle, ranging all the way up to the "second of parallax", which is effectively calculating the height of an isosceles triangle based on the interior angle and a base of 1AU. I don't think anyone would ever say that a parsec (several light years) should be considered equivalent to a second of latitude (a handful of meters) just because they both have an angular size of one second! Length is measured in a variety of units, but the degree ain't one of 'em. ChrisA

Length is measured in a variety of units, but the degree ain't one of 'em.
Mostly I was just being silly. But the relevant part is that people do a lot of useful work using values that are not in "proper" units, and don't follow the rules as they should. From things as simple as using kg as weight or lbs as mass, to really oddball stuff like using degrees of latitude as a distance[1]. (or may favorite: API Gravity [2] as a density) Which doesn't mean that proper units are very useful, but a lot of flexibility is needed for many practical uses. -CHB [1] when you are looking at a nautical chart, which are most often in the Mercator Projection, the scale changes with latitude. So it's very handy to use the latitude scale on the map to measure distances -- 1 minute latitude is one nautical mile -- granted, you usually do the conversion directly in your head, or setting it on a dividers, but you ARE measuring distance in latitude minutes. [2] https://en.wikipedia.org/wiki/API_gravity -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython

On Wed, 6 Apr 2022 at 13:33, Christopher Barker <pythonchb@gmail.com> wrote:
(or may favorite: API Gravity [2] as a density)
Wow, I have to remember this. I've worked with a lot of APIs in my time, and some of them definitely are more dense than others. ChrisA

On Wed, Apr 06, 2022 at 08:34:35PM +1200, Greg Ewing wrote:
If you've watched the "Solo" movie, then you discover that no, it is actually a unit of distance. He successfully took an impossibly dangerous short-cut that reduced the distance needed to fly. But now we're really off topic :-) -- Steve
participants (4)
-
Chris Angelico
-
Christopher Barker
-
Greg Ewing
-
Steven D'Aprano