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

Remove limited implementation of __setitem__ from Array #302

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

tomwhite
Copy link
Member

@tomwhite tomwhite commented Sep 5, 2023

I originally added a very limited form of __setitem__ that only accepts single element updates to support the Array API tests, that needed it at the time. Now this is no longer a requirement (https://hypothesis.readthedocs.io/en/latest/changes.html#v6-75-8), I propose removing the code since it isn't generally useful.

With this change we'd be able to treat arrays as immutable, which opens up more optimizations, such as making full a "virtual" (non-materialized) array (see #290, #247).

Also, if we decide we need to make arrays mutable in the future, we can do that in a more intentional way - perhaps by marking any mutated arrays as needing to be materialized to Zarr, so they can then be mutated.

@tomwhite tomwhite merged commit 6be7c74 into main Sep 6, 2023
6 checks passed
@tomwhite tomwhite deleted the immutable-arrays branch September 6, 2023 07:47
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.

1 participant