-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: migrate to awkward v2 (and keep supporting v1) #284
Conversation
Some comments and questions -
cc: @jpivarski @henryiii Thanks! |
@Saransh-cpp it looks like the bug here is that |
Thank you so much, @agoose77! I really should start reading some text on debugging general |
v2.0.0rcX
Codecov ReportBase: 81.08% // Head: 83.73% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #284 +/- ##
==========================================
+ Coverage 81.08% 83.73% +2.65%
==========================================
Files 96 96
Lines 10672 10682 +10
==========================================
+ Hits 8653 8945 +292
+ Misses 2019 1737 -282
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Okay, this feels more like awkward v2 support, as a user can now use |
v2.0.0rcX
Thanks, @agoose77! Looks much better now! |
2551b01
to
bc4d634
Compare
Ah, good catch on the type hint. |
pyproject.toml
Outdated
ignore_missing_imports = true | ||
disallow_untyped_defs = false | ||
disallow_untyped_calls = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has this moved? This changes the typing permissiveness. I'm not au-fait with what conventions we follow, maybe @henryiii can check this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I initially moved this because it solved the failing "importlib_metadata
has no typing stubs" error. I'll move this back!
or, one can run the doctests along with the unit tests in the following way - | ||
|
||
```bash | ||
python -m pytest --xdoctest . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails for me if I don't install ipykernel
, which is included in the docs
extra. I'll discuss this in the CI configuration down below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is weird. This does seem to work in the GH Actions CI 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume we don't run just pytest --xdoctest .
anywhere? The docs
extra will be bringing in ipykernel. I suppose this isn't an issue though - I just needed to read CONTRIBUTING.md more closely; we already tell the reader to install the docs
extra above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this isn't a problem!
Thanks for the review, @agoose77! Looks much better now! |
For instance, see the "Install awkward v2" step here - https://github.com/scikit-hep/vector/actions/runs/3496655692/jobs/5874212118 (it is empty, in fact, all the "Install awkward v2" steps executed before the last commit are empty). |
Hmm, if awkward wasn't being installed, it should have failed the pip step. I suspect bash was treating the |
Weird behaviour, but everything works now! |
Some discussion points -
|
I think it would be easiest to support only one version. The switchover from requiring |
Noted! I will create a PR to get rid of
This is a bit tricky 😅 We have the 2D object type constructors merged in, but the 3D and 4D ones are still under review (#231, #232). The awkward Should we do a |
Co-authored-by: Angus Hollands <goosey15@gmail.com>
Co-authored-by: Angus Hollands <goosey15@gmail.com>
Ah, now I remember why I was using I will stick to Changelog for |
ca49bbb
to
1971f59
Compare
A gentle review request (again 😬): @jpivarski @henryiii |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that I was slow to respond: this is an important fix!
It looks like this PR makes Vector work for both Awkward v1 and v2. There's this line, asking explicitly for v2:
Lines 13 to 14 in d2a83af
- "awkward>=2.0.0" | |
- "uproot>=5.0.0" |
but I think that's just for notebook examples. The pyproject.toml is only asking for Awkward >= 1.2 (and then only as an opt-in dependency):
Lines 49 to 51 in d2a83af
awkward = [ | |
"awkward>=1.2", | |
] |
(and similar for dev
, etc.)
I see that you're even testing both versions of Awkward:
and
so that's all good.
I think this should be merged! It's satisfying all the requirements, and (if I remember right) there were some people asking for it.
(I'm also reminded that I need to update the disassemble check.)
Now this PR also fixes #294. I was originally thinking that I would update uncompyle6 to the latest Python version that it supports and edit the tests for any changes in bytecode between Python 3.8 and now (I expect very few because our compute functions are pure expressions, no splitting of code paths). The question I had was when "now" is: Python 3.10? Python 3.11? But no! uncompyle6 still only supports Python 3.8! In fact, the latest it supports is Python 3.8.13, not even 3.8.15. (I'm surprised that patch releases matter—I would have thought that Python byte codes can't change from one patch release to the next.) The test was failing because it was pinned to Python 3.8.8 and GitHub Actions no longer serves that Python release. I just changed the number to 3.8.13, and now the test is running again. I hope that uncompyle6 manages to keep up with the new Python versions. Otherwise, I don't know what will happen on October 14, 2024 and Python 3.8 gets end-of-lifed. We might have to drop this test, which would be unfortunate because it's a guard against introducing compute functions that won't be able to support certain backends (e.g. JAX). |
Thanks for the review and the fix, @jpivarski! I hope uncompyle6 bumps up their compatibility in the future. One last question before the holidays: should vector get a 0.11.0 release or a v0.10.1 release? @henryiii pointed out above that 0.(x+1) is a major version in ZeroVer and 0.0.(x+1) is a minor version. |
Numbers aren't expensive, and I don't think we have many people limiting Vector, so I think 0.11 is fine (though if there are no new features, and v1 is still supported, then 0.10.1 is fine too). |
Thanks! Merging this in and tagging 0.11.0! |
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
$ pre-commit run --all-files
or$ nox -s lint
)$ pytest
or$ nox -s tests
)$ cd docs; make clean; make html
or$ nox -s docs
)$ xdoctest ./src/vector
or$ nox -s doctests
)Before Merging