[yt-dev] Issue #811: Pressure alias for the FLASH frontend doesn't work (yt_analysis/yt)

John ZuHone issues-reply at bitbucket.org
Sun Mar 23 10:41:40 PDT 2014


New issue 811: Pressure alias for the FLASH frontend doesn't work
https://bitbucket.org/yt_analysis/yt/issue/811/pressure-alias-for-the-flash-frontend

John ZuHone:

Attempting to use the `"pressure"` alias for the FLASH `"pres"` field results in the following error, demonstrated by the following script:


```
#!python

from yt.mods import *
ds = load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100")
sp = ds.sphere("c", (100,"kpc"))
sp["pressure"]
```

```
#!python

ERROR: RuntimeError: Something has gone terribly wrong, _function is NullFunc [yt.fields.derived_field]
astropy: [ERROR    ] 2014-03-23 13:41:30,084 RuntimeError: Something has gone terribly wrong, _function is NullFunc
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-a43a895d2820> in <module>()
----> 1 sp["pressure"]

/Users/jzuhone/Source/yt-3.x/yt/data_objects/data_containers.pyc in __getitem__(self, key)
    210                 return self.field_data[f]
    211             else:
--> 212                 self.get_data(f)
    213         # fi.units is the unit expression string. We depend on the registry
    214         # hanging off the dataset to define this unit object.

/Users/jzuhone/Source/yt-3.x/yt/data_objects/data_containers.pyc in get_data(self, fields)
    619 
    620         fields_to_generate += gen_fluids + gen_particles
--> 621         self._generate_fields(fields_to_generate)
    622 
    623     def _generate_fields(self, fields_to_generate):

/Users/jzuhone/Source/yt-3.x/yt/data_objects/data_containers.pyc in _generate_fields(self, fields_to_generate)
    636                 fi = self.pf._get_field_info(*field)
    637                 try:
--> 638                     fd = self._generate_field(field)
    639                     if type(fd) == np.ndarray:
    640                         fd = self.pf.arr(fd, fi.units)

/Users/jzuhone/Source/yt-3.x/yt/data_objects/data_containers.pyc in _generate_field(self, field)
    247                 tr = self._generate_particle_field(field)
    248             else:
--> 249                 tr = self._generate_fluid_field(field)
    250             if tr is None:
    251                 raise YTCouldNotGenerateField(field, self.pf)

/Users/jzuhone/Source/yt-3.x/yt/data_objects/data_containers.pyc in _generate_fluid_field(self, field)
    267             rv = self._generate_spatial_fluid(field, ngt_exception.ghost_zones)
    268         else:
--> 269             rv = finfo(gen_obj)
    270         return rv
    271 

/Users/jzuhone/Source/yt-3.x/yt/fields/derived_field.pyc in __call__(self, data)
    177         if self._function is NullFunc:
    178             raise RuntimeError(
--> 179                 "Something has gone terribly wrong, _function is NullFunc")
    180         with self.unit_registry(data):
    181             dd = self._function(self, data)

RuntimeError: Something has gone terribly wrong, _function is NullFunc

```


Responsible: jzuhone



More information about the yt-dev mailing list