FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

MAINT: validate device on numpy and dask by crusaderky · Pull Request #301 · data-apis/array-api-compat · GitHub

MAINT: validate device on numpy and dask - #301

Merged
ev-br merged 1 commit into
data-apis:mainfrom
crusaderky:check_device
Apr 8, 2025
Merged

MAINT: validate device on numpy and dask#301
ev-br merged 1 commit into
data-apis:mainfrom
crusaderky:check_device

Conversation

Copy link
Copy Markdown
Contributor

Salvaged from #293.

  • Validate device keyword in array_api_compat.numpy.astype
  • Validate device keyword in all Dask functions

Copilot AI review requested due to automatic review settings April 3, 2025 11:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull Request Overview

This PR adds device validation for NumPy and Dask functions by replacing manual device checks with a shared helper function.

  • Introduces _helpers._check_device calls in both NumPy and Dask array functions.
  • Updates helper function _check_device to support device validation for both array backends.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
array_api_compat/numpy/_aliases.py Replaces manual device validation with _helpers._check_device call.
array_api_compat/dask/array/_aliases.py Adds _helpers._check_device call in multiple functions.
array_api_compat/common/_helpers.py Refactors _check_device to support both NumPy and Dask device checks.

Comment thread array_api_compat/common/_helpers.py Outdated
crusaderky force-pushed the check_device branch 2 times, most recently from 030d62d to e718c7b Compare April 3, 2025 11:45
ev-br merged commit 9a87e6f into data-apis:main Apr 8, 2025

ev-br commented Apr 8, 2025

Copy link
Copy Markdown
Member

Thanks @crusaderky

ev-br added this to the 1.12 milestone Apr 8, 2025
crusaderky deleted the check_device branch April 8, 2025 17:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL