
I was looking at Martin Fowler's Quantity pattern earlier. http://martinfowler.com/ap2/quantity.html I remember writing this up as an idea for Fortran back in the early 80's, only to find a CACM paper from 1978 exploring the idea: "Incorporation of Units into Programming Languages", Karr & Loveman, May 1978. But it would still be a cool idea for Python. Perhaps it's already there and I haven't noticed? Bill

On 10-03-02 13:35 , Bill Janssen wrote:
Were you thinking of something like http://www.arandonohue.com/hg/hgwebdir.cgi/units/file/bde33c01abd3/units/__i... ? Later, Blake.

On 2010-03-02 12:35 PM, Bill Janssen wrote:
Tons of implementations (in no particular order): http://pypi.python.org/pypi/quantities/ http://pypi.python.org/pypi/Unum/ http://pypi.python.org/pypi/magnitude/ http://pypi.python.org/pypi/units/ http://pypi.python.org/pypi/ScientificPython/ http://pypi.python.org/pypi/SciMath/ And quite a few more that are part of other packages or otherwise not on PyPI. It's ridiculously easy to write something that what people think are the common cases and so everyone does. It's a lot harder to write something that robustly handles what are actually common cases (absolute temperature scales, logarithmic scales, etc.). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Tue, Mar 2, 2010 at 8:17 PM, Robert Kern <robert.kern@gmail.com> wrote:
One more: http://pypi.python.org/pypi/piquant/ I can't comment on its robustness and performance but as far as readability goes, Unum seems the best of the bunch. George

On Tue, 2 Mar 2010 20:37:29 +0100 George Sakkis <george.sakkis@gmail.com> wrote:
Hmm. How about accessing the Frink (http://futureboy.homeip.net/frinkdocs/) types from Jython? <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

On 2010-03-02 18:17 PM, Mike Meyer wrote:
You might be able to use it to do the unit conversion calculations, but the Java interface to Frink does not expose any types following the Quantity pattern. It just provides a way to evaluate strings in the Frink interpreter: http://futureboy.homeip.net/frinkdocs/integrate/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Tue, Mar 2, 2010 at 2:37 PM, George Sakkis <george.sakkis@gmail.com> wrote:
I am the developer of the Quantities package. The tutorial at http://packages.python.org/quantities/user/tutorial.html recommends importing the units and constants into a namespace, but aside from that, the syntax seems very similar to Unum. However, quantities depends on numpy. Darren

On Tue, Mar 2, 2010 at 2:17 PM, Robert Kern <robert.kern@gmail.com> wrote:
I prefer to think of this as two separate issues. One issue is a Quantity pattern for dealing with values that have magnitude and dimensionality, and the other is coordinate systems (requiring a point of reference, like temperature scales). Darren

On 2010-03-02 20:14 , Darren Dale wrote:
Theoretically and implementation-wise, absolutely. However, users want to convert Fahrenheit to Celsius with the same tool they use to convert meters to feet. To them, it's the same problem. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On 10-03-02 13:35 , Bill Janssen wrote:
Were you thinking of something like http://www.arandonohue.com/hg/hgwebdir.cgi/units/file/bde33c01abd3/units/__i... ? Later, Blake.

On 2010-03-02 12:35 PM, Bill Janssen wrote:
Tons of implementations (in no particular order): http://pypi.python.org/pypi/quantities/ http://pypi.python.org/pypi/Unum/ http://pypi.python.org/pypi/magnitude/ http://pypi.python.org/pypi/units/ http://pypi.python.org/pypi/ScientificPython/ http://pypi.python.org/pypi/SciMath/ And quite a few more that are part of other packages or otherwise not on PyPI. It's ridiculously easy to write something that what people think are the common cases and so everyone does. It's a lot harder to write something that robustly handles what are actually common cases (absolute temperature scales, logarithmic scales, etc.). -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Tue, Mar 2, 2010 at 8:17 PM, Robert Kern <robert.kern@gmail.com> wrote:
One more: http://pypi.python.org/pypi/piquant/ I can't comment on its robustness and performance but as far as readability goes, Unum seems the best of the bunch. George

On Tue, 2 Mar 2010 20:37:29 +0100 George Sakkis <george.sakkis@gmail.com> wrote:
Hmm. How about accessing the Frink (http://futureboy.homeip.net/frinkdocs/) types from Jython? <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

On 2010-03-02 18:17 PM, Mike Meyer wrote:
You might be able to use it to do the unit conversion calculations, but the Java interface to Frink does not expose any types following the Quantity pattern. It just provides a way to evaluate strings in the Frink interpreter: http://futureboy.homeip.net/frinkdocs/integrate/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Tue, Mar 2, 2010 at 2:37 PM, George Sakkis <george.sakkis@gmail.com> wrote:
I am the developer of the Quantities package. The tutorial at http://packages.python.org/quantities/user/tutorial.html recommends importing the units and constants into a namespace, but aside from that, the syntax seems very similar to Unum. However, quantities depends on numpy. Darren

On Tue, Mar 2, 2010 at 2:17 PM, Robert Kern <robert.kern@gmail.com> wrote:
I prefer to think of this as two separate issues. One issue is a Quantity pattern for dealing with values that have magnitude and dimensionality, and the other is coordinate systems (requiring a point of reference, like temperature scales). Darren

On 2010-03-02 20:14 , Darren Dale wrote:
Theoretically and implementation-wise, absolutely. However, users want to convert Fahrenheit to Celsius with the same tool they use to convert meters to feet. To them, it's the same problem. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (6)
-
Bill Janssen
-
Blake Winton
-
Darren Dale
-
George Sakkis
-
Mike Meyer
-
Robert Kern