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

fix: avoid mixing different versions of awkward in uproot5 tests #349

Merged
merged 2 commits into from Jul 31, 2022

Conversation

alexander-held
Copy link
Member

@alexander-held alexander-held commented Jul 30, 2022

The tests of the most recent versions of dependencies started failing for uproot5. The reason is that uproot5 uses the awkward v2 API, but the histogram creation code in cabinetry uses awkward directly as well (which currently results in v1). The two do not mix:

import awkward as ak
a = ak._v2.Array([1,2,3])
ak.to_numpy(a)

results in

TypeError: unrecognized array type: <Array [1, 2, 3] type='3 * int64'>

The solution is to call .to_numpy() on the relevant arrays instead, which will then use the v2 API in these tests. As uproot5 and awkward v2 should release at the same time, this probably would not have an impact on users, but this change should keep the tests working.

* fix test of upcoming versions of uproot5

@codecov
Copy link

codecov bot commented Jul 30, 2022

Codecov Report

Merging #349 (fb61394) into master (0c75aad) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #349   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         1902      1901    -1     
  Branches       303       303           
=========================================
- Hits          1902      1901    -1     
Impacted Files Coverage Δ
src/cabinetry/contrib/histogram_creator.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c75aad...fb61394. Read the comment docs.

@alexander-held alexander-held merged commit b8cca68 into master Jul 31, 2022
@alexander-held alexander-held deleted the fix/histograms-awkward2-uproot5 branch July 31, 2022 15:12
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.

None yet

1 participant