[yt-users] particle generator and update issues

John ZuHone jzuhone at gmail.com
Tue Oct 14 06:03:19 PDT 2014


Hi Elizabeth,

Sorry to hear you’re having trouble!

> 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 <http://blog.yt-project.org/post/ParticleGenerator.html>
> 
> (at the moment exactly: http://pastebin.com/JFnWeXqM <http://pastebin.com/JFnWeXqM> )

I’ve identified a few bugs here that I’m going to fix sometime in the next couple of days. 

> 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”. 

CICDeposit and CICSample are actually the opposite of each other—the first deposits particle quantities onto the mesh, the second interpolates mesh quantities onto the particles. I’m not sure why CICDeposit_3 wasn’t in your repo—I can import it over here. 

> 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’)

This is actually unrelated to the switch you made and is just a bug in ParticleGenerator that I’ll fix. 

> 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

On this, I’m not sure what is going on, except that I can verify that the ‘yt’ branch is now 3.0.

Best,

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20141014/483f92fe/attachment.html>


More information about the yt-users mailing list