Issue #874: YTArray multiplication is not associative with respect to code units (yt_analysis/yt)
1 Aug
2014
1 Aug
'14
5:15 a.m.
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
3554
Age (days ago)
3554
Last active (days ago)
0 comments
1 participants
participants (1)
-
John ZuHone