8000 STY: Take into account reviewer's comments · r-devulap/numpy@493face · GitHub
[go: up one dir, main page]

Skip to content

Commit 493face

Browse files
STY: Take into account reviewer's comments
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
1 parent 5cc13b0 commit 493face

File tree

8 files changed

+38
-39
lines changed

8 files changed

+38
-39
lines changed

doc/source/f2py/code/setup_example.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
from numpy.distutils.core import Extension
22

3-
ext1 = Extension(name = 'scalar',
4-
sources = ['scalar.f'])
5-< 10000 /span>
ext2 = Extension(name = 'fib2',
6-
sources = ['fib2.pyf', 'fib1.f'])
3+
ext1 = Extension(name='scalar',
4+
sources=['scalar.f'])
5+
ext2 = Extension(name='fib2',
6+
sources=['fib2.pyf', 'fib1.f'])
77

88
if __name__ == "__main__":
99
from numpy.distutils.core import setup
10-
setup(name = 'f2py_example',
11-
description = "F2PY Users Guide examples",
12-
author = "Pearu Peterson",
13-
author_email = "pearu@cens.ioc.ee",
14-
ext_modules = [ext1, ext2]
10+
setup(name='f2py_example',
11+
description="F2PY Users Guide examples",
12+
author="Pearu Peterson",
13+
author_email="pearu@cens.ioc.ee",
14+
ext_modules=[ext1, ext2]
1515
)
1616
# End of setup_example.py

numpy/_core/tests/test_arrayprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def test_structure_format_float(self):
320320
assert_equal(np.array2string(array_scalar), "(1., 2.12345679, 3.)")
321321

322322
def test_unstructured_void_repr(self):
323-
a = np.array([27, 91, 50, 75, 7, 65, 10, 8,
323+
a = np.array([27, 91, 50, 75, 7, 65, 10, 8,
324324
27, 91, 51, 49, 109, 82, 101, 100], dtype='u1').view('V8')
325325
assert_equal(repr(a[0]),
326326
r"np.void(b'\x1B\x5B\x32\x4B\x07\x41\x0A\x08')")

numpy/_core/tests/test_cpu_features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def load_flags_auxv(self):
117117

118118
@pytest.mark.skipif(
119119
sys.platform == 'emscripten',
120-
reason= (
120< D7AE code class="diff-text syntax-highlighted-line addition">+
reason=(
121121
"The subprocess module is not available on WASM platforms and"
122122
" therefore this test class cannot be properly executed."
123123
),

numpy/_core/tests/test_datetime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,7 @@ def test_isfinite_isinf_isnan_units(self, unit, dstr):
24922492
'''check isfinite, isinf, isnan for all units of <M, >M, <m, >m dtypes
24932493
'''
24942494
arr_val = [123, -321, "NaT"]
2495-
arr = np.array(arr_val, dtype= dstr % unit)
2495+
arr = np.array(arr_val, dtype=(dstr % unit))
24962496
pos = np.array([True, True, False])
24972497
neg = np.array([False, False, True])
24982498
false = np.array([False, False, False])

numpy/_core/tests/test_einsum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ def __mul__(self, other):
764764
return 42
765765

766766
objMult = np.array([Mult()])
767-
objNULL = np.ndarray(buffer = b'\0' * np.intp(0).itemsize, shape=1, dtype=object)
767+
objNULL = np.ndarray(buffer=b'\0' * np.intp(0).itemsize, shape=1, dtype=object)
768768

769769
with pytest.raises(TypeError):
770770
np.einsum("i,j", [1], objNULL)

numpy/_core/tests/test_multiarray.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9427,8 +9427,7 @@ def _make_readonly(x):
94279427
np.array([1, 2, 3]),
94289428
np.array([['one', 'two'], ['three', 'four']]),
94299429
np.array((1, 2), dtype='i4,i4'),
9430-
np.zeros((2,), dtype=
9431-
np.dtype({
9430+
np.zeros((2,), dtype=np.dtype({
94329431
"formats": ['<i4', '<i4'],
94339432
"names": ['a', 'b'],
94349433
"offsets": [0, 2],

numpy/lib/tests/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def test_file_truncated(tmp_path):
463463
with open(path, 'rb') as f:
464464
with pytest.raises(
465465
ValueError,
466-
match = (
466+
match=(
467467
r"EOF: reading array header, "
468468
r"expected (\d+) bytes got (\d+)"
469469
) if arr.size == 0 else (

numpy/ma/tests/test_core.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -856,13 +856,13 @@ def test_fancy_printoptions(self):
856856
assert_equal(str(test), control)
857857

858858
# Test 0-d array with multi-dimensional dtype
859-
t_2d0 = masked_array(data = (0, [[0.0, 0.0, 0.0],
860-
[0.0, 0.0, 0.0]],
861-
0.0),
862-
mask = (False, [[True, False, True],
863-
[False, False, True]],
864-
False),
865-
dtype = "int, (2,3)float, float")
859+
t_2d0 = masked_array(data=(0, [[0.0, 0.0, 0.0],
860+
[0.0, 0.0, 0.0]],
861+
0.0),
862+
mask=(False, [[True, False, True],
863+
[False, False, True]],
864+
False),
865+
dtype="int, (2,3)float, float")
866866
control = "(0, [[--, 0.0, --], [0.0, 0.0, --]], 0.0)"
867867
assert_equal(str(t_2d0), control)
868868

@@ -970,36 +970,36 @@ def test_mvoid_print(self):
970970
def test_mvoid_multidim_print(self):
971971

972972
# regression test for gh-6019
973-
t_ma = masked_array(data = [([1, 2, 3],)],
974-
mask = [([False, True, False],)],
975-
fill_value = ([999999, 999999, 999999],),
976-
dtype = [('a', '<i4', (3,))])
973+
t_ma = masked_array(data=[([1, 2, 3],)],
974+
mask=[([False, True, False],)],
975+
fill_value=([999999, 999999, 999999],),
976+
dtype=[('a', '<i4', (3,))])
977977
assert_(str(t_ma[0]) == "([1, --, 3],)")
978978
assert_(repr(t_ma[0]) == "([1, --, 3],)")
979979

980980
# additional tests with structured arrays
981981

982-
t_2d = masked_array(data = [([[1, 2], [3, 4]],)],
983-
mask = [([[False, True], [True, False]],)],
984-
dtype = [('a', '<i4', (2, 2))])
982+
t_2d = masked_array(data=[([[1, 2], [3, 4]],)],
983+
mask=[([[False, True], [True, False]],)],
984+
dtype=[('a', '<i4', (2, 2))])
985985
assert_(str(t_2d[0]) == "([[1, --], [--, 4]],)")
986986
assert_(repr(t_2d[0]) == "([[1, --], [--, 4]],)")
987987

988-
t_0d = masked_array(data = [(1, 2)],
989-
mask = [(True, False)],
990-
dtype = [('a', '<i4'), ('b', '<i4')])
988+
t_0d = masked_array(data=[(1, 2)],
989+
mask=[(True, False)],
990+
dtype=[('a', '<i4'), ('b', '<i4')])
991991
assert_(str(t_0d[0]) == "(--, 2)")
992992
assert_(repr(t_0d[0]) == "(--, 2)")
993993

994-
t_2d = masked_array(data = [([[1, 2], [3, 4]], 1)],
995-
mask = [([[False, True], [True, False]], False)],
996-
dtype = [('a', '<i4', (2, 2)), ('b', float)])
994+
t_2d = masked_array(data=[([[1, 2], [3, 4]], 1)],
995+
mask=[([[False, True], [True, False]], False)],
996+
dtype=[('a', '<i4', (2, 2)), ('b', float)])
997997
assert_(str(t_2d[0]) == "([[1, --], [--, 4]], 1.0)")
998998
assert_(repr(t_2d[0]) == "([[1, --], [--, 4]], 1.0)")
999999

1000-
t_ne = masked_array(data = [(1, (1, 1))],
1001-
mask = [(True, (True, False))],
1002-
dtype = [('a', '<i4'), ('b', 'i4,i4')])
1000+
t_ne = masked_array(data=[(1, (1, 1))],
1001+
mask=[(True, (True, False))],
1002+
dtype=[('a', '<i4'), ('b', 'i4,i4')])
10031003
assert_(str(t_ne[0]) == "(--, (--, 1))")
10041004
assert_(repr(t_ne[0]) == "(--, (--, 1))")
10051005

0 commit comments

Comments
 (0)
0