Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 0 additions & 3 deletions .github/workflows/array-api-skips.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# array API tests to be skipped

# data-apis/array-api-tests/issues/456
array_api_tests/test_dlpack.py::test_dunder_dlpack

# data-apis/array-api/issues/1006
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]
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ This release is compatible with NumPy 2.5.
* 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)
* `dpnp` uses pybind11 3.1.0 [#3015](https://github.com/IntelPython/dpnp/pull/3015)
* Reworked the ASV benchmarks and added end-to-end workload benchmarks derived from dpBench [#2996](https://github.com/IntelPython/dpnp/pull/2996)
* 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)
* 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)

### Deprecated

Expand Down Expand Up @@ -95,6 +97,9 @@ This release is compatible with NumPy 2.5.
* 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)
* Fixed a per-call `sycl::queue` leak in `usm_ndarray::get_queue()`/`get_device()` [#3042](https://github.com/IntelPython/dpnp/pull/3042)
* Fixed `dpnp.linspace` returning `nan` for equal infinite endpoints [#3043](https://github.com/IntelPython/dpnp/pull/3043)
* 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)
* 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)
* Fixed operations on a boolean array whose bytes are not `0x00`/`0x01` [#3055](https://github.com/IntelPython/dpnp/pull/3055)

### Security

Expand Down
44 changes: 21 additions & 23 deletions doc/comparison_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ def import_mod(mod, cls):
obj = importlib.import_module(mod)
if cls:
obj = getattr(obj, cls)
return obj, ":meth:`{}.{}.{{}}`".format(mod, cls)
return obj, f":meth:`{mod}.{cls}.{{}}`"
else:
# ufunc is not a function
return obj, ":obj:`{}.{{}}`".format(mod)
return obj, f":obj:`{mod}.{{}}`"


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

totals = calc_totals(base_mod, ref_mods, cls)

cells = ", ".join(str(t) for t in totals)
total = " {}".format(cells)
total = f" {cells}"

return [header, total]

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

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

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

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


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

cells = ", ".join(str(t) for t in totals)
total = " {}".format(cells)
total = f" {cells}"

return total, counter_funcs


def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
all_types = ["Name"] + [base_type] + ref_types
header = ", ".join("**{}**".format(t) for t in all_types)
header = " {}".format(header)
header = ", ".join(f"**{t}**" for t in all_types)
header = f" {header}"

rows = []
counters_funcs = []
Expand All @@ -131,7 +129,7 @@ def generate_table_numbers(base_mod, ref_mods, base_type, ref_types, cls=None):
totals.append(totals_)
counters_funcs.append(counters_funcs_)
cells = ", ".join(str(t) for t in totals)
total = " {}".format(cells)
total = f" {cells}"
rows.append(total)

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

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

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

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

counter_functions = []
for i in range(len(counters_funcs[0])):
counter = 0
for j in range(len(counters_funcs)):
counter += counters_funcs[j][i]
counter_functions.append("{}".format(counter))
counter_functions.append(f"{counter}")

summary = ["Total"] + counter_functions
cells = ", ".join(str(t) for t in summary)
summary_total = " {}".format(cells)
summary_total = f" {cells}"
rows.append(summary_total)

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

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

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

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

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

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

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

buf += generate_table_numbers(base_mod, ref_mods, base_type, ref_types)
buf += section("Module-Level", base_mod, ref_mods, base_type, ref_types)
Expand Down
Loading
Loading