You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue with writing the ntuple from the jagged array which was read in from another ntuple created by uproot:
importuprootdata=uproot.concatenate("data.root", library="ak")
print(data.fields)
# data has two keys, in this case 'nLc_MCP_PseudoTypes' and 'Lc_MCP_PseudoTypes'. withuproot.recreate("data2.root", compression=uproot.ZLIB(4)) asfile :
input= {k : data[k] forkindata.fields}
file["tree"] =input
This results in the following crash:
Traceback (most recent call last):
File "mre.py", line 9, in <module>
file["tree"] = input
~~~~^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/uproot/writing/writable.py", line 984, in __setitem__
self.update({where: what})
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/uproot/writing/writable.py", line 1553, in update
uproot.writing.identify.add_to_directory(v, name, directory, streamers)
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/uproot/writing/identify.py", line 152, in add_to_directory
tree.extend(data)
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/uproot/writing/writable.py", line 1832, in extend
self._cascading.extend(self._file, self._file.sink, data)
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/uproot/writing/_cascadetree.py", line 588, in extend
if kk in provided and not numpy.array_equal(vv, provided[kk]):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/highlevel.py", line 1527, in __array_function__
return ak._connect.numpy.array_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/_connect/numpy.py", line 102, in array_function
return function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/_connect/numpy.py", line 142, in ensure_valid_args
return function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/_dispatch.py", line 64, in dispatch
next(gen_or_result)
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/operations/ak_array_equal.py", line 44, in array_equal
return ak.operations.ak_almost_equal._impl(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/operations/ak_almost_equal.py", line 87, in _impl
to_layout(left, allow_record=False),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/_dispatch.py", line 64, in dispatch
next(gen_or_result)
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/operations/ak_to_layout.py", line 80, in to_layout
return _impl(
^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/operations/ak_to_layout.py", line 177, in _impl
promoted_layout = ak.operations.from_numpy(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/_dispatch.py", line 39, in dispatch
gen_or_result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/operations/ak_from_numpy.py", line 56, in from_numpy
from_arraylib(
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/_layout.py", line 364, in from_arraylib
layout = recurse(array, mask)
^^^^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/_layout.py", line 323, in recurse
data = NumpyArray(array)
^^^^^^^^^^^^^^^^^
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/contents/numpyarray.py", line 123, in __init__
ak.types.numpytype.dtype_to_primitive(self._data.dtype)
File "/cvmfs/lhcbdev.cern.ch/conda/envs/pidgen/2024-10-15_18-48/linux-64/lib/python3.12/site-packages/awkward/types/numpytype.py", line 51, in dtype_to_primitive
raise TypeError(
TypeError: unsupported dtype: dtype('>u4'). Must be one of
bool, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, complex64, complex128, datetime64, timedelta64, float16, float128, complex256
or a datetime64/timedelta64 with units (e.g. 'datetime64[15us]')
This error occurred while calling
ak.array_equal(
numpy.ndarray([4 4 4 ... 4 4 4])
<Array [4, 4, 4, 4, 4, 4, 4, 4, 4, 4] type='10 * int32'>
)
uproot version is 5.4.1. data.root is attached. Thanks! data.root.txt
The text was updated successfully, but these errors were encountered:
jpivarski
added
bug
The problem described is something that must be fixed
and removed
bug (unverified)
The problem described would be a bug, but needs to be triaged
labels
Oct 20, 2024
Hello,
I have an issue with writing the ntuple from the jagged array which was read in from another ntuple created by uproot:
This results in the following crash:
uproot version is 5.4.1.
data.root
is attached. Thanks!data.root.txt
The text was updated successfully, but these errors were encountered: