[yt-dev] Issue #1012: FixedResolutionBuffer with non-unit aspect ratios fails (yt_analysis/yt)

Anonymous issues-reply at bitbucket.org
Mon Apr 20 11:14:35 PDT 2015


New issue 1012: FixedResolutionBuffer with non-unit aspect ratios fails
https://bitbucket.org/yt_analysis/yt/issue/1012/fixedresolutionbuffer-with-non-unit-aspect

Anonymous:

Attempting to use to_frb with more than one dimension fails.  Failures seem to be related to yt trying to parse iterable arguments as numbers with units.
```
#!python
>>>  proj = ds.proj("density","z")
>>>  Delta = (0.1,'code_length')
>>>  dx = (1./512,'code_length')
>>> frb=proj.to_frb(Delta,dx)
works great!
>>> frb=proj.to_frb( [Delta, Delta],[dx,dx])
raceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tmp.py", line 22, in <module>
    frb=proj.to_frb( [Delta, Delta],[dx,dx])
  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py", line 909, in to_frb
    width = self.ds.quan(w, input_units = u)
  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py", line 1153, in __new__
    raise RuntimeError("YTQuantity values must be numeric")
RuntimeError: YTQuantity values must be numeric


Also I tried using a ds.arr:
>>> Delta = ds.arr([0.1,0.1],'code_length')
>>> dx = ds.arr([1./512, 1./512], 'code_length')
>>> frb=proj.to_frb( Delta, dx)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tmp.py", line 26, in <module>
    frb=proj.to_frb( Delta, dx)
  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py", line 909, in to_frb
    width = self.ds.quan(w, input_units = u)
  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py", line 1155, in __new__
    dtype=dtype)
  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py", line 308, in __new__
    input_array.units = Unit(input_units, registry=registry)
  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/unit_object.py", line 169, in __new__
    % (unit_expr, type(unit_expr)))
yt.units.unit_object.UnitParseError: Unit representation must be a string or sympy Expr. 0.1 code_length has type <class 'yt.units.yt_array.YTQuantity'>.

```


_______________________________________________
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