Issue #874: YTArray multiplication is not associative with respect to code units (yt_analysis/yt)

New issue 874: YTArray multiplication is not associative with respect to code units https://bitbucket.org/yt_analysis/yt/issue/874/ytarray-multiplication-is-not...
John ZuHone:
Test case, on a FLASH dataset:
``` #!python
a = yt.YTArray([1,2,3], "cm") b = ds.arr([1,2,3], "code_length")
a*b
YTArray([ 1., 4., 9.]) cm*code_length
b*a
YTArray([ 1., 4., 9.]) cm*code_length
(b*a).in_units("code_length**2")
YTArray([ 1., 4., 9.]) code_length**2
(a*b).in_units("code_length**2")
UnitParseError: Could not find unit symbol 'code_length' in the provided symbols. ```
Presumably this is because the final ``YTArray`` takes the unit registry from the first of the two in the binary operation. This is a simple and irrelevant example, but it illustrates the problem. Not sure how important this is.
Responsible: ngoldbaum
participants (1)
-
John ZuHone