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

Support numpy.repeat #3457

Closed
stuartarchibald opened this issue Oct 31, 2018 · 9 comments
Closed

Support numpy.repeat #3457

stuartarchibald opened this issue Oct 31, 2018 · 9 comments
Labels
feature_request good first issue A good issue for a first time contributor

Comments

@stuartarchibald
Copy link
Contributor

Feature request

Add support for numpy.repeat.

@stuartarchibald stuartarchibald added feature_request good first issue A good issue for a first time contributor labels Oct 31, 2018
@NanduTej
Copy link
Contributor

Hey, I am a beginner and I would like to give this issue a try.

@NanduTej
Copy link
Contributor

NanduTej commented Nov 20, 2018

Hey @stuartarchibald, I wanted to try and contribute to fixing this issue so I pulled the code from development and tried to set it up in my local. When I ran pip install -r requirements.txt, I ran into an error I couldn't solve -
Collecting llvmlite>=0.26.0dev0 (from numba==0.41.0.dev0+474.ge743367.dirty)
Could not find a version that satisfies the requirement llvmlite>=0.26.0dev0 (from numba==0.41.0.dev0+474.ge743367.dirty) (from versions: 0.2.0, 0.2.1, 0.2.2, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0, 0.12.0.1, 0.12.1, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.17.0, 0.17.1, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.22.0, 0.23.0, 0.23.2, 0.24.0, 0.25.0)
No matching distribution found for llvmlite>=0.26.0dev0 (from numba==0.41.0.dev0+474.ge743367.dirty)

Can you please help me with the setup?

@stuartarchibald
Copy link
Contributor Author

Hi, thanks for wanting to contribute this feature. I'd recommend following the instructions here as they provide the fastest way to get set up to undertake development.

The issue you are seeing is because Numba relies on llvmlite, and Numba master branch uses developmental (and therefore unpublished) versions of llvmlite. These llvmlite builds are available for use with pip from here https://anaconda.org/numba/llvmlite, instructions on how to use them are also there.

Hope this helps.

@NanduTej
Copy link
Contributor

Hi, thanks for wanting to contribute this feature. I'd recommend following the instructions here as they provide the fastest way to get set up to undertake development.

The issue you are seeing is because Numba relies on llvmlite, and Numba master branch uses developmental (and therefore unpublished) versions of llvmlite. These llvmlite builds are available for use with pip from here https://anaconda.org/numba/llvmlite, instructions on how to use them are also there.

Hope this helps.

Thank you.

@NanduTej
Copy link
Contributor

@stuartarchibald , Can you help me out with what needs to be done here. I went through - #3509, which seemed like a similar issue, but could not figure what exactly needs to be done. TIA.

@stuartarchibald
Copy link
Contributor Author

First you need to write a working implementation of np.repeat, then that needs to be wrapped in numba.extending.overload to handle dispatch with respect to types. This is probably a simpler PR to look at to get the idea #2902

@NanduTej
Copy link
Contributor

Hi @stuartarchibald , I wrote the code for repeat and added some tests to check it in test_array_methods.py. I got stuck with one error I am not able to resolve while testing -

numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Unknown attribute 'repeat' of type array(int64, 0d, C)

How do I resolve this?

@stuartarchibald
Copy link
Contributor Author

@NanduTej thanks for writing this. Without seeing the code you've written it's quite hard to guess what it is that's wrong. However, I expect the issue is that the code tries to compile something like ndarray.repeat(x) without there being an implementation of ndarray.repeat registered.

If it's mostly working ok but with just a couple of errors, perhaps open a pull request with the code so you can get some help with the remaining issues? Thanks.

@stuartarchibald
Copy link
Contributor Author

Fixed in #3900, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request good first issue A good issue for a first time contributor
Projects
None yet
Development

No branches or pull requests

2 participants