[yt-users] Deprecation Woes

Sam Skillman samskillman at gmail.com
Tue Oct 7 11:10:27 PDT 2014


Hi Munier,

I think this should work:
In [1]: pf.domain_width.in_cgs()
Out[1]: YTArray([  2.80516144e+26,   2.80516144e+26,   2.80516144e+26]) cm

If you want just the number for some reason, you can do
pf.domain_width.in_cgs().d:
In [2]: pf.domain_width.in_cgs().d
Out[2]: array([  2.80516144e+26,   2.80516144e+26,   2.80516144e+26])

I would suggest looking at the documentation on the new units system:
http://yt-project.org/doc/analyzing/units/index.html#units

Sorry to hear that the upgrade to 3.0 brought unexpected consequences. We
tried to be as clear as possible about what changed, but I understand it
can be difficult to follow everything. You might find this page useful
going forward:
http://yt-project.org/doc/yt3differences.html

Sam


On Tue, Oct 7, 2014 at 10:54 AM, Munier Azzam Salem <
msalem at astro.columbia.edu> wrote:

> Hey Guys,
>
>          A false sense of complacency / hubris led me to update my dev
> version of yt ... I thought "how much damage could this do?" ... well ...
> After updating 50 derived fields in my analysis scripts, I have learned a
> valuable life lesson. Well played yt. Well played. But I digress ...
>
>         One of the deprecated usages I couldn't figure out how to fix
> involves pulling units from a pf object. Specifically I'd like to do this:
>
>        pf.units['cm']
>
>        Alternatives I could live with: finding the length of a side of the
> simulation box in CGS, some way to convert between code and physical units,
> etc ...
>
>        I'm working with enzo, if that matters.
>
>           cheers,
>                 Munier
>
>
> --
> Munier A. Salem // 845.489.6450
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20141007/999589f5/attachment.htm>


More information about the yt-users mailing list