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

replace llvmlite.ir instead of llvmlite.llvmpy.core #1413

Merged
merged 4 commits into from
Apr 13, 2022

Conversation

Ahmad-AlSubaie
Copy link
Contributor

issue #1411

This is my first PR and my first open source contribution.

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #1413 (a463e91) into main (edfce38) will decrease coverage by 0.07%.
The diff coverage is 32.21%.

Impacted Files Coverage Δ
src/awkward/_v2/_connect/cuda/__init__.py 0.00% <0.00%> (ø)
src/awkward/_v2/_connect/jax/__init__.py 0.00% <0.00%> (ø)
src/awkward/_v2/operations/convert/ak_from_cupy.py 50.00% <0.00%> (+23.33%) ⬆️
src/awkward/_v2/operations/convert/ak_from_jax.py 50.00% <0.00%> (-25.00%) ⬇️
src/awkward/_v2/operations/convert/ak_to_cupy.py 33.33% <0.00%> (+23.95%) ⬆️
src/awkward/_v2/operations/convert/ak_to_jax.py 33.33% <0.00%> (-41.67%) ⬇️
src/awkward/_v2/operations/describe/ak_backend.py 10.00% <0.00%> (-2.50%) ⬇️
src/awkward/_v2/_util.py 75.11% <37.06%> (-8.22%) ⬇️
src/awkward/_v2/contents/numpyarray.py 90.42% <50.00%> (-0.15%) ⬇️
src/awkward/_v2/_connect/numba/builder.py 81.60% <100.00%> (ø)
... and 3 more
@Ahmad-AlSubaie Ahmad-AlSubaie marked this pull request as draft April 13, 2022 02:45
@Ahmad-AlSubaie Ahmad-AlSubaie marked this pull request as ready for review April 13, 2022 03:36
@jpivarski
Copy link
Member

Thank you very much for taking this on!

I see that you've added the import for llvmlite.ir, and you've correctly done it only in scopes (function-scope or module-scope, but in your case, just function-scopes) in which we already know that Numba is installed.

What's missing is the replacement of

  • llvmlite.llvmpy.core.Type.intllvmlite.ir.IntType
  • llvmlite.llvmpy.core.Type.pointerllvmlite.ir.PointerType

This is a good issue to get started on because these can be string-substitutions: the arguments to these functions are the same in both interfaces, so just the fully-qualified names of the functions (i.e. with all the dots) need to be replaced. Also, I can tell you that these functions were never imported using Python's from (e.g. from llvmlite.llvmpy.core import Type), so you don't need to worry about them appearing in places as "Type.int" without qualification.

These are all the files where the old functions appear:

% fgrep -rl llvmpy src/
src/awkward/_connect/_numba/builder.py
src/awkward/behaviors/string.py
src/awkward/_v2/_connect/numba/builder.py
src/awkward/_v2/behaviors/string.py

Although your imports are in the right scope, I don't think they're in exactly the right places, since they should be replacing imports for llvmlite.llvmpy.core. Instead of the two additional imports, I think you want to replace these imports:

  • import llvmlite.llvmpy.coreimport llvmlite.ir

Again, string substitution is good enough because they're always fully qualified.

When pre-commit changes the branch, you'll have to git pull those changes into your local git repo. Oh wait, it looks like you've done that already.

In fact, you've made a lot of the changes I described above while I was typing them. (I should have just waited!)

@Ahmad-AlSubaie
Copy link
Contributor Author

Glad to be of help. Thank you for the detailed breakdown of the issue. I'm still learning the details of using Git and it's workflow.

% fgrep -rl llvmpy src/ returns nothing now.

and all
import llvmlite.llvmpy.core → import llvmlite.ir

I haven't added any new import calls. Unless something else come up, this issue should be closed?

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

Yes, this is perfect!

There shouldn't be any new imports, since each llvmlite.llvmpy.core becomes a llvmlite.ir. So, no problems there.

I've attached issue #1411 to this PR (in the "Development" box on the right), so when this PR is merged, the issue will automatically be closed.

I've approved this PR, and that means that I'll be merging it when I'm certain that you're not still working on it. It looks to me like you're done. If you just give me a thumbs-up or a short comment saying you're done, I'll press the merge button.

Thanks for contributing!

@Ahmad-AlSubaie
Copy link
Contributor Author

Yup its all done. And thank you for being patient with me. Hopefully I can help contribute more.

@jpivarski jpivarski merged commit a2b9a1c into scikit-hep:main Apr 13, 2022
@jpivarski
Copy link
Member

@all-contributors please add @Ahmad-AlSubaie for code

@allcontributors
Copy link
Contributor

@jpivarski

I've put up a pull request to add @Ahmad-AlSubaie! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants