[yt-dev] Issue #1220: sz_kinetic field fails on FLASH datasets for certain axes (yt_analysis/yt)
John ZuHone
issues-reply at bitbucket.org
Tue May 17 14:39:46 PDT 2016
New issue 1220: sz_kinetic field fails on FLASH datasets for certain axes
https://bitbucket.org/yt_analysis/yt/issues/1220/sz_kinetic-field-fails-on-flash-datasets
John ZuHone:
The following simple script fails mysteriously when projecting `"sz_kinetic"` along either the y or z-axis, but not the x-axis:
```python
import yt
ds = yt.load("GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100")
prj = ds.proj("sz_kinetic", 2)
```
```pycon
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-3-fec24ac2f48f> in <module>()
----> 1 prj = ds.proj("sz_kinetic", 2)
/Users/jzuhone/Source/yt/yt/data_objects/construction_data_containers.py in __init__(self, field, axis, weight_field, center, ds, data_source, style, method, field_parameters, max_level)
260
261 if not self.deserialize(field):
--> 262 self.get_data(field)
263 self.serialize()
264
/Users/jzuhone/Source/yt/yt/data_objects/construction_data_containers.py in get_data(self, fields)
334 self._initialize_projected_units(fields, chunk)
335 _units_initialized = True
--> 336 self._handle_chunk(chunk, fields, tree)
337 # Note that this will briefly double RAM usage
338 if self.method == "mip":
/Users/jzuhone/miniconda3/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
75 value = type()
76 try:
---> 77 self.gen.throw(type, value, traceback)
78 raise RuntimeError("generator didn't stop after throw()")
79 except StopIteration as exc:
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _field_parameter_state(self, field_parameters)
953 new_field_parameters.update(old_field_parameters)
954 self.field_parameters = new_field_parameters
--> 955 yield
956 self.field_parameters = old_field_parameters
957
/Users/jzuhone/Source/yt/yt/data_objects/construction_data_containers.py in get_data(self, fields)
334 self._initialize_projected_units(fields, chunk)
335 _units_initialized = True
--> 336 self._handle_chunk(chunk, fields, tree)
337 # Note that this will briefly double RAM usage
338 if self.method == "mip":
/Users/jzuhone/Source/yt/yt/data_objects/construction_data_containers.py in _handle_chunk(self, chunk, fields, tree)
434 v = np.empty((chunk.ires.size, len(fields)), dtype="float64")
435 for i, field in enumerate(fields):
--> 436 d = chunk[field] * dl
437 v[:,i] = d
438 if self.weight_field is not None:
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in __getitem__(self, key)
268 return self.field_data[f]
269 else:
--> 270 self.get_data(f)
271 # fi.units is the unit expression string. We depend on the registry
272 # hanging off the dataset to define this unit object.
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in get_data(self, fields)
1182
1183 fields_to_generate += gen_fluids + gen_particles
-> 1184 self._generate_fields(fields_to_generate)
1185 for field in list(self.field_data.keys()):
1186 if field not in ofields:
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _generate_fields(self, fields_to_generate)
1240 for f in gip.fields:
1241 if f not in fields_to_generate:
-> 1242 fields_to_generate.append(f)
1243
1244 @contextmanager
/Users/jzuhone/miniconda3/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
75 value = type()
76 try:
---> 77 self.gen.throw(type, value, traceback)
78 raise RuntimeError("generator didn't stop after throw()")
79 except StopIteration as exc:
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _field_lock(self)
1245 def _field_lock(self):
1246 self._locked = True
-> 1247 yield
1248 self._locked = False
1249
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _generate_fields(self, fields_to_generate)
1202 fi = self.ds._get_field_info(*field)
1203 try:
-> 1204 fd = self._generate_field(field)
1205 if fd is None:
1206 raise RuntimeError
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _generate_field(self, field)
308 if tr is None:
309 raise YTCouldNotGenerateField(field, self.ds)
--> 310 return tr
311
312 def _generate_fluid_field(self, field):
/Users/jzuhone/miniconda3/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
75 value = type()
76 try:
---> 77 self.gen.throw(type, value, traceback)
78 raise RuntimeError("generator didn't stop after throw()")
79 except StopIteration as exc:
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _field_type_state(self, ftype, finfo, obj)
965 else:
966 obj._current_fluid_type = ftype
--> 967 yield
968 obj._current_particle_type = old_particle_type
969 obj._current_fluid_type = old_fluid_type
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _generate_field(self, field)
305 tr = self._generate_particle_field(field)
306 else:
--> 307 tr = self._generate_fluid_field(field)
308 if tr is None:
309 raise YTCouldNotGenerateField(field, self.ds)
/Users/jzuhone/Source/yt/yt/data_objects/data_containers.py in _generate_fluid_field(self, field)
325 rv = self._generate_spatial_fluid(field, ngt_exception.ghost_zones)
326 else:
--> 327 rv = finfo(gen_obj)
328 return rv
329
/Users/jzuhone/Source/yt/yt/fields/derived_field.py in __call__(self, data)
193 raise RuntimeError(
194 "Something has gone terribly wrong, _function is NullFunc " +
--> 195 "for %s" % (self.name,))
196 with self.unit_registry(data):
197 dd = self._function(self, data)
RuntimeError: Something has gone terribly wrong, _function is NullFunc for ('flash', 'velz')
```
Responsible: jzuhone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20160517/f56225c5/attachment.htm>
More information about the yt-dev
mailing list