[yt-dev] Issue #1092: Nyx and Castro particles are broken (yt_analysis/yt)

Andrew Myers issues-reply at bitbucket.org
Wed Oct 7 13:36:32 PDT 2015


New issue 1092: Nyx and Castro particles are broken
https://bitbucket.org/yt_analysis/yt/issues/1092/nyx-and-castro-particles-are-broken

Andrew Myers:

We used to support Nyx and Castro particles, but it was broken at some point:


```
#!python

import yt
ds = yt.load('nyx_small/nyx_small_00000/')
ad = ds.all_data()
ad['particle_position_x']

```

Traceback:


```
#!python

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-3933388c1ff5> in <module>()
      2 ds = yt.load('nyx_small/nyx_small_00000/')
      3 ad = ds.all_data()
----> 4 ad['particle_position_x']

/Users/atmyers/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in __getitem__(self, key)
    251                 return self.field_data[f]
    252             else:
--> 253                 self.get_data(f)
    254         # fi.units is the unit expression string. We depend on the registry
    255         # hanging off the dataset to define this unit object.

/Users/atmyers/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in get_data(self, fields)
    743 
    744         read_particles, gen_particles = self.index._read_particle_fields(
--> 745                                         particles, self, self._current_chunk)
    746         for f, v in read_particles.items():
    747             self.field_data[f] = self.ds.arr(v, input_units = finfos[f].units)

/Users/atmyers/yt-x86_64/src/yt-hg/yt/geometry/geometry_handler.pyc in _read_particle_fields(self, fields, dobj, chunk)
    232             self._chunk_io(dobj, cache = False),
    233             selector,
--> 234             fields_to_read)
    235         return fields_to_return, fields_to_generate
    236 

/Users/atmyers/yt-x86_64/src/yt-hg/yt/utilities/io_handler.pyc in _read_particle_selection(self, chunks, selector, fields)
    159         # Here, ptype_map means which particles contribute to a given type.
    160         # And ptf is the actual fields from disk to read.
--> 161         psize = self._count_particles_chunks(chunks, ptf, selector)
    162         # Now we allocate
    163         # ptf, remember, is our mapping of what we want to read

/Users/atmyers/yt-x86_64/src/yt-hg/yt/utilities/io_handler.pyc in _count_particles_chunks(self, chunks, ptf, selector)
    130     def _count_particles_chunks(self, chunks, ptf, selector):
    131         psize = defaultdict(lambda: 0) # COUNT PTYPES ON DISK
--> 132         for ptype, (x, y, z) in self._read_particle_coords(chunks, ptf):
    133             psize[ptype] += selector.count_points(x, y, z, 0.0)
    134         return dict(psize.items())

AttributeError: 'IOHandlerBoxlib' object has no attribute '_read_particle_coords'
```

Responsible: atmyers



More information about the yt-dev mailing list