Skip to content

Commit

Permalink
fix: Uproot tests now work with Awkward 2.0.0. (#795)
Browse files Browse the repository at this point in the history
* fix: Uproot tests now work with Awkward 2.0.0.

* Require dask-awkward=>=2022.12a3 and fix typo.
  • Loading branch information
jpivarski authored Dec 10, 2022
1 parent 025fb2b commit 1bc01e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ classifiers = [
"Topic :: Utilities",
]
dependencies = [
"awkward>=2.0.0rc5",
"awkward>=2.0.0",
"importlib-metadata;python_version<\"3.8\"",
"numpy",
"packaging",
Expand All @@ -49,16 +49,16 @@ dynamic = [

[project.optional-dependencies]
dev = [
"awkward>=2.0.0rc2",
"awkward>=2.0.0",
"boost_histogram>=0.13",
"dask-awkward>=2022.10a0;python_version >= \"3.8\"",
"dask-awkward>=2022.12a3;python_version >= \"3.8\"",
"dask[array];python_version >= \"3.8\"",
"hist>=1.2",
"pandas",
"awkward-pandas;python_version >= \"3.8\"",
]
test = [
"awkward>=2.0.0rc2",
"awkward>=2.0.0",
"lz4",
"pytest>=6",
"pytest-timeout",
Expand Down
4 changes: 2 additions & 2 deletions src/uproot/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def awkward():
to output as NumPy arrays, rather than Awkward arrays.
"""
) from err
if parse_version("1") < parse_version(awkward.__version__) < parse_version("2"):
if parse_version("2") <= parse_version(awkward.__version__):
return awkward
else:
raise ModuleNotFoundError(
"Uproot 4.x can only be used with Awkward 1.x; you have Awkward {}".format(
"Uproot 5.x can only be used with Awkward 2.x; you have Awkward {}".format(
awkward.__version__
)
)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_0637-setup-tests-for-AwkwardForth.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def test_35(is_forth):
interp = uproot.interpretation.identify.interpretation_of(branch, {}, False)
interp._forth = is_forth
py = branch.array(interp, library="ak", entry_stop=2)
assert py[0]["1"][0]["name"] == "anti_alpha"
assert py[0, "1", 0, "name"] == "anti_alpha"
# py[-1] == <STLMap {-1000020040: <BDSOutputROOTGeant4Data::ParticleInfo (version 1) at 0x7fb557996df0>, ...} at 0x7fb557a012e0>
assert py.layout.form == interp.awkward_form(branch.file)

Expand Down Expand Up @@ -932,7 +932,7 @@ def test_78(is_forth):
interp = uproot.interpretation.identify.interpretation_of(branch, {}, False)
interp._forth = is_forth
py = branch.array(interp, library="ak", entry_stop=2)
assert py[1][1]["1"] == "TWO"
assert py[1, 1, "1"] == "TWO"
# py[-1] == <STLMap {'one': 'ONE', 'two': 'TWO'} at 0x7f887b27cb20>
assert py.layout.form == interp.awkward_form(branch.file)

Expand All @@ -944,7 +944,7 @@ def test_79(is_forth):
interp = uproot.interpretation.identify.interpretation_of(branch, {}, False)
interp._forth = is_forth
py = branch.array(interp, library="ak", entry_stop=2)
assert py[1][1]["1"] == "TWO"
assert py[1, 1, "1"] == "TWO"
# py[-1] == <STLMap {'one': 'ONE', 'two': 'TWO'} at 0x7f4c4e527610>
assert py.layout.form == interp.awkward_form(branch.file)

Expand Down

0 comments on commit 1bc01e7

Please sign in to comment.