[yt-dev] Issue #1161: YTArray does not return scalar item in correct dtype (yt_analysis/yt)

Yi-Hao Chen issues-reply at bitbucket.org
Wed Jan 20 16:10:30 PST 2016


New issue 1161: YTArray does not return scalar item in correct dtype
https://bitbucket.org/yt_analysis/yt/issues/1161/ytarray-does-not-return-scalar-item-in

Yi-Hao Chen:

The default dtype for YTArray is float64. If a YTArray is in integer or other dtype, it will still return an item in float64 if the returned item is a scalar. This can be clearly demonstrated in the following example.
```
#!python
>>> import yt
>>> mark = yt.YTArray([1,3,0]).astype('int')
>>> mark
YTArray([1, 3, 0]) (dimensionless)
>>> mark.dtype
dtype('int64')
>>> mark[0]
1.0 dimensionless
>>> mark[0].dtype
dtype('float64')
```
This bug affects the function ```_find_field_values_at_points``` in ```GridIndex```.



_______________________________________________
yt-dev mailing list
yt-dev at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org



More information about the yt-dev mailing list