Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top level array namespace #473

Merged
merged 3 commits into from
Jun 6, 2024
Merged

Top level array namespace #473

merged 3 commits into from
Jun 6, 2024

Conversation

tomwhite
Copy link
Member

@tomwhite tomwhite commented Jun 4, 2024

This is a part of #307, which simply adds the array API public members to the top-level cubed namespace. Later (probably after the next release), I'd like to deprecate everything in cubed.array_api for removal in the future.

Any thoughts @TomNicholas?

@tomwhite tomwhite added this to the 0.15.0 milestone Jun 5, 2024
@tomwhite tomwhite force-pushed the top-level-array-namespace branch from 83d97c8 to 369f179 Compare June 5, 2024 17:26
@TomNicholas
Copy link
Member

This seems sensible, my main question is just whether this would prevent it working with hypothesis for any reason (see #307 (comment))

@tomwhite
Copy link
Member Author

tomwhite commented Jun 6, 2024

This seems sensible, my main question is just whether this would prevent it working with hypothesis for any reason (see #307 (comment))

Seems to work fine:

>>> from hypothesis.extra.array_api import make_strategies_namespace
>>> import cubed as xp
>>> xps = make_strategies_namespace(xp)
>>> xps.arrays(xp.int8, (2, 3)).example()
cubed.Array<array-169, shape=(2, 3), dtype=int8, chunks=((2,), (3,))>
>>> import cubed.array_api as xp
>>> xps = make_strategies_namespace(xp)
>>> xps.arrays(xp.int8, (2, 3)).example()
cubed.Array<array-2396, shape=(2, 3), dtype=int8, chunks=((2,), (3,))>

@tomwhite tomwhite merged commit 560ceb9 into main Jun 6, 2024
8 of 9 checks passed
@tomwhite tomwhite deleted the top-level-array-namespace branch June 6, 2024 08:39
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