Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BUG: Fix various Big-Endian test failures (ppc64)#10561

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
charris merged 1 commit intonumpy:maintenance/1.14.xfromcharris:backport-10433
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
BUG: Fix various Big-Endian test failures (ppc64)
  • Loading branch information
@ahaldane@charris
ahaldane authored andcharris committedFeb 9, 2018
commit1ff374274f0bd9309e4177dd321b40a1ba0dc4f9
11 changes: 6 additions & 5 deletionsnumpy/core/tests/test_arrayprint.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,7 @@ class sub(np.ndarray): pass
' [3, 4]])')

# two dimensional with flexible dtype
xstruct = np.ones((2,2), dtype=[('a', 'i4')]).view(sub)
xstruct = np.ones((2,2), dtype=[('a', '<i4')]).view(sub)
assert_equal(repr(xstruct),
"sub([[(1,), (1,)],\n"
" [(1,), (1,)]], dtype=[('a', '<i4')])"
Expand DownExpand Up@@ -362,13 +362,14 @@ def test_formatter_reset(self):

def test_0d_arrays(self):
unicode = type(u'')
assert_equal(unicode(np.array(u'café', np.unicode_)), u'café')

assert_equal(unicode(np.array(u'café', '<U4')), u'café')

if sys.version_info[0] >= 3:
assert_equal(repr(np.array('café',np.unicode_)),
assert_equal(repr(np.array('café','<U4')),
"array('café', dtype='<U4')")
else:
assert_equal(repr(np.array(u'café',np.unicode_)),
assert_equal(repr(np.array(u'café','<U4')),
"array(u'caf\\xe9', dtype='<U4')")
assert_equal(str(np.array('test', np.str_)), 'test')

Expand DownExpand Up@@ -477,7 +478,7 @@ def test_float_overflow_nowarn(self):
repr(np.array([1e4, 0.1], dtype='f2'))

def test_sign_spacing_structured(self):
a = np.ones(2, dtype='f,f')
a = np.ones(2, dtype='<f,<f')
assert_equal(repr(a),
"array([(1., 1.), (1., 1.)], dtype=[('f0', '<f4'), ('f1', '<f4')])")
assert_equal(repr(a[0]), "(1., 1.)")
Expand Down
2 changes: 1 addition & 1 deletionnumpy/core/tests/test_dtype.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,7 @@ def test_dtype(self):
assert_(dt.byteorder != dt2.byteorder, "bogus test")
assert_dtype_equal(dt, dt2)
else:
self.assertTrue(dt.byteorder != dt3.byteorder, "bogus test")
assert_(dt.byteorder != dt3.byteorder, "bogus test")
assert_dtype_equal(dt, dt3)

def test_equivalent_dtype_hashing(self):
Expand Down
3 changes: 1 addition & 2 deletionsnumpy/core/tests/test_records.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,8 +124,7 @@ def test_recarray_repr(self):
assert_(repr(a).find('dtype=int32') != -1)

def test_0d_recarray_repr(self):
# testing infered integer types is unpleasant due to sizeof(int) varying
arr_0d = np.rec.array((np.int32(1), 2.0, np.datetime64('2003')))
arr_0d = np.rec.array((1, 2.0, '2003'), dtype='<i4,<f8,<M8[Y]')
assert_equal(repr(arr_0d), textwrap.dedent("""\
rec.array((1, 2., '2003'),
dtype=[('f0', '<i4'), ('f1', '<f8'), ('f2', '<M8[Y]')])"""))
Expand Down
2 changes: 2 additions & 0 deletionsnumpy/core/tests/test_scalarmath.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,7 @@
import warnings
import itertools
import operator
import platform

import numpy as np
from numpy.testing import (
Expand DownExpand Up@@ -420,6 +421,7 @@ def test_int_from_infinite_longdouble___int__(self):
assert_raises(OverflowError, x.__int__)
assert_equal(len(sup.log), 1)

@dec.knownfailureif(platform.machine().startswith("ppc64"))
@dec.skipif(np.finfo(np.double) == np.finfo(np.longdouble))
def test_int_from_huge_longdouble(self):
# Produce a longdouble that would overflow a double,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp