legend-pydataobj 1.11.3__tar.gz → 1.11.5__tar.gz
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.
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/PKG-INFO +1 -1
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/PKG-INFO +1 -1
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/_version.py +2 -2
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/array.py +5 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/vectorofvectors.py +15 -8
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_lh5_write.py +13 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/LICENSE +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/README.md +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/pyproject.toml +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/setup.cfg +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/SOURCES.txt +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/dependency_links.txt +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/entry_points.txt +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/not-zip-safe +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/requires.txt +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/top_level.txt +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/__init__.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/cli.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/compression/__init__.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/compression/base.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/compression/generic.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/compression/radware.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/compression/utils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/compression/varlen.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lgdo_utils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/__init__.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/__init__.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/__init__.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/array.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/composite.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/encoded.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/ndarray.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/scalar.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/utils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/vector_of_vectors.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/__init__.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/composite.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/scalar.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/vector_of_vectors.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/core.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/datatype.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/exceptions.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/iterator.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/store.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/tools.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/utils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5_store.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/logging.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/__init__.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/array.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/arrayofequalsizedarrays.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/encoded.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/fixedsizearray.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/histogram.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/lgdo.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/scalar.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/struct.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/table.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/vovutils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/waveformtable.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/units.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/utils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/conftest.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/sigcompress/LDQTA_r117_20200110T105115Z_cal_geds_raw-0.dat +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/sigcompress/special-wf-clipped.dat +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/test_compression.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/test_radware_sigcompress.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/test_str2wfcodec.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/test_uleb128_zigzag_diff.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/conftest.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/conftest.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_core.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_exceptions.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_lh5_datatype.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_lh5_iterator.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_lh5_store.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_lh5_tools.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/lh5/test_lh5_utils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/test_cli.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/test_lgdo_utils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_array.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_arrayofequalsizedarrays.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_encoded.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_fixedsizearray.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_histogram.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_representations.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_scalar.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_struct.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_table.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_table_eval.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_vectorofvectors.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_vovutils.py +0 -0
- {legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_waveformtable.py +0 -0
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/array.py
RENAMED
@@ -64,6 +64,11 @@ def _h5_write_array(
|
|
64
64
|
if "hdf5_settings" in obj.attrs:
|
65
65
|
h5py_kwargs |= obj.attrs["hdf5_settings"]
|
66
66
|
|
67
|
+
# HACK: a tuple is strictly requested for the "chunks" setting, but
|
68
|
+
# we'd like to pass a list too in some situations
|
69
|
+
if "chunks" in h5py_kwargs and isinstance(h5py_kwargs["chunks"], list):
|
70
|
+
h5py_kwargs["chunks"] = tuple(h5py_kwargs["chunks"])
|
71
|
+
|
67
72
|
# create HDF5 dataset
|
68
73
|
ds = group.create_dataset(name, data=nda, **h5py_kwargs)
|
69
74
|
|
@@ -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
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
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
|
@@ -44,6 +44,19 @@ def test_write_with_hdf5_compression(lgnd_file, tmptestdir):
|
|
44
44
|
assert h5f["/geds/raw/waveform/values"].compression is None
|
45
45
|
assert h5f["/geds/raw/waveform/values"].shuffle is False
|
46
46
|
|
47
|
+
store.write(
|
48
|
+
wft.values,
|
49
|
+
"/geds/raw/waveform/values",
|
50
|
+
f"{tmptestdir}/tmp-pygama-hdf5-compressed-wfs.lh5",
|
51
|
+
wo_mode="overwrite_file",
|
52
|
+
chunks=[1, 10],
|
53
|
+
compression=None,
|
54
|
+
shuffle=False,
|
55
|
+
)
|
56
|
+
with h5py.File(f"{tmptestdir}/tmp-pygama-hdf5-compressed-wfs.lh5") as h5f:
|
57
|
+
assert h5f["/geds/raw/waveform/values"].compression is None
|
58
|
+
assert h5f["/geds/raw/waveform/values"].shuffle is False
|
59
|
+
|
47
60
|
|
48
61
|
def test_write_empty_vov(tmptestdir):
|
49
62
|
vov = types.VectorOfVectors(flattened_data=[], cumulative_length=[])
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/entry_points.txt
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/not-zip-safe
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/requires.txt
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/legend_pydataobj.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/__init__.py
RENAMED
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/composite.py
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/encoded.py
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/ndarray.py
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/read/scalar.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/__init__.py
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/composite.py
RENAMED
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/lh5/_serializers/write/scalar.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/src/lgdo/types/arrayofequalsizedarrays.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/test_radware_sigcompress.py
RENAMED
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/compression/test_uleb128_zigzag_diff.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.11.3 → legend_pydataobj-1.11.5}/tests/types/test_arrayofequalsizedarrays.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|