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 Python 3.12 #388

Merged
merged 8 commits into from
Oct 5, 2023
Merged

support Python 3.12 #388

merged 8 commits into from
Oct 5, 2023

Conversation

Saransh-cpp
Copy link
Member

Description

Kindly take a look at CONTRIBUTING.md.

Please describe the purpose of this pull request. Reference and link to any relevant issues or pull requests.

Checklist

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't any other open Pull Requests for the required change?
  • Does your submission pass pre-commit? ($ pre-commit run --all-files or $ nox -s lint)
  • Does your submission pass tests? ($ pytest or $ nox -s tests)
  • Does the documentation build with your changes? ($ cd docs; make clean; make html or $ nox -s docs)
  • Does your submission pass the doctests? ($ xdoctest ./src/vector or $ nox -s doctests)

Before Merging

  • Summarize the commit messages into a brief review of the Pull request.

@Saransh-cpp Saransh-cpp marked this pull request as draft October 3, 2023 10:27
@henryiii
Copy link
Member

henryiii commented Oct 3, 2023

We need to make numba conditional on Python version. It’s always slow.

@Saransh-cpp
Copy link
Member Author

Thanks, @henryiii!

The awkward (v1) - numba backend has been failing with the numba v0.58 release. Looking at this now, should I try debugging this, or should we entirely drop awkward v1 support from vector? I believe everyone must have migrated to awkward v2 by now, and it should be okay to stop supporting awkward v1.

cc: @jpivarski

@jpivarski
Copy link
Member

It's not the case that everyone has migrated to Awkward 2 because Coffea 2023 (which depends on Awkward 2 instead of Awkward 1) is still in release-candidate.

However, when Coffea switches from its built-in vectors to Vector, it will be in the 2023 series, so I think there wouldn't be a version conflict to drop Awkward 1 from Vector.

But this is a bigger problem than Vector anyway: Awkward 1 should either fix its Numba 0.58 support or cap it (which would be difficult because it's a soft/runtime dependency).

@jpivarski
Copy link
Member

Also, looking at the error message,

FAILED tests/backends/test_awkward_numba.py::test - numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: native lowering)
Failed in nopython mode pipeline (step: nopython frontend)
Code using Numba extension API maybe depending on 'old_style' error-capturing, which is deprecated and will be replaced by 'new_style' in a future release. See details at https://numba.readthedocs.io/en/latest/reference/deprecation.html#deprecation-of-old-style-numba-captured-errors
Exception origin:
  File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/awkward/_connect/_numba/arrayview.py", line 877, in generic
    raise TypeError(


File "tests/backends/test_awkward_numba.py", line 23:
    def extract(x):
        return x[2][0]
        ^

During: lowering "$20binary_subscr.4 = static_getitem(value=$8binary_subscr.2, index=0, index_var=$const18.3, fn=<built-in function getitem>)" at /home/runner/work/vector/vector/tests/backends/test_awkward_numba.py (23)

I think this might be a warning, not an error, so Awkward 1 doesn't get into a true conflict with Numba until some version after 0.53. Something should be done now, anyway.

@Saransh-cpp
Copy link
Member Author

Thanks for the explanation, @jpivarski!

@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (826572b) 83.21% compared to head (0206dd4) 83.21%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #388   +/-   ##
=======================================
  Coverage   83.21%   83.21%           
=======================================
  Files          96       96           
  Lines       11429    11429           
=======================================
  Hits         9511     9511           
  Misses       1918     1918           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jpivarski
Copy link
Member

A new Awkward 1 version is ready: scikit-hep/awkward#2737

@Saransh-cpp Saransh-cpp marked this pull request as ready for review October 5, 2023 09:18
@Saransh-cpp
Copy link
Member Author

Everything works, thanks, @jpivarski!

@Saransh-cpp Saransh-cpp merged commit 30e19f9 into scikit-hep:main Oct 5, 2023
21 checks passed
@Saransh-cpp Saransh-cpp deleted the 3.12 branch October 5, 2023 09:19
@Saransh-cpp
Copy link
Member Author

I should have asked this before merging, but should we bump Awkward's minimum version to v1.10.5 and create a new v1.2 release?

vector/pyproject.toml

Lines 45 to 57 in 30e19f9

awkward = [
"awkward>=1.2",
]
dev = [
"awkward>=1.2",
'numba>=0.57; python_version < "3.12"',
"papermill>=2.4",
"pytest>=6",
"pytest-cov>=3",
"xdoctest>=1",
]
docs = [
"awkward>=1.2",

@henryiii
Copy link
Member

henryiii commented Oct 5, 2023

There were no code changes, right? It's just adding CI and the trove classifier?

@henryiii
Copy link
Member

henryiii commented Oct 5, 2023

I don't think we need to bump the minimum Awkward, people get the highest version unless something caps, in which case bumping the minimum makes the solve impossible. I'd only bump the minimum if vector itself doesn't support 1.2 of if we have a lower bound dependency on something 1.2 doesn't work with (Numba's not a hard dep), not if 1.2 doesn't work anymore with the latest dependencies.

@henryiii
Copy link
Member

henryiii commented Oct 5, 2023

I don't see any code changes here: v1.1.1...main

So at best, if you want the updated classifier, we could so a 1.1.2, or maybe just a 1.1.1.post1.

@Saransh-cpp
Copy link
Member Author

Saransh-cpp commented Oct 5, 2023

That makes sense, I will create a 1.1.1.post1 (too many ones, haha) release. Thanks!

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.

4 participants