[yt-users] particle generator and update issues

Nathan Goldbaum nathan12343 at gmail.com
Tue Oct 14 10:12:23 PDT 2014


On Tuesday, October 14, 2014, Elizabeth Tasker <
tasker at astro1.sci.hokudai.ac.jp> wrote:

> Hi everyone,
>
> I've hit a couple of problems trying to generate a particle distribution.
> I'm following the code here:
>
> http://blog.yt-project.org/post/ParticleGenerator.html
>
> (at the moment exactly: http://pastebin.com/JFnWeXqM )
>
> The first issue was CICDeposit_3 doesn't seem to exist, but from the
> source code, it looks like it is now  CICSample_3 via "from
> yt.utilities.lib.CICDeposit import CICSample_3".
>
> I switched this but then hit a different error:
>
>
> In [1]: execfile("particle_generator.py")
> yt : [INFO     ] 2014-10-14 17:51:59,895 Parameters: current_time
>      = 0.0
> yt : [INFO     ] 2014-10-14 17:51:59,895 Parameters: domain_dimensions
>     = [128 128 128]
> yt : [INFO     ] 2014-10-14 17:51:59,895 Parameters: domain_left_edge
>      = [ 0.  0.  0.]
> yt : [INFO     ] 2014-10-14 17:51:59,896 Parameters: domain_right_edge
>     = [ 1.  1.  1.]
> yt : [INFO     ] 2014-10-14 17:51:59,897 Parameters:
> cosmological_simulation   = 0.0
> ---------------------------------------------------------------------------
> KeyError                                  Traceback (most recent call last)
> /home/tasker/yt-3/src/yt-hg/scripts/iyt in <module>()
> ----> 1 execfile("particle_generator.py")
>
> /home/tasker/yt-3/src/yt-hg/scripts/iyt in <module>()
>      39          'particle_position_y':y,
>      40          'particle_position_z':z}
> ---> 41 particles1 = FromListParticleGenerator(ug, num_particles1, pdata)
>      42 particles1.assign_indices()
>      43 particles1.apply_to_stream()
>
> /home/tasker/yt-3/src/yt-hg/yt/utilities/particle_generator.pyc in
> __init__(self, ds, num_particles, data)
>     227
>     228         field_list = data.keys()
> --> 229         x = data.pop(("io", "particle_position_x"))
>     230         y = data.pop(("io", "particle_position_y"))
>     231         z = data.pop(("io", "particle_position_z"))
>
> KeyError: ('io', 'particle_position_x')
>
>
> I tried updating the code, but 'yt update' then seemed to pull me back
> from yt-3.0 which I thought I was running (is branch 'yt' now yt-3?) to yt
> 2:
>
>
>
> tasker at schiehallion:~/yt-3/bin$ yt update
> yt : [INFO     ] 2014-10-14 17:48:23,618 Loading plugins from
> /home/tasker/.yt/my_plugins.py
>
> yt module located at:
>     /home/tasker/yt-new/src/yt-hg
>
> The current version and changeset for the code is:
>
> ---
> Version = 2.6.1
> Changeset = f7c69809dbd0 (stable)
> ---
>
> This installation CAN be automatically updated.
> Reading configuration from  /home/tasker/yt-new/src/yt-hg/.hg/hgrc
>
>
Not sure why it's not updating to the current tip of the stable branch.

You can always manually do this:

$ cd $YT_HG
$ hg pull https://bitbucket.org/yt_analysis/yt
$ hg update stable

Or, if you want the latest dev branch:

$ hg update yt

If you have changes in your local copy, you might need to use "hg update
-C", which clears local changes.  You can also use hg shelve if you want to
save local changes without making a commit.

Finally, in case any cython files have changed since you last updated, you
should do:

$ python setup.py develop

Nathan

(typed on a phone, apologies for any typos)


> Could someone give me a shove back onto the right track with those two
> issues?
>
> Thanks!
>
> Elizabeth
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20141014/062d37c0/attachment.html>


More information about the yt-users mailing list