SciTools / biggus

:no_entry: [DEPRECATED] Virtual large arrays and lazy evaluation.
http://biggus.readthedocs.io/
GNU Lesser General Public License v3.0
54 stars 27 forks source link

Tests fail on 32-bit #115

Closed QuLogic closed 9 years ago

QuLogic commented 9 years ago

See this example build:

======================================================================
FAIL: test_dtype_default_integer (biggus.tests.unit.test_ConstantArray.Test___init__)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/biggus-0.8.0/biggus/tests/unit/test_ConstantArray.py", line 75, in test_dtype_default_integer
    self.assertEqual(array.dtype, np.dtype('i8'))
AssertionError: dtype('int32') != dtype('int64')
----------------------------------------------------------------------

though I don't seem to see anything that might have changed here.

pelson commented 9 years ago

@QuLogic - this looks like the test is fragile to the arch. I suspect the problem is that numpy's int is arch dependent, and at no point are we being specific (https://github.com/SciTools/biggus/blob/master/biggus/tests/unit/test_ConstantArray.py#L74).

QuLogic commented 9 years ago

The odd thing is that I don't remember the problem occurring when building 0.6.0, but now when I try it, it also fails. I guess I'm just mis-remembering.

QuLogic commented 9 years ago

Looks like you're correct:

int_ Default integer type (same as C long; normally either int64 or int32)

QuLogic commented 9 years ago

I fixed this test by changing the aforementioned line to this:

-        self.assertEqual(array.dtype, np.dtype('i8'))
+        self.assertEqual(array.dtype, np.dtype(np.int_))
pelson commented 9 years ago

@QuLogic - would you mind submitting a PR?

QuLogic commented 9 years ago

Done.

pelson commented 9 years ago

Thanks @QuLogic!