Skip to content

API: Remove The MapIter API from public #25138

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

Merged
merged 4 commits into from
Nov 15, 2023
Merged

Conversation

seberg
Copy link
Member

@seberg seberg commented Nov 13, 2023

This API is very slow to use compared to normal advanced indexing
(which reaches deep into the much richer internals).
Making this fast is difficult and the only known users is Theano:

  • While probably still in use Theano is end-of-life for a long time.
  • The use-case in Theano would be better served with ufunc.at or
    direct advanced indexing use probably (even if that requires
    wrapping into NumPy arrays). Because it will be vastly faster
    normally.

So remove it (make it private) to allow making the ABI of it not be
a strange mix for backwards compatibility.


Revival of gh-24274, because I now have another reason. Bumping maxdims to 64 cannot be done for the mapiter if it is public. So just remove it, because nobody uses it (as in the other PR, the only public user and likely the reason it was made public initially gave a thumbs-up).

Otherwise, we would either not support 64dims in all advanced indexing paths or require odd hacks to keep practically unused API from working.

This API is very slow to use compared to normal advanced indexing
(which reaches deep into the much richer internals).
Making this fast is difficult and the only known users is Theano:
* While probably still in use Theano is end-of-life for a long time.
* The use-case in Theano would be better served with `ufunc.at` or
  direct advanced indexing use probably (even if that requires
  wrapping into NumPy arrays).  Because it will be vastly faster
  normally.

So remove it (make it private) to allow making the ABI of it not be
a strange mix for backwards compatibility.
Copy link
Member

@mattip mattip left a comment

Choose a reason for hiding this comment

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

LGTM, pretty straightforward.

/*
* Store the information needed for fancy-indexing over an array. The
* fields are slightly unordered to keep consec, dataptr and subspace
* where they were originally.
Copy link
Member

Choose a reason for hiding this comment

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

Is there any need to reorder the fields?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm, will have a look. I am not quite sure I found everything that can be cleaned out also.

@mattip mattip merged commit 85d1fe3 into numpy:main Nov 15, 2023
@mattip
Copy link
Member

mattip commented Nov 15, 2023

Thanks @seberg

@seberg seberg deleted the mapiter-removal branch November 15, 2023 14:42
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