Skip to content

making numba optional#423

Merged
eriknw merged 49 commits into
python-graphblas:mainfrom
eriknw:no_numba
Apr 16, 2023
Merged

making numba optional#423
eriknw merged 49 commits into
python-graphblas:mainfrom
eriknw:no_numba

Conversation

@eriknw

@eriknw eriknw commented Apr 3, 2023

Copy link
Copy Markdown
Member

I started poking around to see what it would take to allow numba to be optional. Closes #415. May also address #324.

This is a work in progress and can probably be cleaned up. This also tests against Python 3.11 and PyPy.

Let's see what happens in CI!

Comment thread graphblas/io.py Outdated
@coveralls

coveralls commented Apr 3, 2023

Copy link
Copy Markdown

Coverage Status

Changes unknown
when pulling 3f4a3ee on eriknw:no_numba
into ** on python-graphblas:main**.

@eriknw eriknw marked this pull request as draft April 4, 2023 14:40
@eriknw

eriknw commented Apr 4, 2023

Copy link
Copy Markdown
Member Author

PyPy 3.8.16 0_73_pypy had a segfault here when using psg wheel, so I'm skipping PyPy on CI for now (not worth the effort). Most of the PyPy jobs were passing though!

I'm not sure when I'll be able to push this PR over the finish line, but it's reviewable in its current state. Most of the changes are pretty minor, and it was mostly just grunt-work to get tests to pass w/o numba installed.

This PR does not yet introduce "udf" backends or a means to make numba optional when installing.

@eriknw

eriknw commented Apr 7, 2023

Copy link
Copy Markdown
Member Author

Using numba==0.57.0rc1 appears to work! 🎉 (also NumPy 1.24 and Python 3.11)

Comment thread graphblas/core/operator/binary.py
@eriknw eriknw marked this pull request as ready for review April 9, 2023 19:20
@eriknw

eriknw commented Apr 9, 2023

Copy link
Copy Markdown
Member Author

I think this is ready for review/closer scrutiny.

This sets us on the path of having numba and even suitesparse-graphblas as optional dependencies. Documentation has been updated to show pip install python-graphblas[default].

We may want to wait until numba 0.57 is released to merge this.

@eriknw

eriknw commented Apr 16, 2023

Copy link
Copy Markdown
Member Author

I futz around with coverage a little bit, and in the process fixed a few bugs. I also commented code e.g. # NOT COVERED, # BRANCH NOT COVERED, and # FLAKY COVERAGE to call attention.

Anyway, this is going in! I skip numba 0.57.0rc1 on Windows in CI. We can update CI when there is a new RC, and/or when 0.57.0 is released.

One final reminder: I am curious whether it's better to use isclose as a UDF or a recipe. We have both. We should experiment.

@eriknw eriknw merged commit 0eb490f into python-graphblas:main Apr 16, 2023
@eriknw eriknw mentioned this pull request Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make numba able to be optional

3 participants