legend-pydataobj 1.7.0__tar.gz → 1.7.1__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.7.0 → legend_pydataobj-1.7.1}/PKG-INFO +2 -2
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/pyproject.toml +1 -1
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/PKG-INFO +2 -2
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/requires.txt +1 -1
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/_version.py +2 -2
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/composite.py +3 -3
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/write/vector_of_vectors.py +24 -5
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/tools.py +15 -2
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/fixedsizearray.py +1 -1
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/vectorofvectors.py +1 -1
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/units.py +1 -1
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/test_uleb128_zigzag_diff.py +1 -1
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/LICENSE +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/README.md +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/setup.cfg +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/SOURCES.txt +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/dependency_links.txt +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/entry_points.txt +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/not-zip-safe +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/top_level.txt +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/__init__.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/cli.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/compression/__init__.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/compression/base.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/compression/generic.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/compression/radware.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/compression/utils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/compression/varlen.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lgdo_utils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/__init__.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/__init__.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/__init__.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/array.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/encoded.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/ndarray.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/scalar.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/utils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/vector_of_vectors.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/write/__init__.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/write/array.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/write/composite.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/write/scalar.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/core.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/datatype.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/exceptions.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/iterator.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/store.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/utils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5_store.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/logging.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/__init__.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/array.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/arrayofequalsizedarrays.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/encoded.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/lgdo.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/scalar.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/struct.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/table.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/vovutils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/types/waveformtable.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/utils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/conftest.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/sigcompress/LDQTA_r117_20200110T105115Z_cal_geds_raw-0.dat +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/sigcompress/special-wf-clipped.dat +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/test_compression.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/test_radware_sigcompress.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/test_str2wfcodec.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/conftest.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/conftest.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/test_core.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/test_lh5_datatype.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/test_lh5_iterator.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/test_lh5_store.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/test_lh5_tools.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/test_lh5_utils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/lh5/test_lh5_write.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/test_cli.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/test_lgdo_utils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_array.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_arrayofequalsizedarrays.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_encoded.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_fixedsizearray.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_representations.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_scalar.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_struct.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_table.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_table_eval.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_vectorofvectors.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_vovutils.py +0 -0
- {legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/types/test_waveformtable.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: legend_pydataobj
|
3
|
-
Version: 1.7.
|
3
|
+
Version: 1.7.1
|
4
4
|
Summary: LEGEND Python Data Objects
|
5
5
|
Author: The LEGEND Collaboration
|
6
6
|
Maintainer: The LEGEND Collaboration
|
@@ -707,7 +707,7 @@ Requires-Dist: numexpr
|
|
707
707
|
Requires-Dist: numpy>=1.21
|
708
708
|
Requires-Dist: pandas>=1.4.4
|
709
709
|
Requires-Dist: parse
|
710
|
-
Requires-Dist: pint
|
710
|
+
Requires-Dist: pint!=0.24
|
711
711
|
Requires-Dist: pint-pandas
|
712
712
|
Provides-Extra: all
|
713
713
|
Requires-Dist: legend-pydataobj[docs,test]; extra == "all"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: legend_pydataobj
|
3
|
-
Version: 1.7.
|
3
|
+
Version: 1.7.1
|
4
4
|
Summary: LEGEND Python Data Objects
|
5
5
|
Author: The LEGEND Collaboration
|
6
6
|
Maintainer: The LEGEND Collaboration
|
@@ -707,7 +707,7 @@ Requires-Dist: numexpr
|
|
707
707
|
Requires-Dist: numpy>=1.21
|
708
708
|
Requires-Dist: pandas>=1.4.4
|
709
709
|
Requires-Dist: parse
|
710
|
-
Requires-Dist: pint
|
710
|
+
Requires-Dist: pint!=0.24
|
711
711
|
Requires-Dist: pint-pandas
|
712
712
|
Provides-Extra: all
|
713
713
|
Requires-Dist: legend-pydataobj[docs,test]; extra == "all"
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/composite.py
RENAMED
@@ -56,7 +56,7 @@ def _h5_read_lgdo(
|
|
56
56
|
lh5_file = list(h5f)
|
57
57
|
n_rows_read = 0
|
58
58
|
|
59
|
-
for i,
|
59
|
+
for i, _h5f in enumerate(lh5_file):
|
60
60
|
if isinstance(idx, list) and len(idx) > 0 and not np.isscalar(idx[0]):
|
61
61
|
# a list of lists: must be one per file
|
62
62
|
idx_i = idx[i]
|
@@ -65,7 +65,7 @@ def _h5_read_lgdo(
|
|
65
65
|
if not (isinstance(idx, tuple) and len(idx) == 1):
|
66
66
|
idx = (idx,)
|
67
67
|
# idx is a long continuous array
|
68
|
-
n_rows_i = read_n_rows(name,
|
68
|
+
n_rows_i = read_n_rows(name, _h5f)
|
69
69
|
# find the length of the subset of idx that contains indices
|
70
70
|
# that are less than n_rows_i
|
71
71
|
n_rows_to_read_i = bisect.bisect_left(idx[0], n_rows_i)
|
@@ -78,7 +78,7 @@ def _h5_read_lgdo(
|
|
78
78
|
|
79
79
|
obj_buf, n_rows_read_i = _h5_read_lgdo(
|
80
80
|
name,
|
81
|
-
|
81
|
+
_h5f,
|
82
82
|
start_row=start_row,
|
83
83
|
n_rows=n_rows_i,
|
84
84
|
idx=idx_i,
|
@@ -2,6 +2,8 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import logging
|
4
4
|
|
5
|
+
import numpy as np
|
6
|
+
|
5
7
|
from .... import types
|
6
8
|
from ... import utils
|
7
9
|
from ...exceptions import LH5EncodeError
|
@@ -31,12 +33,15 @@ def _h5_write_vector_of_vectors(
|
|
31
33
|
|
32
34
|
# if appending we need to add an appropriate offset to the
|
33
35
|
# cumulative lengths as appropriate for the in-file object
|
34
|
-
|
36
|
+
# declare here because we have to subtract it off at the end
|
37
|
+
offset = np.int64(0)
|
35
38
|
if (wo_mode in ("a", "o")) and "cumulative_length" in group:
|
36
39
|
len_cl = len(group["cumulative_length"])
|
40
|
+
# if append, ignore write_start and set it to total number of vectors
|
37
41
|
if wo_mode == "a":
|
38
42
|
write_start = len_cl
|
39
43
|
if len_cl > 0:
|
44
|
+
# set offset to correct number of elements in flattened_data until write_start
|
40
45
|
offset = group["cumulative_length"][write_start - 1]
|
41
46
|
|
42
47
|
# First write flattened_data array. Only write rows with data.
|
@@ -71,15 +76,23 @@ def _h5_write_vector_of_vectors(
|
|
71
76
|
)
|
72
77
|
|
73
78
|
# now offset is used to give appropriate in-file values for
|
74
|
-
# cumulative_length. Need to adjust it for start_row
|
79
|
+
# cumulative_length. Need to adjust it for start_row, if different from zero
|
75
80
|
if start_row > 0:
|
76
81
|
offset -= obj.cumulative_length.nda[start_row - 1]
|
77
82
|
|
78
83
|
# Add offset to obj.cumulative_length itself to avoid memory allocation.
|
79
84
|
# Then subtract it off after writing! (otherwise it will be changed
|
80
85
|
# upon return)
|
81
|
-
|
82
|
-
|
86
|
+
|
87
|
+
# NOTE: this operation is not numerically safe (uint overflow in the lower
|
88
|
+
# part of the array), but this is not a problem because those values are
|
89
|
+
# not written to disk and we are going to restore the offset at the end
|
90
|
+
np.add(
|
91
|
+
obj.cumulative_length.nda,
|
92
|
+
offset,
|
93
|
+
out=obj.cumulative_length.nda,
|
94
|
+
casting="unsafe",
|
95
|
+
)
|
83
96
|
|
84
97
|
_h5_write_array(
|
85
98
|
obj.cumulative_length,
|
@@ -92,4 +105,10 @@ def _h5_write_vector_of_vectors(
|
|
92
105
|
write_start=write_start,
|
93
106
|
**h5py_kwargs,
|
94
107
|
)
|
95
|
-
|
108
|
+
|
109
|
+
np.subtract(
|
110
|
+
obj.cumulative_length.nda,
|
111
|
+
offset,
|
112
|
+
out=obj.cumulative_length.nda,
|
113
|
+
casting="unsafe",
|
114
|
+
)
|
@@ -188,7 +188,20 @@ def show(
|
|
188
188
|
else:
|
189
189
|
toprint += f", \033[3mnumchunks\033[0m={val.id.get_num_chunks()}"
|
190
190
|
toprint += f", \033[3mchunkshape\033[0m={chunkshape}"
|
191
|
-
toprint +=
|
191
|
+
toprint += ", \033[3mfilters\033[0m="
|
192
|
+
|
193
|
+
numfilters = val.id.get_create_plist().get_nfilters()
|
194
|
+
if numfilters == 0:
|
195
|
+
toprint += "None"
|
196
|
+
else:
|
197
|
+
toprint += "("
|
198
|
+
for i in range(numfilters):
|
199
|
+
thisfilter = val.id.get_create_plist().get_filter(i)[3].decode()
|
200
|
+
if "lz4" in thisfilter:
|
201
|
+
thisfilter = "lz4"
|
202
|
+
toprint += f"{thisfilter},"
|
203
|
+
toprint += ")"
|
204
|
+
|
192
205
|
except TypeError:
|
193
206
|
toprint += "(scalar)"
|
194
207
|
|
@@ -268,7 +281,7 @@ def load_nda(
|
|
268
281
|
f = sto.gimme_file(ff, "r")
|
269
282
|
for par in par_list:
|
270
283
|
if f"{lh5_group}/{par}" not in f:
|
271
|
-
msg = f"'{lh5_group}/{par}' not in file {
|
284
|
+
msg = f"'{lh5_group}/{par}' not in file {ff}"
|
272
285
|
raise RuntimeError(msg)
|
273
286
|
|
274
287
|
if idx_list is None:
|
@@ -480,7 +480,7 @@ class VectorOfVectors(LGDO):
|
|
480
480
|
lens = np.array([lens], dtype="u4")
|
481
481
|
|
482
482
|
# calculate stop index in flattened_data
|
483
|
-
cum_lens = start
|
483
|
+
cum_lens = np.add(start, lens.cumsum(), dtype=int)
|
484
484
|
|
485
485
|
# fill with fast vectorized routine
|
486
486
|
vovutils._nb_fill(vec, lens, self.flattened_data.nda[start : cum_lens[-1]])
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/tests/compression/test_uleb128_zigzag_diff.py
RENAMED
@@ -68,7 +68,7 @@ def test_uleb128zzdiff_encode_decode_equality():
|
|
68
68
|
pos = varlen.uleb128_encode(varlen.zigzag_encode(int(s) - last), encx)
|
69
69
|
assert np.array_equal(sig_out[offset : offset + pos], encx[:pos])
|
70
70
|
offset += pos
|
71
|
-
last = s
|
71
|
+
last = int(s)
|
72
72
|
|
73
73
|
sig_in_dec = np.empty(100, dtype="uint32")
|
74
74
|
siglen = np.empty(1, dtype="uint32")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/dependency_links.txt
RENAMED
File without changes
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/entry_points.txt
RENAMED
File without changes
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/legend_pydataobj.egg-info/not-zip-safe
RENAMED
File without changes
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/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.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/read/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/write/__init__.py
RENAMED
File without changes
|
File without changes
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/src/lgdo/lh5/_serializers/write/composite.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
|
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.7.0 → legend_pydataobj-1.7.1}/tests/compression/test_radware_sigcompress.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
|
{legend_pydataobj-1.7.0 → legend_pydataobj-1.7.1}/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
|