I am +1 for adding sympy. <br><br><div class="gmail_quote">On Tue, Oct 23, 2012 at 9:55 AM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
Sorry for letting this drop.<br>
<br>
My feeling is that we should definitely go with dimensionful (Casey's<br>
project), and add SymPy to the stack. It seems likely that the<br>
emerging SciPy stack will include SymPy as a component, and<br>
furthermore it's pure python, so it should not be terribly difficult<br>
to include in that respect.<br>
<br>
Having a coherent unit stack is crucial. Right now we have the<br>
really, really terrible (and I take full blame for this) overloading<br>
of parameter files like dictionaries. As an example, here's how Enzo<br>
would work:<br>
<br>
pf["time"]<br>
pf["InitialTime"]<br>
pf["kpc"]<br>
pf["HydroMethod"]<br>
pf["seconds"]<br>
pf["Density"]<br>
<br>
All of these do different things. And, on the backend, they query<br>
different dictionaries -- units, conversion_factors, and parameters.<br>
This is not okay! We have:<br>
<br>
pf.current_time<br>
<br>
but this is given in code units for some reason for most codes.<br>
<br>
I think we should move to a system where when querying, the person<br>
doing the querying needs to explicitly state what they want. And all<br>
the unit conversion stuff (time, length, fluid, etc) needs to be<br>
handled by a separate process -- and my preference would be that it<br>
would be handled by dimensionful. I think that can come in at a<br>
higher level than the conversion from on-disk to CGS, but it should<br>
come in somewhere.<br>
<br>
I would absolutely love to rip out all of the dictionary-access for<br>
parameters this instant -- moving to tuples of (value, unit) was the<br>
first step, to get away from value/pf[unit]. But we can't do this<br>
just yet, and it needs to happen at a 3.0 break.<br>
<br>
What does everyone think? Can we do a [+-][01] on SymPy +<br>
Dimensionful, or do we need more info?<br>
<br>
-Matt<br>
<div class="HOEnZb"><div class="h5"><br>
On Sat, Oct 6, 2012 at 12:59 AM, Anthony Scopatz <<a href="mailto:scopatz@gmail.com">scopatz@gmail.com</a>> wrote:<br>
> Hi Mike,<br>
><br>
> ipython-physics looks like a good, relatively simple solution. I would<br>
> assume that we would use this *instead* of sympy to prevent having to add<br>
> yet-another-dependency and end up packaging this right with yt. (ip-p seems<br>
> to be unlicensed yet 'placed in the public domain', which is weird since the<br>
> public domain is not a legal construct everywhere. We would need to ask<br>
> them about that before including in yt.)<br>
><br>
> That said, I think a sympy solution would end up being more powerful<br>
> ultimately. Additionally, ip-p definitely needs some clean up before<br>
> inclusion. At quick glance they seems to use camel case for some functions,<br>
> their main class NumberDict subclasses from dict (huge no-no,<br>
> collections.MutableMapping people!), all of the _addUnit() calls at the end<br>
> of the file should be hard coded into _unit_table (or a mapped call), they<br>
> seem to be definitely using eval() wrong by not having an empty globals dict<br>
> which captures builtins, and the unit comments never seem to be used (so why<br>
> have them?). And they have no tests!<br>
><br>
> So I would be in favor a rewrite of ip-p, but sympy would be better ;)<br>
><br>
> Be Well<br>
> Anthony<br>
><br>
> On Fri, Oct 5, 2012 at 7:24 PM, Michael Kuhlen <<a href="mailto:mqk@astro.berkeley.edu">mqk@astro.berkeley.edu</a>><br>
> wrote:<br>
>><br>
>> Hi yt gang<br>
>><br>
>> Just had a little chat with Matt, and he suggested I bring up<br>
>> ipython-physics for discussion. Sounds like unit handling is an issue that<br>
>> needs to be addressed in yt. I've found ipython-physics to be pretty neat<br>
>> and quite usable. Maybe this is something worth tying into yt? Matt also<br>
>> mentioned that Casey had written a sympy-based library for handling units;<br>
>> how does it compare to what ipython-physics does?<br>
>><br>
>> Mike<br>
>><br>
>> --<br>
>> *********************************************************************<br>
>> * *<br>
>> * Dr. Michael Kuhlen Theoretical Astrophysics Center *<br>
>> * email: <a href="mailto:mqk@astro.berkeley.edu">mqk@astro.berkeley.edu</a> UC Berkeley *<br>
>> * cell phone: <a href="tel:%28831%29%20588-1468" value="+18315881468">(831) 588-1468</a> B-116 Hearst Field Annex # 3411 *<br>
>> * skype username: mikekuhlen Berkeley, CA 94720 *<br>
>> * *<br>
>> *********************************************************************<br>
>><br>
>> _______________________________________________<br>
>> yt-dev mailing list<br>
>> <a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> yt-dev mailing list<br>
> <a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</div></div></blockquote></div><br>