Skip to content

fast putmask implementation does not work on big-endian systems (Trac #575) #1173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 3 comments

Comments

@numpy-gitbot
Copy link

Original ticket http://projects.scipy.org/numpy/ticket/575 on 2007-08-25 by @chanley, assigned to @stefanv.

The fast putmask implementation introduced in r3981 does not work on big-endian machines. The record array test added in r3982 confirms this fact.

======================================================================
FAIL: test_record_array (numpy.core.tests.test_multiarray.test_putmask)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/basil5/site-packages/lib/python/numpy/core/tests/test_multiarray.p
y", line 450, in test_record_array
    assert_array_equal(rec['x'],[10,5])
  File "/data/basil5/site-packages/lib/python/numpy/testing/utils.py", line 223,
 in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/data/basil5/site-packages/lib/python/numpy/testing/utils.py", line 215,
 in assert_array_compare
    assert cond, msg
AssertionError: 
Arrays are not equal

(mismatch 50.0%)
 x: array([  4.58492919e-320,   5.00000000e+000])
 y: array([10,  5])

----------------------------------------------------------------------
Ran 673 tests in 13.436s

FAILED (failures=1)
<unittest.TextTestRunner object at 0x565f70>
>>> numpy.__version__
'1.0.4.dev4011'
>>> 

This test does pass on our Redhat Enterprise systems which our little-endian.

@numpy-gitbot
Copy link
Author

@chanley wrote on 2007-08-25

There are also no problems on Intel based Mac OS X machines.

@numpy-gitbot
Copy link
Author

@stefanv wrote on 2007-08-25

This problem used to occur, we just didn't have a test to catch it. To reproduce on other machines:

In [21]:x = N.array([1,2], dtype=('>i4'))

In [22]:N.putmask(x, [True, False], 3)

In [23]:x
Out[23]:array([50331648,        2])

I'll remove the test for now, until I have time to fix this.

@numpy-gitbot
Copy link
Author

@stefanv wrote on 2007-08-26

Closed in r4013.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant