Skip to content
Snippets Groups Projects
Verified Commit 18109d69 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Remove old awkward dependencies and require uproot 5+ and awkward 2+

parent a5c5443f
No related branches found
No related tags found
1 merge request!86Remove online support, uproot3 and update to awkward2 and uproot5
Pipeline #52867 failed
...@@ -37,10 +37,8 @@ packages = find: ...@@ -37,10 +37,8 @@ packages = find:
install_requires = install_requires =
docopt docopt
numba>=0.50 numba>=0.50
awkward>=1.9 awkward>=2
awkward0>=0.15.5 uproot>=5
uproot3>=3.11.1
uproot>=4.2.2
setuptools_scm setuptools_scm
python_requires = >=3.6 python_requires = >=3.6
include_package_data = True include_package_data = True
......
...@@ -307,41 +307,27 @@ def mask(arr, sequence=None, startend=None, minmax=None, atleast=None): ...@@ -307,41 +307,27 @@ def mask(arr, sequence=None, startend=None, minmax=None, atleast=None):
elif atleast is not None: elif atleast is not None:
np_array = _mask_atleast(ak.Array(layout), np.array(atleast)) np_array = _mask_atleast(ak.Array(layout), np.array(atleast))
return ak.layout.NumpyArray(np_array) return ak.contents.NumpyArray(np_array)
elif isinstance( elif isinstance(layout, ak.contents.ListArray):
layout,
(
ak.layout.ListArray32,
ak.layout.ListArrayU32,
ak.layout.ListArray64,
),
):
if len(layout.stops) == 0: if len(layout.stops) == 0:
content = recurse(layout.content) content = recurse(layout.content)
else: else:
content = recurse(layout.content[: np.max(layout.stops)]) content = recurse(layout.content[: np.max(layout.stops)])
return type(layout)(layout.starts, layout.stops, content) return type(layout)(layout.starts, layout.stops, content)
elif isinstance( elif isinstance(layout, ak.contents.ListOffsetArray):
layout,
(
ak.layout.ListOffsetArray32,
ak.layout.ListOffsetArrayU32,
ak.layout.ListOffsetArray64,
),
):
content = recurse(layout.content[: layout.offsets[-1]]) content = recurse(layout.content[: layout.offsets[-1]])
return type(layout)(layout.offsets, content) return type(layout)(layout.offsets, content)
elif isinstance(layout, ak.layout.RegularArray): elif isinstance(layout, ak.contents.RegularArray):
content = recurse(layout.content) content = recurse(layout.content)
return ak.layout.RegularArray(content, layout.size) return ak.contents.RegularArray(content, layout.size)
else: else:
raise NotImplementedError(repr(arr)) raise NotImplementedError(repr(arr))
layout = ak.to_layout(arr, allow_record=True, allow_other=False) layout = ak.to_layout(arr, allow_record=True)
return ak.Array(recurse(layout)) return ak.Array(recurse(layout))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment