Skip to content

Commit

Permalink
Merge pull request #19648 from charris/backport-19612
Browse files Browse the repository at this point in the history
TST: Bump the python 3.10 test version from beta4 to rc1
  • Loading branch information
charris committed Aug 11, 2021
2 parents 1b9480d + 9c3ea35 commit 2ad60b5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10.0-beta.3]
python-version: [3.8, 3.9, 3.10.0-rc.1]
steps:
- uses: actions/checkout@v2
with:
Expand Down
40 changes: 27 additions & 13 deletions numpy/core/tests/test_umath_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,18 @@ def test_scalar(self):
x = np.array([1, 1j, 2, 2.5+.37j, np.inf, np.nan])
y = np.array([1, 1j, -0.5+1.5j, -0.5+1.5j, 2, 3])
lx = list(range(len(x)))
# Compute the values for complex type in python
p_r = [complex(x[i]) ** complex(y[i]) for i in lx]
# Substitute a result allowed by C99 standard
p_r[4] = complex(np.inf, np.nan)
# Do the same with numpy complex scalars

# Hardcode the expected `builtins.complex` values,
# as complex exponentiation is broken as of bpo-44698
p_r = [
1+0j,
0.20787957635076193+0j,
0.35812203996480685+0.6097119028618724j,
0.12659112128185032+0.48847676699581527j,
complex(np.inf, np.nan),
complex(np.nan, np.nan),
]

n_r = [x[i] ** y[i] for i in lx]
for i in lx:
assert_almost_equal(n_r[i], p_r[i], err_msg='Loop %d\n' % i)
Expand All @@ -385,11 +392,18 @@ def test_array(self):
x = np.array([1, 1j, 2, 2.5+.37j, np.inf, np.nan])
y = np.array([1, 1j, -0.5+1.5j, -0.5+1.5j, 2, 3])
lx = list(range(len(x)))
# Compute the values for complex type in python
p_r = [complex(x[i]) ** complex(y[i]) for i in lx]
# Substitute a result allowed by C99 standard
p_r[4] = complex(np.inf, np.nan)
# Do the same with numpy arrays

# Hardcode the expected `builtins.complex` values,
# as complex exponentiation is broken as of bpo-44698
p_r = [
1+0j,
0.20787957635076193+0j,
0.35812203996480685+0.6097119028618724j,
0.12659112128185032+0.48847676699581527j,
complex(np.inf, np.nan),
complex(np.nan, np.nan),
]

n_r = x ** y
for i in lx:
assert_almost_equal(n_r[i], p_r[i], err_msg='Loop %d\n' % i)
Expand Down Expand Up @@ -583,7 +597,7 @@ class TestComplexAbsoluteMixedDTypes:
@pytest.mark.parametrize("stride", [-4,-3,-2,-1,1,2,3,4])
@pytest.mark.parametrize("astype", [np.complex64, np.complex128])
@pytest.mark.parametrize("func", ['abs', 'square', 'conjugate'])

def test_array(self, stride, astype, func):
dtype = [('template_id', '<i8'), ('bank_chisq','<f4'),
('bank_chisq_dof','<i8'), ('chisq', '<f4'), ('chisq_dof','<i8'),
Expand All @@ -602,9 +616,9 @@ def test_array(self, stride, astype, func):
myfunc = getattr(np, func)
a = vec['mycomplex']
g = myfunc(a[::stride])

b = vec['mycomplex'].copy()
h = myfunc(b[::stride])

assert_array_max_ulp(h.real, g.real, 1)
assert_array_max_ulp(h.imag, g.imag, 1)
6 changes: 5 additions & 1 deletion numpy/lib/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@


@pytest.mark.skipif(sys.flags.optimize == 2, reason="Python running -OO")
@pytest.mark.skipif(
sys.version_info == (3, 10, 0, "candidate", 1),
reason="Broken as of bpo-44524",
)
def test_lookfor():
out = StringIO()
utils.lookfor('eigenvalue', module='numpy', output=out,
Expand Down Expand Up @@ -160,7 +164,7 @@ class NoPublicMethods:
class WithPublicMethods:
def first_method():
pass

def _has_method_heading(cls):
out = StringIO()
utils.info(cls, output=out)
Expand Down

0 comments on commit 2ad60b5

Please sign in to comment.