Skip to content

Conversation

@david-cortes-intel
Copy link
Contributor

@david-cortes-intel david-cortes-intel commented Nov 28, 2025

Description

Sets env. variable SCIPY_ARRAY_API=1 for the tests runner scripts, which is required in order for all array API functionalities in sklearn to work.

Note that some tests were setting this environment variable manually, but it only has an effect when set before scipy is imported, so this logic was actually incorrect:
https://docs.scipy.org/doc/scipy/dev/api-dev/array_api.html


Checklist:

Completeness and readability

  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • All CI jobs are green or I have provided justification why they aren't.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
azure 80.43% <ø> (-0.06%) ⬇️
github 82.02% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# if `array-api-compat` package is present in environment
# TODO: create generic approach to handle this for all tests
if sklearn_check_version("1.6"):
environ["SCIPY_ARRAY_API"] = "1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it has no effect when done after importing scipy. It is now set from the test runner script instead.

@david-cortes-intel david-cortes-intel changed the title MAINT: Set SCIPY_ARRAY_API=1 on conda tests MAINT: Set SCIPY_ARRAY_API=1 on tests Dec 2, 2025
@ethanglaser
Copy link
Contributor

/intelci: run

@ethanglaser
Copy link
Contributor

CI looks good, haven't reviewed in full yet but should be able to by end of week. No objections from my end though.

@david-cortes-intel david-cortes-intel merged commit 2abce81 into uxlfoundation:main Dec 3, 2025
31 of 33 checks passed
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.

2 participants