Skip to content
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

FAIL: test_datetime_as_string (test_datetime.TestDateTime) on OpenBSD/macppc and numpy 1.9.0rc1 #5027

Closed
didickman opened this issue Sep 2, 2014 · 4 comments · Fixed by #5212

Comments

@didickman
Copy link

There are a few regress test failures on OpenBSD/macppc. I suspect if the simplified code below is fixed the rest will be fixed too.

Python 2.7.8 (default, Sep  1 2014, 13:25:08)
[GCC 4.2.1 20070719 ] on openbsd5
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> date = '1959-10-13'
>>> np.datetime64(date, 'Y')
numpy.datetime64('0000')

Full regress test details below.

======================================================================
FAIL: test_datetime_array_str (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/core/tests/test_datetime.py", line 521, in test_datetime_array_str
    assert_equal(str(a), "['2011-03-16' '1920-01-01' '2013-05-19']")
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 334, in assert_equal
    raise AssertionError(msg)
AssertionError:
Items are not equal:
 ACTUAL: "['0000-03-16' '0000-01-01' '0000-05-19']"
 DESIRED: "['2011-03-16' '1920-01-01' '2013-05-19']"

======================================================================
FAIL: test_datetime_as_string (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/core/tests/test_datetime.py", line 1231, in test_datetime_as_string
    '1959')
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 334, in assert_equal
    raise AssertionError(msg)
AssertionError:
Items are not equal:
 ACTUAL: '0000'
 DESIRED: '1959'

======================================================================
FAIL: test_datetime_scalar_construction (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/core/tests/test_datetime.py", line 126, in test_datetime_scalar_construction
    assert_equal(str(np.datetime64('2011-02')), '2011-02')
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 334, in assert_equal
    raise AssertionError(msg)
AssertionError:
Items are not equal:
 ACTUAL: '0000-02'
 DESIRED: '2011-02'

======================================================================
FAIL: test_datetime_string_conversion (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/core/tests/test_datetime.py", line 501, in test_datetime_string_conversion
    assert_equal(str_a, dt_a.astype('S0'))
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 275, in assert_equal
    return assert_array_equal(actual, desired, err_msg, verbose)
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 739, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 665, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

(mismatch 100.0%)
 x: array(['2011-03-16', '1920-01-01', '2013-05-19'],
      dtype='|S10')
 y: array(['0000-03-16', '0000-01-01', '0000-05-19'],
      dtype='|S28')

======================================================================
FAIL: test_datetime_y2038 (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/core/tests/test_datetime.py", line 1762, in test_datetime_y2038
    assert_equal(str(a)[:-5], '2038-01-20T13:21:14')
  File "/usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 334, in assert_equal
    raise AssertionError(msg)
AssertionError:
Items are not equal:
 ACTUAL: '35792640-01-20T13:21:14'
 DESIRED: '2038-01-20T13:21:14'

----------------------------------------------------------------------
Ran 5527 tests in 160.824s

FAILED (KNOWNFAIL=7, SKIP=21, failures=5)
Running unit tests for numpy
NumPy version 1.9.0rc1
NumPy is installed in /usr/ports/pobj/py-numpy-1.9.0rc1/fake-macppc/usr/local/lib/python2.7/site-packages/numpy
Python version 2.7.8 (default, Sep  1 2014, 13:25:08) [GCC 4.2.1 20070719 ]
nose version 1.3.4
@charris
Copy link
Member

charris commented Sep 2, 2014

Hmm. What compiler? This looks like a endian or precision problem. Is the OS 32 bits?

@didickman
Copy link
Author

Yes, OpenBSD/macppc is 32-bits. gcc is version 4.2.1:

$  gcc --version
gcc (GCC) 4.2.1 20070719
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@charris
Copy link
Member

charris commented Sep 2, 2014

Is it a G5? Little endian? I'm suspecting a format code...

@didickman
Copy link
Author

It is a G4 and I believe big endian. From the dmesg:

mainbus0 at root: model PowerMac10,2
cpu0 at mainbus0: 7447A (Revision 0x105): 1499 MHz: 512KB L2 cache

charris added a commit to charris/numpy that referenced this issue Oct 21, 2014
The previous default was 'L', which seems gcc specific, whereas
'll' is the now recognized standard and is also accepted by gcc.

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

Successfully merging a pull request may close this issue.

2 participants