Skip to content

Conversation

@lucascolley
Copy link
Member

closes gh-55 @ev-br

Copy link
Member Author

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

@ev-br
Copy link
Member

ev-br commented Jan 29, 2026

Ah yes indeed, the test is not strictly spec-compliant apparently: indexing an array produces an size-1 array not a python scalar

(Pdb) xp.full((int(count),), x_slice[i], dtype=x.dtype)
*** TypeError: Expected Python scalar fill_value, got type <class 'array_api_strict._array_object.Array'>
(Pdb) x_slice[i]
Array(False, dtype=array_api_strict.bool)
(Pdb) x_slice
Array([False], dtype=array_api_strict.bool)

I think it needs get_scalar_type(x_slice[i]) from https://github.com/data-apis/array-api-tests/blob/master/array_api_tests/dtype_helpers.py#L188 (untested)

The need to send two matching PRs is sadly rather common. Here the required array-api-tests PR is straightforward in a sense that it'll clearly make tests standard-compatible. Would you be able to send a -tests PR?

Since CI cannot easily test a branch vs branch (and runs a very small number of examples), I typically resort to first testing things locally with editable installs. Roughly (I'm sure you've a nicer way with pixi),

# ... in an `array-api-strict` branch
$ pip install -e .
$ pushd ../array-api-tests
# ... fix the test
$ ARRAY_API_TESTS_MODULE=array_api_strict pytest array_api_tests/test_manipulation_functions.py::test_repeat --max-examples=10_000

When it passes locally, push the -tests PR, make sure it passes with the -strict main on CI, merge the -tests PR, and kick the CI for the -strict PR once again.

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.

BUG: full_like and full accept array fill_value

2 participants