On Wed, Aug 12, 2009 at 8:03 AM, M. Backens<m.back...@googlemail.com> wrote:
>
> I have in fact been working on a units package for Sage this summer,
> based on the DimPy package for Python and am now nearing the end of my
> project.
>
> I wasn't expecting to be putting things online for another week or
> two, but I've put some preliminary documentation and the current
> version of the source code at http://www.inference.phy.cam.ac.uk/dimpy/
>
> The package implements
>  - quantities (as numbers with dimensions attached, where dimensions
> are the SI units or self-defined non-physical units)
>  - many pre-defined units and some physical constants
>  - user can define new physical and non-physical units
>  - unit conversions (because of the way quantities are set up, units
> are purely a way of printing nicely)
>  - several different ways of choosing which unit to use (user-
> determined, via a look-up register or using a set of base units)
>  - vectors and matrices containing quantities with different units
>  - a parser that can handle arithmetic and unit conversions using the
> unit symbols (e.g. 'm'), full unit names ('meter') with SI prefixes
> ('cm', 'centimeter') and plurals ('meters')
>
> If I could help in any way, that would be great.

Your tutorial is here, which people reading this should look over:

http://www.inference.phy.cam.ac.uk/dimpy/tutorial.html

I don't like that in your package everything is converted to floating point:

sage: 1/2 * meter/second
0.5 m s^-1
sage: I * meter/second
1.00000000000000*I m s^-1

As a consequence this sort of thing doesn't work:

sage: from dimpy import *
sage: var('x')
x
sage: f = x^2 * meter
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/Users/wstein/.sage/temp/flat.local/24833/_Users_wstein__sage_init_sage_0.py
in <module>()

TypeError: unsupported operand type(s) for *:
'sage.symbolic.expression.Expression' and 'Quantity'

And if that worked, then I would like to be able to do

sage: f.<any symbolic method>

and that is basically impossible with your design.

Where does your design for your units package come from?  It's
dramatically different than what I outlined above.  It looks like it
is *extremely good* for certain applications in the physical sciences,
and could probably easily co-exist with the design I outlined (which
is really just a no-brainer clone of mathematica's simple design of
units).

 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to