Skip to content

Commit 33a6608

Browse files
authored
Merge branch 'master' into extended_types_support
2 parents a9af727 + df307dd commit 33a6608

20 files changed

+1002
-649
lines changed

.github/workflows/array-api-skips.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ array_api_tests/test_signatures.py::test_func_signature[unique_counts]
1717
array_api_tests/test_signatures.py::test_func_signature[unique_inverse]
1818
array_api_tests/test_signatures.py::test_func_signature[unique_values]
1919

20-
# no '__array_namespace_info__' function
21-
array_api_tests/test_has_names.py::test_has_names[info-__array_namespace_info__]
22-
array_api_tests/test_inspection_functions.py::test_array_namespace_info
23-
array_api_tests/test_inspection_functions.py::test_array_namespace_info_dtypes
24-
array_api_tests/test_searching_functions.py::test_searchsorted
25-
array_api_tests/test_signatures.py::test_func_signature[__array_namespace_info__]
26-
array_api_tests/test_signatures.py::test_info_func_signature[capabilities]
27-
array_api_tests/test_signatures.py::test_info_func_signature[default_device]
28-
array_api_tests/test_signatures.py::test_info_func_signature[default_dtypes]
29-
array_api_tests/test_signatures.py::test_info_func_signature[devices]
30-
array_api_tests/test_signatures.py::test_info_func_signature[dtypes]
31-
3220
# do not return a namedtuple
3321
array_api_tests/test_linalg.py::test_eigh
3422
array_api_tests/test_linalg.py::test_slogdet

.github/workflows/build-sphinx.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
- name: Setup miniconda
105105
id: setup_miniconda
106106
continue-on-error: true
107-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
107+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
108108
with:
109109
miniforge-version: latest
110110
use-mamba: 'true'
@@ -115,7 +115,7 @@ jobs:
115115

116116
- name: ReSetup miniconda
117117
if: steps.setup_miniconda.outcome == 'failure'
118-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
118+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
119119
with:
120120
miniforge-version: latest
121121
use-mamba: 'true'
@@ -223,6 +223,7 @@ jobs:
223223
PR_NUM: ${{ github.event.number }}
224224
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
225225
with:
226+
message-id: url_to_docs
226227
message: |
227228
View rendered docs @ https://intelpython.github.io/dpnp/pull/${{ env.PR_NUM }}/index.html
228229
allow-repeats: false

.github/workflows/check-mkl-interfaces.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
fetch-depth: 0
6060

6161
- name: Setup miniconda
62-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
62+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
6363
with:
6464
miniforge-version: latest
6565
use-mamba: 'true'
@@ -167,7 +167,7 @@ jobs:
167167
ls -la ${{ env.onemkl-source-dir }}
168168
169169
- name: Setup miniconda
170-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
170+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
171171
with:
172172
miniforge-version: latest
173173
use-mamba: 'true'

.github/workflows/conda-package.yml

Lines changed: 25 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
# CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
1515
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
1616
CONDA_BUILD_INDEX_ENV_PY_VER: '3.12' # conda does not support python 3.13
17-
CONDA_BUILD_VERSION: '24.11.2'
17+
CONDA_BUILD_VERSION: '25.1.1'
1818
CONDA_INDEX_VERSION: '0.5.0'
1919
RERUN_TESTS_ON_FAILURE: 'true'
2020
RUN_TESTS_MAX_ATTEMPTS: 2
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup miniconda
5858
id: setup_miniconda
5959
continue-on-error: true
60-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
60+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
6161
with:
6262
miniforge-version: latest
6363
use-mamba: 'true'
@@ -68,7 +68,7 @@ jobs:
6868

6969
- name: ReSetup miniconda
7070
if: steps.setup_miniconda.outcome == 'failure'
71-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
71+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
7272
with:
7373
miniforge-version: latest
7474
use-mamba: 'true'
@@ -101,7 +101,7 @@ jobs:
101101
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
102102
with:
103103
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
104-
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
104+
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda
105105

106106
- name: Upload wheels artifact
107107
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
@@ -129,7 +129,6 @@ jobs:
129129
env:
130130
channel-path: '${{ github.workspace }}/channel/'
131131
pkg-path-in-channel: '${{ github.workspace }}/channel/linux-64/'
132-
extracted-pkg-path: '${{ github.workspace }}/pkg/'
133132
ver-json-path: '${{ github.workspace }}/version.json'
134133

135134
steps:
@@ -139,15 +138,10 @@ jobs:
139138
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
140139
path: ${{ env.pkg-path-in-channel }}
141140

142-
- name: Extract package archive
143-
run: |
144-
mkdir -p ${{ env.extracted-pkg-path }}
145-
tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
146-
147141
- name: Setup miniconda
148142
id: setup_miniconda
149143
continue-on-error: true
150-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
144+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
151145
with:
152146
miniforge-version: latest
153147
use-mamba: 'true'
@@ -158,7 +152,7 @@ jobs:
158152

159153
- name: ReSetup miniconda
160154
if: steps.setup_miniconda.outcome == 'failure'
161-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
155+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
162156
with:
163157
miniforge-version: latest
164158
use-mamba: 'true'
@@ -168,7 +162,8 @@ jobs:
168162
activate-environment: ${{ env.TEST_ENV_NAME }}
169163

170164
- name: Install conda-index
171-
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
165+
run: |
166+
mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
172167
173168
- name: Create conda channel
174169
run: |
@@ -363,7 +358,6 @@ jobs:
363358
env:
364359
channel-path: '${{ github.workspace }}\channel\'
365360
pkg-path-in-channel: '${{ github.workspace }}\channel\win-64\'
366-
extracted-pkg-path: '${{ github.workspace }}\pkg'
367361
ver-json-path: '${{ github.workspace }}\version.json'
368362
workdir: '${{ github.workspace }}'
369363

@@ -374,22 +368,19 @@ jobs:
374368
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
375369
path: ${{ env.pkg-path-in-channel }}
376370

377-
- name: Extract package archive
371+
- name: Store a path to package archive
378372
run: |
379373
@echo on
380-
mkdir -p ${{ env.extracted-pkg-path }}
381374
382-
set SEARCH_SCRIPT="DIR ${{ env.pkg-path-in-channel }} /s/b | FINDSTR /r "dpnp-.*\.tar\.bz2""
375+
set SEARCH_SCRIPT="DIR ${{ env.pkg-path-in-channel }} /s/b | FINDSTR /r "dpnp-.*\.conda""
383376
FOR /F "tokens=* USEBACKQ" %%F IN (`%SEARCH_SCRIPT%`) DO (
384377
SET FULL_PACKAGE_PATH=%%F
385378
)
386379
echo FULL_PACKAGE_PATH: %FULL_PACKAGE_PATH%
387-
388-
python -c "import shutil; shutil.unpack_archive(r\"%FULL_PACKAGE_PATH%\", extract_dir=r\"${{ env.extracted-pkg-path }}\")"
389-
dir ${{ env.extracted-pkg-path }}
380+
(echo FULL_PACKAGE_PATH=%FULL_PACKAGE_PATH%) >> %GITHUB_ENV%
390381
391382
- name: Setup miniconda
392-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
383+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
393384
with:
394385
miniforge-version: latest
395386
use-mamba: 'true'
@@ -405,7 +396,8 @@ jobs:
405396
(echo CONDA_LIB_BIN_PATH=%CONDA_PREFIX%\Library\bin\) >> %GITHUB_ENV%
406397
407398
- name: Install conda-index
408-
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
399+
run: |
400+
mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
409401
410402
- name: Create conda channel
411403
run: |
@@ -639,7 +631,7 @@ jobs:
639631
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
640632

641633
- name: Setup miniconda
642-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
634+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
643635
with:
644636
miniforge-version: latest
645637
use-mamba: 'true'
@@ -654,11 +646,11 @@ jobs:
654646
- name: Package version
655647
shell: bash -el {0}
656648
run: |
657-
echo "PACKAGE_VERSION=$(basename ${{ env.PACKAGE_NAME }}-*.tar.bz2 | sed 's/^${{ env.PACKAGE_NAME }}-\([^-]*\).*/\1/')" >> $GITHUB_ENV
649+
echo "PACKAGE_VERSION=$(basename ${{ env.PACKAGE_NAME }}-*.conda | sed 's/^${{ env.PACKAGE_NAME }}-\([^-]*\).*/\1/')" >> $GITHUB_ENV
658650
659651
- name: Upload
660652
run: |
661-
anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2
653+
anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.conda
662654
env:
663655
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
664656

@@ -697,7 +689,6 @@ jobs:
697689
array-api-skips-file: '${{ github.workspace }}/dpnp/.github/workflows/array-api-skips.txt'
698690
channel-path: '${{ github.workspace }}/channel/'
699691
pkg-path-in-channel: '${{ github.workspace }}/channel/linux-64/'
700-
extracted-pkg-path: '${{ github.workspace }}/pkg/'
701692
ver-json-path: '${{ github.workspace }}/version.json'
702693

703694
steps:
@@ -707,15 +698,10 @@ jobs:
707698
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
708699
path: ${{ env.pkg-path-in-channel }}
709700

710-
- name: Extract package archive
711-
run: |
712-
mkdir -p ${{ env.extracted-pkg-path }}
713-
tar -xvf ${{ env.pkg-path-in-channel }}/${{ env.PACKAGE_NAME }}-*.tar.bz2 -C ${{ env.extracted-pkg-path }}
714-
715701
- name: Setup miniconda
716702
id: setup_miniconda
717703
continue-on-error: true
718-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
704+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
719705
with:
720706
miniforge-version: latest
721707
use-mamba: 'true'
@@ -726,7 +712,7 @@ jobs:
726712

727713
- name: ReSetup miniconda
728714
if: steps.setup_miniconda.outcome == 'failure'
729-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
715+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
730716
with:
731717
miniforge-version: latest
732718
use-mamba: 'true'
@@ -738,11 +724,13 @@ jobs:
738724
- name: Install conda-index
739725
id: install_conda_index
740726
continue-on-error: true
741-
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
727+
run: |
728+
mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
742729
743730
- name: ReInstall conda-index
744731
if: steps.install_conda_index.outcome == 'failure'
745-
run: mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
732+
run: |
733+
mamba install conda-index=${{ env.CONDA_INDEX_VERSION }}
746734
747735
- name: Create conda channel
748736
run: |
@@ -848,9 +836,9 @@ jobs:
848836
if: ${{ github.event.pull_request && !github.event.pull_request.head.repo.fork }}
849837
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
850838
with:
839+
message-id: array_api_results
851840
message: |
852841
${{ env.MESSAGE }}
853-
refresh-message-position: true
854842
855843
cleanup_packages:
856844
name: Clean up anaconda packages
@@ -864,7 +852,7 @@ jobs:
864852
shell: bash -el {0}
865853

866854
steps:
867-
- uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
855+
- uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
868856
with:
869857
miniforge-version: latest
870858
use-mamba: 'true'

.github/workflows/cron-run-tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Setup miniconda
6161
id: setup_miniconda
6262
continue-on-error: true
63-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
63+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
6464
with:
6565
miniforge-version: latest
6666
use-mamba: 'true'
@@ -71,7 +71,7 @@ jobs:
7171

7272
- name: ReSetup miniconda
7373
if: steps.setup_miniconda.outcome == 'failure'
74-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
74+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
7575
with:
7676
miniforge-version: latest
7777
use-mamba: 'true'

.github/workflows/generate_coverage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: Setup miniconda
6565
id: setup_miniconda
6666
continue-on-error: true
67-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
67+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
6868
with:
6969
miniforge-version: latest
7070
use-mamba: 'true'
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: ReSetup miniconda
7777
if: steps.setup_miniconda.outcome == 'failure'
78-
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
78+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
7979
with:
8080
miniforge-version: latest
8181
use-mamba: 'true'

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
71+
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
7272
with:
7373
sarif_file: results.sarif

doc/reference/array_api.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. _array-api-standard-compatibility:
2+
3+
.. https://numpy.org/doc/stable/reference/array_api.html
4+
5+
********************************
6+
Array API standard compatibility
7+
********************************
8+
9+
DPNP's main namespace as well as the :mod:`dpnp.fft` and :mod:`dpnp.linalg`
10+
namespaces are compatible with the
11+
`2023.12 version <https://data-apis.org/array-api/2023.12/index.html>`__
12+
of the Python array API standard.
13+
14+
Inspection
15+
==========
16+
17+
DPNP implements the `array API inspection utilities
18+
<https://data-apis.org/array-api/latest/API_specification/inspection.html>`__.
19+
These functions can be accessed via the ``__array_namespace_info__()``
20+
function, which returns a namespace containing the inspection utilities.
21+
22+
.. autosummary::
23+
:toctree: generated/
24+
:nosignatures:
25+
26+
dpnp.__array_namespace_info__

doc/reference/fft.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. _routines.fft:
2+
3+
.. py:module:: dpnp.fft
4+
15
Discrete Fourier Transform
26
==========================
37

doc/reference/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ API reference of the Data Parallel Extension for NumPy*
3333
dtypes_table
3434
comparison
3535
misc
36+
array_api

doc/reference/linalg.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. _routines.linalg:
2+
3+
.. py:module:: dpnp.linalg
4+
15
Linear algebra
26
==============
37

dpnp/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,17 @@
6363
)
6464

6565
# Borrowed from DPCTL
66-
from dpctl.tensor import DLDeviceType
66+
from dpctl.tensor import __array_api_version__, DLDeviceType
6767

68-
from dpnp.dpnp_array import dpnp_array as ndarray
69-
from dpnp.dpnp_flatiter import flatiter as flatiter
70-
from dpnp.dpnp_iface_types import *
71-
from dpnp.dpnp_iface import *
72-
from dpnp.dpnp_iface import __all__ as _iface__all__
73-
from dpnp.dpnp_iface_utils import *
74-
from dpnp.dpnp_iface_utils import __all__ as _ifaceutils__all__
75-
from dpnp._version import get_versions
68+
from .dpnp_array import dpnp_array as ndarray
69+
from .dpnp_array_api_info import __array_namespace_info__
70+
from .dpnp_flatiter import flatiter as flatiter
71+
from .dpnp_iface_types import *
72+
from .dpnp_iface import *
73+
from .dpnp_iface import __all__ as _iface__all__
74+
from .dpnp_iface_utils import *
75+
from .dpnp_iface_utils import __all__ as _ifaceutils__all__
76+
from ._version import get_versions
7677

7778
__all__ = _iface__all__
7879
__all__ += _ifaceutils__all__

0 commit comments

Comments
 (0)