Skip to content

Fix CuPy indexing, assignment and scalar truth conversion - #11797

Open
wpyaoxueros wants to merge 4 commits into
pydata:mainfrom
wpyaoxueros:codex/cupy-indexing-closeout
Open

wpyaoxueros wants to merge 4 commits into
pydata:mainfrom
wpyaoxueros:codex/cupy-indexing-closeout

Conversation

@wpyaoxueros

@wpyaoxueros wpyaoxueros commented Oct 23, 2026 •

Copy link
Copy Markdown

Description

Codex on behalf of @wpyaoxueros. Closes #11739.

Contributor confirmation, translated from Chinese: "I have reviewed the changes and found no issues."

CuPy indexers currently fail when they reach pandas-backed coordinates, basic assignment can mix NumPy values with CuPy storage, and scalar truth conversion can trigger an implicit conversion to NumPy. This patch explicitly converts indexers at the pandas boundary, converts assignment values to the target array backend, and uses the underlying array's truth conversion while preserving pandas extension-array handling.

Regression coverage includes vector/multidimensional/argmax indexers, scalar/slice/.loc assignment, scalar CuPy truth values, idxmin/idxmax, and pandas nullable-boolean controls.

Remote validation against base fbc4cf19b919ce23fd0f7d419e9c141f046788a9:

  • Same added test cases: 10 failed, 1 passed on unchanged source.
  • Patched CuPy/bool selections: 20 passed.
  • Related indexing/index/variable modules: 808 passed, 67 skipped, 8 xfailed, 3 xpassed.
  • Ruff checks/formatting on the six changed files and diff whitespace checks passed.

These checks ran on the designated Linux GPU workstation. The full repository suite and type checking were not rerun on this commit. The required release-note entry has been added. The contributor has confirmed review of the changes; the remote checks below were executed by Codex.

Documentation CI on 6cbb300 failed in the unchanged doc/internals/time-coding.md timestamp example with pandas 3.1.0. A standalone remote pandas-only check reproduces OutOfBoundsDatetime for the s and ms units without importing xarray; the same check passes with pandas 3.0.6. The follow-up commit only moves this PR's release note into the unreleased section. This is a known documentation-check failure, not a claim that the complete documentation build passes.

Checklist

AI Disclosure

  • This PR contains AI-generated content.
    • The AI-generated changes were tested by Codex on the remote workstation.
    • The contributor has reviewed the changes and reported no issues.

Tool: Codex. Task scope: address the CuPy indexing, assignment and scalar-bool failures reported in #11739, with regression tests and validation on the remote workstation. Codex prepared the six-file patch, ran the reported checks, prepared this description and submitted the PR at the contributor's explicit request. The contributor's own review confirmation is quoted above. No personal execution of the agent-run tests is claimed.

Prepared with Codex assistance. Public PR authorship and required human review remain pending.

Co-authored-by: Codex <noreply@openai.com>
wpyaoxueros and others added 2 commits October 23, 2026 15:04
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@wpyaoxueros
wpyaoxueros marked this pull request as ready for review October 23, 2026 15:37
Co-authored-by: Codex <noreply@openai.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remaining cupy failures: cupy indexers on numpy objects, basic assignment, bool()

1 participant