> Hi all
>
> On Jun 12, 7:41 am, Robert Bradshaw <rober...@math.washington.edu>
> wrote:
>> No, but I believe there are several Python packages that do this that
>> you could install into Sage. (There was talk about adding this at one
>> point, what is needed is a good list of all the best open-source
>> packages out there and a discussion of which one to choose and why).
>>
>
> I want to mention that I started a discussion about this same topic a
> couple of months ago:
>
> http://groups.google.com/group/sage-devel/browse_frm/thread/
> ae18ce618abd66d2/649bd604d0fd20c9?hl=en%CA%89bd604d0fd20c9
>
> as you can see, I already tried to provide a list of all the best
> open-
> source packages out there, I also proposed a couple of
> modifications... I was actually quite interested in that stuff.
> Nonetheless, there was not enough interest in the community, maybe, so
> that discussion ended without any concrete effect.
It seemed there was a fair amount of interest, but it there wasn't a
obvious winning solution, and no one had enough incentive to advocate
and push through a full plan. (Usually this isn't an indication that
no one wants it, but that everyone is already busy trying to work on
stuff more relevant to their goals.)
> I am willing to give new life to this discussion :) I am wondering
> whether a brainstorming system (like the one adopted by Ubuntu -
> http://brainstorm.ubuntu.com/ ) could be useful to catch the
> community's needs :)
Yes, and thanks for the effort there. If I remember right, quantities
(?) looked pretty good, but it only can accept numpy scalars. It
would be good to summarize this discussion/the options on a wiki--
threads are good for a discussion but it becomes hard to get a big
picture once they get so big.
- Robert
Good luck!
Stan
--
________________________________________
Stan Schymanski
Scientist
Max Planck Institute for Biogeochemistry
Postfach 10 01 64
D-07701 Jena
Phone: +49.3641.576264
Fax: +49.3641.577274
WWW: http://www.bgc-jena.mpg.de/~sschym
Biospheric Theory and Modelling Group
http://www.bgc-jena.mpg.de/bgc-theory/
_________________________________________
>
> All the other people involved, and interested in a unit package,
> please show just to say "hi"
I'm still interested, but my time is even more limited than it was in
during the previous thread.
Jason
> Hi
>
>> I'm going to suggest that interested parties just write a new
>> package for Sage, after reviewing existing packages, instead
>> of trying to bolt one of the existing packages onto Sage.
>
> I have honestly taken this into account, but there are a couple of
> cons:
> - nobody is volunteering, so the amount of work-time seems very
> limited
> - I don't like to reinvent the wheel, that's why I like SAGE so much
> - I have very limited experience about Python programming (especially
> classes and stuff like that)
> - I would like to take advantage of others' experience about designing
> a package like that
>
>>
>> Unit conversion and dimensions analysis isn't very complicated,
>> so it's probably easier to just write it anew.
>> The existing packages have various features, so someone
>> can just pick and choose the features they want.
Yep, it's not very hard, but it's apparently not very important
either (relative to other stuff going on).
> By the way, do you think is it convenient to create a new wiki page
> about this topic to summarize all this stuff? I have two questions:
> first of all, I don't know how to do that, even if it seems pretty
> easy to modify an existing page. The second question is: on the wiki
> itself, the developers suggest to create a trac ticket with a wish
> list, instead of creating wiki pages. Nonetheless, there is that SEP
> (SAGE Enhancement Proposal) there, which seems a suitable place to
> write.
> Last doubt: is anybody going to read it? :)
A wiki page has a much more permanent and easy to read than an email
thread. A wishlist trac ticket is good for smaller, easily defined
chunks, but not for collaboratively deciding (and recording) what the
plan of attack is. It also makes it easier to pick up and see what
the current status of something is. This is more like a SEP (albeit a
small one) than a ticket.
- Robert
"as" is going to be a keyword in Python 2.6 so this will actually have
to be changed. It makes sense to do it before it's in Sage since it
will break code.
> Note that the license is GPLv2, not GPLv2+,
> http://home.scarlet.be/be052320/license.txt
> Maybe someone should contact the package author about that
> before a definite move is made?
All of the license statements on the source code itself are GPLv2+.
There are also a few changes that should to be done such as something like
try:
from sage.all import Integer
ONE = Integer(1)
except ImportError:
ONE = 1.0
so that it plays nicer with exact arithmetic.
--Mike
Well it can't hurt to write to him and ask what he thinks...
There is also the fact that Sage has rings, elements, parents, a
coercion model, etc. which might throw a monkey wrench into everything
(I don't know).
On Jun 15, 2009, at 3:27 AM, William Stein wrote:
> There is also the fact that Sage has rings, elements, parents, a
> coercion model, etc. which might throw a monkey wrench into everything
> (I don't know).
I'm hoping it's able to store the "numeric" part as a black box, and
just multiplies it by constants to convert. Of course, I'm not sure
if everything would quickly be reduced to 53-bit floating point
results precision...
sage: var('x,y')
(x, y)
sage: (x * unum.units.MILE) / (y * unum.units.S)
x/y [mile/s]
sage: (x+90) * unum.units.MIN + (x+pi) * unum.units.H
pi + 1.01666666666667*x + 1.50000000000000 [h]
sage: R.<t> = QQ[[]]
sage: foo = (1/(t+1)) * unum.units.KG; foo
1.0 - 1.0*t + 1.0*t^2 - 1.0*t^3 + 1.0*t^4 - 1.0*t^5 + 1.0*t^6 -
1.0*t^7 + 1.0*t^8 - 1.0*t^9 + 1.0*t^10 - 1.0*t^11 + 1.0*t^12 -
1.0*t^13 + 1.0*t^14 - 1.0*t^15 + 1.0*t^16 - 1.0*t^17 + 1.0*t^18 -
1.0*t^19 + O(t^20) [kg]
sage: getattr(foo, 'as')(unum.units.TON)
0.001 - 0.001*t + 0.001*t^2 - 0.001*t^3 + 0.001*t^4 - 0.001*t^5 +
0.001*t^6 - 0.001*t^7 + 0.001*t^8 - 0.001*t^9 + 0.001*t^10 -
0.001*t^11 + 0.001*t^12 - 0.001*t^13 + 0.001*t^14 - 0.001*t^15 +
0.001*t^16 - 0.001*t^17 + 0.001*t^18 - 0.001*t^19 + O(t^20) [t]
Not bad.
- Robert
> I totally agree, but unfortunately it seems there are not so many
> people involved in the development of SAGE, focused on these topics.
This was true of many things that are now in Sage when they started
out. Rather than existing Sage developers focusing on new topics,
usually what happens is people who are interested in these topics
gets involved with the development of Sage (and the community is very
helpful with this), though we do try to be helpful when we can.
You seem like just such a person. :)
- Robert
Also, David Ackerman, who is a University of Washington undergraduate,
is going to be doing a Sage development project in August (funded by
the National Science Foundation), and he told me that he's very
interested in doing his project on units.
William