[yt-dev] Issue #1330: save_as_dataset() function not work properly with cut_region() resutls (yt_analysis/yt)

Weiguang Cui issues-reply at bitbucket.org
Fri Mar 3 05:57:09 PST 2017


New issue 1330: save_as_dataset() function not work properly with cut_region() resutls
https://bitbucket.org/yt_analysis/yt/issues/1330/save_as_dataset-function-not-work-properly

Weiguang Cui:

The ds.sphere() function results can be wrote without a problem:
--------------------------------------------------------------------------------------
sp = ds.sphere("max", (0.5, 'Mpc'))
In [6]: sp.save_as_dataset(fields=["temperature"])
yt : [INFO     ] 2017-03-03 11:15:03,452 Saving field data to yt dataset: snap_127_sphere.h5.
-------------------------------------------------------------------------------------

But not the cut_region() function results.
--------------------------------------------------------------------------------------
kt = ds.cut_region(sp,['(obj["kT"] < 75) & (obj["kT"] > 2)'])
In [8]: fn = kt.save_as_dataset(fields=["density"])

/usr/local/lib/python2.7/dist-packages/h5py/_hl/attrs.pyc in create(self, name, data, shape, dtype)
   167             # Make HDF5 datatype and dataspace for the H5A calls
   168             if use_htype is None:
--> 169                 htype = h5t.py_create(original_dtype, logical=True)
   170                 htype2 = h5t.py_create(original_dtype)  # Must be bit-for-bit representation rather than logical
TypeError: Object dtype dtype('O') has no native HDF5 equivalent
--------------------------------------------------------------------------------------------------




More information about the yt-dev mailing list