Skip to content

Commit 000b28d

Browse files
authored
Merge pull request numpy#28775 from DimitriPapadopoulos/E
2 parents 4961a14 + c950df9 commit 000b28d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+277
-278
lines changed

benchmarks/benchmarks/bench_ufunc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def time_ufunc_small_array(self, ufuncname):
342342
self.f(self.array_5)
343343

344344
def time_ufunc_small_array_inplace(self, ufuncname):
345-
self.f(self.array_5, out = self.array_5)
345+
self.f(self.array_5, out=self.array_5)
346346

347347
def time_ufunc_small_int_array(self, ufuncname):
348348
self.f(self.array_int_3)
@@ -432,7 +432,7 @@ def time_divide_scalar2_inplace(self, dtype):
432432

433433

434434
class CustomComparison(Benchmark):
435-
params = (np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16,
435+
params = (np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16,
436436
np.uint32, np.uint64, np.float32, np.float64, np.bool)
437437
param_names = ['dtype']
438438

benchmarks/benchmarks/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
TYPES1 = [
2121
'int16', 'float16',
2222
'int32', 'float32',
23-
'int64', 'float64', 'complex64',
23+
'int64', 'float64', 'complex64',
2424
'complex128',
2525
]
2626

2727
DLPACK_TYPES = [
2828
'int16', 'float16',
2929
'int32', 'float32',
30-
'int64', 'float64', 'complex64',
30+
'int64', 'float64', 'complex64',
3131
'complex128', 'bool',
3232
]
3333

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-
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 = "[email protected]",
14-
ext_modules = [ext1, ext2]
10+
setup(name='f2py_example',
11+
description="F2PY Users Guide examples",
12+
author="Pearu Peterson",
13+
author_email="[email protected]",
14+
ext_modules=[ext1, ext2]
1515
)
1616
# End of setup_example.py

numpy/_core/code_generators/generate_umath.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,16 @@ def english_upper(s):
259259
return uppered
260260

261261

262-
#each entry in defdict is a Ufunc object.
262+
# each entry in defdict is a Ufunc object.
263263

264-
#name: [string of chars for which it is defined,
265-
# string of characters using func interface,
266-
# tuple of strings giving funcs for data,
267-
# (in, out), or (instr, outstr) giving the signature as character codes,
268-
# identity,
269-
# docstring,
270-
# output specification (optional)
271-
# ]
264+
# name: [string of chars for which it is defined,
265+
# string of characters using func interface,
266+
# tuple of strings giving funcs for data,
267+
# (in, out), or (instr, outstr) giving the signature as character codes,
268+
# identity,
269+
# docstring,
270+
# output specification (optional)
271+
# ]
272272

273273
chartoname = {
274274
'?': 'bool',
@@ -396,7 +396,7 @@ def english_upper(s):
396396
TD(O, f='PyNumber_Multiply'),
397397
indexed=intfltcmplx
398398
),
399-
#'true_divide' : aliased to divide in umathmodule.c:initumath
399+
# 'true_divide' : aliased to divide in umathmodule.c:initumath
400400
'floor_divide':
401401
Ufunc(2, 1, None, # One is only a unit to the right, not the left
402402
docstrings.get('numpy._core.umath.floor_divide'),
@@ -1382,7 +1382,7 @@ def indent(st, spaces):
13821382
}
13831383
}
13841384

1385-
#for each name
1385+
# for each name
13861386
# 1) create functions, data, and signature
13871387
# 2) fill in functions and data in InitOperators
13881388
# 3) add function.
@@ -1570,7 +1570,7 @@ def make_ufuncs(funcdict):
15701570
typenum=f"NPY_{english_upper(chartoname[c])}",
15711571
count=uf.nin + uf.nout,
15721572
name=name,
1573-
funcname = f"{english_upper(chartoname[c])}_{name}_indexed",
1573+
funcname=f"{english_upper(chartoname[c])}_{name}_indexed",
15741574
))
15751575

15761576
mlist.append(r"""PyDict_SetItemString(dictionary, "%s", f);""" % name)

numpy/_core/overrides.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .._utils import set_module
66
from .._utils._inspect import getargspec
77
from numpy._core._multiarray_umath import (
8-
add_docstring, _get_implementing_args, _ArrayFunctionDispatcher)
8+
add_docstring, _get_implementing_args, _ArrayFunctionDispatcher)
99

1010

1111
ARRAY_FUNCTIONS = set()

numpy/_core/records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def __getattribute__(self, attr):
228228
try:
229229
dt = obj.dtype
230230
except AttributeError:
231-
#happens if field is Object type
231+
# happens if field is Object type
232232
return obj
233233
if dt.names is not None:
234234
return obj.view((self.__class__, obj.dtype))

numpy/_core/tests/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def test_array_array():
8282
dtype=[('f0', int), ('f1', float), ('f2', str)])
8383
o = type("o", (object,),
8484
{"__array_struct__": a.__array_struct__})
85-
## wasn't what I expected... is np.array(o) supposed to equal a ?
86-
## instead we get a array([...], dtype=">V18")
85+
# wasn't what I expected... is np.array(o) supposed to equal a ?
86+
# instead we get a array([...], dtype=">V18")
8787
assert_equal(bytes(np.array(o).data), bytes(a.data))
8888

8989
# test array

numpy/_core/tests/test_arrayprint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ 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,
324-
27, 91, 51, 49, 109, 82, 101, 100], dtype='u1').view('V8')
323+
a = np.array([27, 91, 50, 75, 7, 65, 10, 8, 27, 91, 51, 49, 109, 82, 101, 100],
324+
dtype='u1').view('V8')
325325
assert_equal(repr(a[0]),
326326
r"np.void(b'\x1B\x5B\x32\x4B\x07\x41\x0A\x08')")
327327
assert_equal(str(a[0]), r"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+
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])

0 commit comments

Comments
 (0)