legend-pydataobj 1.11.4__py3-none-any.whl → 1.11.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: legend_pydataobj
3
- Version: 1.11.4
3
+ Version: 1.11.5
4
4
  Summary: LEGEND Python Data Objects
5
5
  Author: The LEGEND Collaboration
6
6
  Maintainer: The LEGEND Collaboration
@@ -1,5 +1,5 @@
1
1
  lgdo/__init__.py,sha256=QMYK9HhoMi0pbahPN8mPD18gyTxscFgo7QKfCxVhy-0,3196
2
- lgdo/_version.py,sha256=HWJG1mSaFw4DCdt_m-eZM_w2WWWPxNfIBTM4o6ooSY4,413
2
+ lgdo/_version.py,sha256=DTx-xWFNqQz9P95loDaKgAV4WuiaQCg5aAro9mWfGoA,413
3
3
  lgdo/cli.py,sha256=Qm2EPmoIVxENAR8BeW7oWpTdHT4GbV-owfzM5NkgjvM,9353
4
4
  lgdo/lgdo_utils.py,sha256=6a2YWEwpyEMXlAyTHZMO01aqxy6SxJzPZkGNWKNWuS0,2567
5
5
  lgdo/lh5_store.py,sha256=5BzbJA9sLcqjp8bJDc2olwOiw0VS6rmfg3cfh1kQkRY,8512
@@ -44,12 +44,12 @@ lgdo/types/lgdo.py,sha256=RQ2P70N7IWMBDnLLuJI3sm6zQTIKyOMSsKZtBNzmE90,2928
44
44
  lgdo/types/scalar.py,sha256=c5Es2vyDqyWTPV6mujzfIzMpC1jNWkEIcvYyWQUxH3Q,1933
45
45
  lgdo/types/struct.py,sha256=Q0OWLVd4B0ciLb8t6VsxU3MPbmGLZ7WfQNno1lSQS0Q,4918
46
46
  lgdo/types/table.py,sha256=KPxKeLKqKQPkC_H75XraW0c1KRAhDdyGKBktVkD-KLw,18779
47
- lgdo/types/vectorofvectors.py,sha256=cic9PsZ5EptQ6RMsykYeVHA8T7fh_KBZCcqeTP4i1wU,24395
47
+ lgdo/types/vectorofvectors.py,sha256=Al9FmY44M-vnzhPdQlFOzwm06LNGBI7RSLSdU5pl9us,24663
48
48
  lgdo/types/vovutils.py,sha256=7BWPP0BSj-92ifbCIUBcfqxG5-TS8uxujTyJJuDFI04,10302
49
49
  lgdo/types/waveformtable.py,sha256=f2tS4f1OEoYaTM5ldCX9zmw8iSISCT3t3wS1SrPdu_o,9901
50
- legend_pydataobj-1.11.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
51
- legend_pydataobj-1.11.4.dist-info/METADATA,sha256=eFdjaZ_ZZwYY6FM59zms2_pk7ohLMQKFOqAhkKN2tCM,44382
52
- legend_pydataobj-1.11.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
53
- legend_pydataobj-1.11.4.dist-info/entry_points.txt,sha256=Uu5MTlppBZxB4QGlLv-oX8FqACWjAZDNii__TBDJwLQ,72
54
- legend_pydataobj-1.11.4.dist-info/top_level.txt,sha256=KyR-EUloqiXcQ62IWnzBmtInDtvsHl4q2ZJAZgTcLXE,5
55
- legend_pydataobj-1.11.4.dist-info/RECORD,,
50
+ legend_pydataobj-1.11.5.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
51
+ legend_pydataobj-1.11.5.dist-info/METADATA,sha256=fV8jiU0IVhLxZWz9r6MdH1v53yEecRwaWlF8jN5zxxc,44382
52
+ legend_pydataobj-1.11.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
53
+ legend_pydataobj-1.11.5.dist-info/entry_points.txt,sha256=Uu5MTlppBZxB4QGlLv-oX8FqACWjAZDNii__TBDJwLQ,72
54
+ legend_pydataobj-1.11.5.dist-info/top_level.txt,sha256=KyR-EUloqiXcQ62IWnzBmtInDtvsHl4q2ZJAZgTcLXE,5
55
+ legend_pydataobj-1.11.5.dist-info/RECORD,,
lgdo/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '1.11.4'
16
- __version_tuple__ = version_tuple = (1, 11, 4)
15
+ __version__ = version = '1.11.5'
16
+ __version_tuple__ = version_tuple = (1, 11, 5)
@@ -13,6 +13,7 @@ import awkward as ak
13
13
  import awkward_pandas as akpd
14
14
  import numpy as np
15
15
  import pandas as pd
16
+ from numba import jit
16
17
  from numpy.typing import ArrayLike, DTypeLike, NDArray
17
18
 
18
19
  from .. import utils
@@ -560,18 +561,16 @@ class VectorOfVectors(LGDO):
560
561
  compatible one.
561
562
  """
562
563
  if self.ndim == 2:
563
- ak_arr = self.view_as("ak")
564
-
565
564
  if max_len is None:
566
- max_len = int(ak.max(ak.count(ak_arr, axis=-1)))
567
-
568
- nda = ak.fill_none(
569
- ak.pad_none(ak_arr, max_len, clip=True), fill_val
570
- ).to_numpy(allow_missing=False)
571
-
565
+ lens = np.copy(self.cumulative_length)
566
+ lens[1:] = lens[1:] - lens[:-1]
567
+ max_len = int(np.max(lens))
568
+ nda = np.full((len(self), max_len), fill_val)
572
569
  if preserve_dtype:
573
570
  nda = nda.astype(self.flattened_data.dtype, copy=False)
574
571
 
572
+ _to_aoesa(self.flattened_data.nda, self.cumulative_length.nda, nda)
573
+
575
574
  return aoesa.ArrayOfEqualSizedArrays(nda=nda, attrs=self.getattrs())
576
575
 
577
576
  raise NotImplementedError
@@ -664,3 +663,11 @@ class VectorOfVectors(LGDO):
664
663
 
665
664
  msg = f"{library} is not a supported third-party format."
666
665
  raise ValueError(msg)
666
+
667
+
668
+ @jit
669
+ def _to_aoesa(flattened_array, cumulative_length, nda):
670
+ prev_cl = 0
671
+ for i, cl in enumerate(cumulative_length):
672
+ nda[i, : (cl - prev_cl)] = flattened_array[prev_cl:cl]
673
+ prev_cl = cl