Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MNT: bump to array API 2025.12, array-api-compat 1.15, array-api-extra 0.10.3 - #34231

Merged
virchan merged 3 commits into
scikit-learn:mainfrom
lucascolley:bump-xpx
Jun 11, 2026
Merged

MNT: bump to array API 2025.12, array-api-compat 1.15, array-api-extra 0.10.3#34231
virchan merged 3 commits into
scikit-learn:mainfrom
lucascolley:bump-xpx

Conversation

@lucascolley

Copy link
Copy Markdown
Contributor
  • MNT: bump to array-api-compat 1.15, array-api-extra 0.10.3
  • STY: run linter

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Thank you for opening your first pull request to scikit-learn! 🎉

To help get your contribution reviewed, please make sure that:

  • You have filled out the pull request template. - The pull request addresses an existing issue that is ready for
    contribution (e.g. not tagged as "Needs Triage", "Needs Decision", ...).
    If you are proposing a new feature, please open an issue to discuss it first.
  • There are no other open pull requests already targeting the same issue. - You have followed the pull request checklist.
    In particular, linting and tests should pass.

@lucascolley lucascolley changed the title MNT: bump array-api-compat to 1.15, array-api-extra to 0.10.3 MNT: bump array-api-compat to 1.15, array-api-extra to 0.10.3, array API 2025.12 Jun 9, 2026
@lucascolley
lucascolley marked this pull request as ready for review June 9, 2026 15:20
@lucascolley lucascolley changed the title MNT: bump array-api-compat to 1.15, array-api-extra to 0.10.3, array API 2025.12 MNT: bump to array API 2025.12, array-api-compat 1.15, array-api-extra 0.10.3 Jun 9, 2026
@github-actions github-actions Bot removed the CUDA CI label Jun 10, 2026

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All CI is green including CUDA.

Cc'ing @betatim, @ogrisel for visibility.

@betatim betatim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the bumping. Looks reasonable to me, though I didn't look at the changes to the vendored code.

One question for my education about the white space changes: how did you find these? Shouldn't our CI linter have found these already?

@lucascolley

Copy link
Copy Markdown
Contributor Author

I ran pixi run lint, executing the task defined at https://github.com/glemaitre/python-stack/blob/main/scikit-learn/pixi.toml.

@lucascolley

Copy link
Copy Markdown
Contributor Author

btw @OmarManzoor you may want to look into removing

def _isin(element, test_elements, xp, assume_unique=False, invert=False):
"""Calculates ``element in test_elements``, broadcasting over `element`
only.
Returns a boolean array of the same shape as `element` that is True
where an element of `element` is in `test_elements` and False otherwise.
"""
if _is_numpy_namespace(xp):
return xp.asarray(
numpy.isin(
element=element,
test_elements=test_elements,
assume_unique=assume_unique,
invert=invert,
)
)
original_element_shape = element.shape
element = xp.reshape(element, (-1,))
test_elements = xp.reshape(test_elements, (-1,))
return xp.reshape(
_in1d(
ar1=element,
ar2=test_elements,
xp=xp,
assume_unique=assume_unique,
invert=invert,
),
original_element_shape,
)
now that we have https://data-apis.org/array-api-extra/generated/array_api_extra.isin.html

@OmarManzoor

Copy link
Copy Markdown
Contributor

btw @OmarManzoor you may want to look into removing

def _isin(element, test_elements, xp, assume_unique=False, invert=False):
"""Calculates ``element in test_elements``, broadcasting over `element`
only.
Returns a boolean array of the same shape as `element` that is True
where an element of `element` is in `test_elements` and False otherwise.
"""
if _is_numpy_namespace(xp):
return xp.asarray(
numpy.isin(
element=element,
test_elements=test_elements,
assume_unique=assume_unique,
invert=invert,
)
)
original_element_shape = element.shape
element = xp.reshape(element, (-1,))
test_elements = xp.reshape(test_elements, (-1,))
return xp.reshape(
_in1d(
ar1=element,
ar2=test_elements,
xp=xp,
assume_unique=assume_unique,
invert=invert,
),
original_element_shape,
)

now that we have https://data-apis.org/array-api-extra/generated/array_api_extra.isin.html

Agreed. I think we might also have one or two others as well.

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks, @lucascolley!

@virchan
virchan merged commit 2b91769 into scikit-learn:main Jun 11, 2026
50 checks passed
@lucascolley
lucascolley deleted the bump-xpx branch June 11, 2026 14:54
@lucascolley

Copy link
Copy Markdown
Contributor Author

thanks all :)

@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants