Skip to content

Remove dependencies between Numba's Cpython and NumPy module - #9437

Merged
sklam merged 18 commits into
numba:mainfrom
kc611:independent_modules
Mar 4, 2024
Merged

sklam merged 18 commits into
numba:mainfrom
kc611:independent_modules

Conversation

@kc611

@kc611 kc611 commented Feb 14, 2024 •

Copy link
Copy Markdown
Contributor

As titled.

This PR intends to remove dependency of Cpython module on NumPy module and adds independent builtins that are seperate for NumPy and Cpython modules.

@kc611 kc611 added the skip_release_notes Skip towncrier requirement label Feb 15, 2024
@kc611
kc611 marked this pull request as ready for review February 21, 2024 12:53
@kc611
kc611 force-pushed the independent_modules branch from d3f81f8 to 7220c79 Compare February 27, 2024 14:35
@sklam
sklam self-requested a review February 27, 2024 14:44
Comment thread numba/cpython/rangeobj.py Outdated
Comment thread numba/np/math/__init__.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/mathimpl.py Outdated
Comment thread numba/np/math/numbers.py Outdated
@sklam

sklam commented Feb 27, 2024

Copy link
Copy Markdown
Member

File history look ok under git blame

@sklam sklam added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Feb 27, 2024
@kc611 kc611 added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Feb 28, 2024
@sklam sklam added 4 - Waiting on author Waiting for author to respond to review and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Feb 28, 2024
@kc611
kc611 requested a review from sklam February 29, 2024 17:54
@kc611 kc611 added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Feb 29, 2024

@sklam sklam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Besides the following comment. As we discussed out-of-band, the files on the np side should retain the "registration code" as code comments. So most of the changes in f513937 should be restored and then comment out.

Comment thread numba/np/math/mathimpl.py Outdated
@sklam sklam added 4 - Waiting on author Waiting for author to respond to review and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Feb 29, 2024
@kc611 kc611 added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Mar 1, 2024
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/cmathimpl.py Outdated
Comment thread numba/np/math/numbers.py

from numba.core.imputils import impl_ret_untracked
from numba.core import typing, types, errors, cgutils
from numba.cpython.unsafe.numbers import viewer

@sklam sklam Mar 1, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will require a np version, but the change can be done later in subsequent PRs. viewer is only used by scalar_view which is the implementation for np.view. In this file, the registration is commented out. So, this line is effectively dead.

@sklam sklam added 4 - Waiting on author Waiting for author to respond to review and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Mar 1, 2024
Co-authored-by: Siu Kwan Lam <1929845+sklam@users.noreply.github.com>
@kc611 kc611 added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Mar 4, 2024
@kc611
kc611 requested a review from sklam March 4, 2024 05:31
@kc611 kc611 added the NumPy 2.0 Related to NumPy 2.0 support label Mar 4, 2024
@sklam sklam added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author NumPy 2.0 Related to NumPy 2.0 support labels Mar 4, 2024
@sklam
sklam merged commit a7fc4b5 into numba:main Mar 4, 2024
@sklam sklam added this to the 0.60.0-rc1 milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge skip_release_notes Skip towncrier requirement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants