File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1352,6 +1352,8 @@ def opmethod(self, other):
1352
1352
if isinstance (other , LArray ):
1353
1353
#TODO: first test if it is not already broadcastable
1354
1354
other = other .broadcast_with (self )
1355
+ elif isinstance (other , np .ndarray ):
1356
+ pass
1355
1357
elif not np .isscalar (other ):
1356
1358
raise TypeError ("unsupported operand type(s) for %s: '%s' "
1357
1359
"and '%s'" % (opname , type (self ), type (other )))
Original file line number Diff line number Diff line change @@ -1262,6 +1262,14 @@ def test_binary_ops(self):
1262
1262
# test adding two larrays with different axes order
1263
1263
self ._assert_equal_raw (la + la .transpose (), raw * 2 )
1264
1264
1265
+ # mixed operations
1266
+ la_raw = la + raw
1267
+ self .assertEqual (la_raw .axes , la .axes )
1268
+ self ._assert_equal_raw (la_raw , raw + raw )
1269
+ raw_la = raw + la
1270
+ self ._assert_equal_raw (raw_la , raw + raw )
1271
+ self .assertEqual (raw_la .axes , la .axes )
1272
+
1265
1273
def test_unary_ops (self ):
1266
1274
raw = self .small_data
1267
1275
la = self .small
You can’t perform that action at this time.
0 commit comments