Skip to content

Commit 31ef426

Browse files
authored
Merge pull request #3076 from IntelPython/master
Sync dev-milestone with master
2 parents 5a5ae78 + bfa29d3 commit 31ef426

36 files changed

Lines changed: 770 additions & 220 deletions
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# array API tests to be skipped
22

3-
# data-apis/array-api-tests/issues/456
4-
array_api_tests/test_dlpack.py::test_dunder_dlpack
5-
63
# data-apis/array-api/issues/1006
74
array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +infinity and isfinite(imag(x_i)) and imag(x_i) > 0) -> 1 + 0j]

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ This release is compatible with NumPy 2.5.
4747
* Linked the `dpnp_backend_c` library against only the MKL SYCL domains it uses (`BLAS`, `RNG`, `VM`) [#3012](https://github.com/IntelPython/dpnp/pull/3012)
4848
* `dpnp` uses pybind11 3.1.0 [#3015](https://github.com/IntelPython/dpnp/pull/3015)
4949
* Reworked the ASV benchmarks and added end-to-end workload benchmarks derived from dpBench [#2996](https://github.com/IntelPython/dpnp/pull/2996)
50+
* Reduced allocations in `dpnp.linalg.norm` by reusing the reduction result as the `sqrt` output buffer in the 2-norm and Frobenius-norm branches [#3062](https://github.com/IntelPython/dpnp/pull/3062)
51+
* Avoided a copy of `dpnp.einsum` result into C-order by building the product in the requested layout directly [#3069](https://github.com/IntelPython/dpnp/pull/3069)
5052

5153
### Deprecated
5254

@@ -95,6 +97,9 @@ This release is compatible with NumPy 2.5.
9597
* Fixed `dpnp.insert` silently ignoring out-of-bounds negative indices in a multi-element `obj`, so a mix of in-bounds and out-of-bounds indices now consistently raises `IndexError` [#3041](https://github.com/IntelPython/dpnp/pull/3041)
9698
* Fixed a per-call `sycl::queue` leak in `usm_ndarray::get_queue()`/`get_device()` [#3042](https://github.com/IntelPython/dpnp/pull/3042)
9799
* Fixed `dpnp.linspace` returning `nan` for equal infinite endpoints [#3043](https://github.com/IntelPython/dpnp/pull/3043)
100+
* Fixed `dpnp.cumsum`, `dpnp.cumprod`, and their `nan`/`cumulative_*` variants (including `dpnp.tensor.cumulative_sum`/`cumulative_prod`) silently returning incorrect results when accumulating along an axis of an array with more than one row [#3063](https://github.com/IntelPython/dpnp/pull/3063)
101+
* Fixed `dpnp.einsum` returning a result whose memory layout differs from NumPy for the default `order="K"`, and ignoring `out` and `order` for a contraction over a size-0 dimension [#3058](https://github.com/IntelPython/dpnp/pull/3058)
102+
* Fixed operations on a boolean array whose bytes are not `0x00`/`0x01` [#3055](https://github.com/IntelPython/dpnp/pull/3055)
98103

99104
### Security
100105

‎doc/comparison_generator.py‎

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ def import_mod(mod, cls):
3838
obj = importlib.import_module(mod)
3939
if cls:
4040
obj = getattr(obj, cls)
41-
return obj, ":meth:`{}.{}.{{}}`".format(mod, cls)
41+
return obj, f":meth:`{mod}.{cls}.{{}}`"
4242
else:
4343
# ufunc is not a function
44-
return obj, ":obj:`{}.{{}}`".format(mod)
44+
return obj, f":obj:`{mod}.{{}}`"
4545

4646

4747
def generate_totals(base_mod, ref_mods, base_type, ref_types, cls):
4848
all_types = [base_type] + ref_types
49-
header = ", ".join("**{} Total**".format(t) for t in all_types)
50-
header = " {}".format(header)
49+
header = ", ".join(f"**{t} Total**" for t in all_types)
50+
header = f" {header}"
5151

5252
totals = calc_totals(base_mod, ref_mods, cls)
5353

5454
cells = ", ".join(str(t) for t in totals)
55-
total = " {}".format(cells)
55+
total = f" {cells}"
5656

5757
return [header, total]
5858

@@ -79,14 +79,12 @@ def generate_comparison_rst(base_mod, ref_mods, base_type, ref_types, cls):
7979
ref_cells.append(ref_cell)
8080

8181
cells = ", ".join([base_cell] + ref_cells)
82-
line = " {}".format(cells)
82+
line = f" {cells}"
8383
rows.append(line)
8484

8585
totals = generate_totals(base_mod, ref_mods, base_type, ref_types, cls)
8686

87-
return (
88-
[".. csv-table::", " :header: {}".format(header), ""] + rows + totals
89-
)
87+
return [".. csv-table::", f" :header: {header}", ""] + rows + totals
9088

9189

9290
def section(header, base_mod, ref_mods, base_type, ref_types, cls=None):
@@ -111,15 +109,15 @@ def generate_totals_numbers(header, base_mod, ref_mods, cls=None):
111109
totals = [header] + calc_totals(base_mod, ref_mods, cls)
112110

113111
cells = ", ".join(str(t) for t in totals)
114-
total = " {}".format(cells)
112+
total = f" {cells}"
115113

116114
return total, counter_funcs
117115

118116

119117
def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
120118
all_types = ["Name"] + [base_type] + ref_types
121-
header = ", ".join("**{}**".format(t) for t in all_types)
122-
header = " {}".format(header)
119+
header = ", ".join(f"**{t}**" for t in all_types)
120+
header = f" {header}"
123121

124122
rows = []
125123
counters_funcs = []
@@ -131,7 +129,7 @@ def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
131129
totals.append(totals_)
132130
counters_funcs.append(counters_funcs_)
133131
cells = ", ".join(str(t) for t in totals)
134-
total = " {}".format(cells)
132+
total = f" {cells}"
135133
rows.append(total)
136134

137135
totals = []
@@ -141,7 +139,7 @@ def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
141139
totals.append(totals_)
142140
counters_funcs.append(counters_funcs_)
143141
cells = ", ".join(str(t) for t in totals)
144-
total = " {}".format(cells)
142+
total = f" {cells}"
145143
rows.append(total)
146144

147145
totals = []
@@ -153,7 +151,7 @@ def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
153151
totals.append(totals_)
154152
counters_funcs.append(counters_funcs_)
155153
cells = ", ".join(str(t) for t in totals)
156-
total = " {}".format(cells)
154+
total = f" {cells}"
157155
rows.append(total)
158156

159157
totals = []
@@ -165,7 +163,7 @@ def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
165163
totals.append(totals_)
166164
counters_funcs.append(counters_funcs_)
167165
cells = ", ".join(str(t) for t in totals)
168-
total = " {}".format(cells)
166+
total = f" {cells}"
169167
rows.append(total)
170168

171169
totals = []
@@ -177,19 +175,19 @@ def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
177175
totals.append(totals_)
178176
counters_funcs.append(counters_funcs_)
179177
cells = ", ".join(str(t) for t in totals)
180-
total = " {}".format(cells)
178+
total = f" {cells}"
181179
rows.append(total)
182180

183181
counter_functions = []
184182
for i in range(len(counters_funcs[0])):
185183
counter = 0
186184
for j in range(len(counters_funcs)):
187185
counter += counters_funcs[j][i]
188-
counter_functions.append("{}".format(counter))
186+
counter_functions.append(f"{counter}")
189187

190188
summary = ["Total"] + counter_functions
191189
cells = ", ".join(str(t) for t in summary)
192-
summary_total = " {}".format(cells)
190+
summary_total = f" {cells}"
193191
rows.append(summary_total)
194192

195193
comparison_rst = [".. csv-table::", ""] + [header] + rows
@@ -207,7 +205,7 @@ def generate():
207205

208206
ref_mods += ["dpnp"]
209207
ref_types += ["DPNP"]
210-
ref_vers = ["DPNP(v{})".format(dpnp.__version__)]
208+
ref_vers = [f"DPNP(v{dpnp.__version__})"]
211209
except ImportError as err:
212210
print(f"DOCBUILD: Can't load DPNP module with error={err}")
213211

@@ -216,7 +214,7 @@ def generate():
216214

217215
ref_mods += ["cupy"]
218216
ref_types += ["CuPy"]
219-
ref_vers += ["CuPy(v{})".format(cupy.__version__)]
217+
ref_vers += [f"CuPy(v{cupy.__version__})"]
220218
except ImportError as err:
221219
print(f"DOCBUILD: Can't load CuPy module with error={err}")
222220

@@ -225,12 +223,12 @@ def generate():
225223

226224
base_mod = "numpy" # TODO: Why string?
227225
base_type = "NumPy"
228-
base_ver = "{}(v{})".format(base_type, numpy.__version__)
226+
base_ver = f"{base_type}(v{numpy.__version__})"
229227
except ImportError as err:
230228
print(f"DOCBUILD: Can't load {base_type} module with error={err}")
231229

232230
header = " / ".join([base_ver] + ref_vers) + " APIs"
233-
buf = ["**{}**".format(header), ""]
231+
buf = [f"**{header}**", ""]
234232

235233
buf += generate_table_numbers(base_mod, ref_mods, base_type, ref_types)
236234
buf += section("Module-Level", base_mod, ref_mods, base_type, ref_types)

0 commit comments

Comments
 (0)