it looks like a lot of that logic changed in the latest dev version of yt, but there is still an issue reading Nyx datasets without particles.  I'll issue a PR to fix this on the dev version in a few minutes.

On Mon, Apr 3, 2017 at 7:53 AM, Wolfram Schmidt <> wrote:

I encountered a problem when processing BoxLib (Nyx) data from pure hydro simulations without particles, using an Anaconda installation of yt.

After loading a dataset with yt.load(), I get the following error for ds.field_list:
KeyError                                  Traceback (most recent call last)
<ipython-input-5-5aaf470c0415> in <module>()
----> 1 ds.field_list

/sw/tools/anaconda3/4.1.1/generic/lib/python3.5/site-packages/yt/data_objects/ in field_list(self)
    459     @property
    460     def field_list(self):
--> 461         return self.index.field_list
    463     def create_field_info(self):

/sw/tools/anaconda3/4.1.1/generic/lib/python3.5/site-packages/yt/data_objects/ in index(self)
    417                 raise RuntimeError("You should not instantiate Dataset.")
    418             self._instantiated_index = self._index_class(
--> 419                 self, dataset_type=self.dataset_type)
    420             # Now we do things that we need an instantiated index for
    421             # ...first off, we create our field_info now.

/sw/tools/anaconda3/4.1.1/generic/lib/python3.5/site-packages/yt/frontends/boxlib/ in __init__(self, ds, dataset_type)
    906     def __init__(self, ds, dataset_type='nyx_native'):
    907         super(NyxHierarchy, self).__init__(ds, dataset_type)
--> 908         self._read_particle_header()
    910     def _read_particle_header(self):

/sw/tools/anaconda3/4.1.1/generic/lib/python3.5/site-packages/yt/frontends/boxlib/ in _read_particle_header(self)
    910     def _read_particle_header(self):
--> 911         if not self.ds.parameters["particles"]:
    912             self.pgrid_info = np.zeros((self.num_grids, 3), dtype='int64')
    913             return

KeyError: 'particles'
Same problem with slices. I am not sure what exactly causes the error here, but since I can load datasets from cosmological simulations with Nyx and process them without problems, I suppose the problem outlined above is somehow related to the missing particles.

How can this be fixed?


yt-users mailing list

Michael Zingale
Associate Professor

Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800
phone:  631-632-8225