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
Tags v1.2.3
1 merge request!86Remove online support, uproot3 and update to awkward2 and uproot5
Pipeline #52867 failed
......@@ -37,10 +37,8 @@ packages = find:
install_requires =
docopt
numba>=0.50
awkward>=1.9
awkward0>=0.15.5
uproot3>=3.11.1
uproot>=4.2.2
awkward>=2
uproot>=5
setuptools_scm
python_requires = >=3.6
include_package_data = True
......
......@@ -307,41 +307,27 @@ def mask(arr, sequence=None, startend=None, minmax=None, atleast=None):
elif atleast is not None:
np_array = _mask_atleast(ak.Array(layout), np.array(atleast))
return ak.layout.NumpyArray(np_array)
elif isinstance(
layout,
(
ak.layout.ListArray32,
ak.layout.ListArrayU32,
ak.layout.ListArray64,
),
):
return ak.contents.NumpyArray(np_array)
elif isinstance(layout, ak.contents.ListArray):
if len(layout.stops) == 0:
content = recurse(layout.content)
else:
content = recurse(layout.content[: np.max(layout.stops)])
return type(layout)(layout.starts, layout.stops, content)
elif isinstance(
layout,
(
ak.layout.ListOffsetArray32,
ak.layout.ListOffsetArrayU32,
ak.layout.ListOffsetArray64,
),
):
elif isinstance(layout, ak.contents.ListOffsetArray):
content = recurse(layout.content[: layout.offsets[-1]])
return type(layout)(layout.offsets, content)
elif isinstance(layout, ak.layout.RegularArray):
elif isinstance(layout, ak.contents.RegularArray):
content = recurse(layout.content)
return ak.layout.RegularArray(content, layout.size)
return ak.contents.RegularArray(content, layout.size)
else:
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))
......
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