legend-pydataobj 1.6.0__tar.gz → 1.6.2__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.6.0 → legend_pydataobj-1.6.2}/PKG-INFO +1 -1
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/PKG-INFO +1 -1
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/_version.py +2 -2
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/vector_of_vectors.py +6 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/write/array.py +1 -1
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/datatype.py +2 -2
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/table.py +9 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/conftest.py +1 -1
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/conftest.py +1 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/test_lh5_store.py +5 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_table_eval.py +5 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_vectorofvectors.py +11 -1
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/LICENSE +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/README.md +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/pyproject.toml +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/setup.cfg +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/SOURCES.txt +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/dependency_links.txt +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/entry_points.txt +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/not-zip-safe +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/requires.txt +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/top_level.txt +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/__init__.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/cli.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/compression/__init__.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/compression/base.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/compression/generic.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/compression/radware.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/compression/utils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/compression/varlen.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lgdo_utils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/__init__.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/__init__.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/__init__.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/array.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/composite.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/encoded.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/ndarray.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/scalar.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/utils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/write/__init__.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/write/composite.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/write/scalar.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/write/vector_of_vectors.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/core.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/exceptions.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/iterator.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/store.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/tools.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/utils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5_store.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/logging.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/__init__.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/array.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/arrayofequalsizedarrays.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/encoded.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/fixedsizearray.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/lgdo.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/scalar.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/struct.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/vectorofvectors.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/vovutils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/types/waveformtable.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/units.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/utils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/conftest.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/sigcompress/LDQTA_r117_20200110T105115Z_cal_geds_raw-0.dat +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/sigcompress/special-wf-clipped.dat +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/test_compression.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/test_radware_sigcompress.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/test_str2wfcodec.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/test_uleb128_zigzag_diff.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/test_core.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/test_lh5_datatype.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/test_lh5_iterator.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/test_lh5_tools.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/test_lh5_utils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/lh5/test_lh5_write.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/test_cli.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/test_lgdo_utils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_array.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_arrayofequalsizedarrays.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_encoded.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_fixedsizearray.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_representations.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_scalar.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_struct.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_table.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_vovutils.py +0 -0
- {legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/types/test_waveformtable.py +0 -0
@@ -168,6 +168,12 @@ def _h5_read_vector_of_vectors(
|
|
168
168
|
)
|
169
169
|
|
170
170
|
if obj_buf is not None:
|
171
|
+
# if the buffer is partially filled, cumulative_length will be invalid
|
172
|
+
# (i.e. non monotonically increasing). Let's fix that but filling the
|
173
|
+
# rest of the array with the length of flattened_data
|
174
|
+
end = obj_buf_start + n_rows_read
|
175
|
+
obj_buf.cumulative_length.nda[end:] = obj_buf.cumulative_length.nda[end - 1]
|
176
|
+
|
171
177
|
return obj_buf, n_rows_read
|
172
178
|
|
173
179
|
return (
|
@@ -10,7 +10,7 @@ from ...exceptions import LH5EncodeError
|
|
10
10
|
|
11
11
|
log = logging.getLogger(__name__)
|
12
12
|
|
13
|
-
DEFAULT_HDF5_SETTINGS: dict[str, ...] = {"shuffle": True, "compression": "
|
13
|
+
DEFAULT_HDF5_SETTINGS: dict[str, ...] = {"shuffle": True, "compression": "lzf"}
|
14
14
|
|
15
15
|
|
16
16
|
def _h5_write_array(
|
@@ -16,9 +16,9 @@ _lgdo_datatype_map: dict[str, lgdo.LGDO] = OrderedDict(
|
|
16
16
|
),
|
17
17
|
(lgdo.Struct, r"^struct\{.*\}$"),
|
18
18
|
(lgdo.Table, r"^table\{.*\}$"),
|
19
|
-
(lgdo.FixedSizeArray, r"^fixedsize_array
|
19
|
+
(lgdo.FixedSizeArray, r"^fixedsize_array<\d+>\{.+\}$"),
|
20
20
|
(lgdo.ArrayOfEqualSizedArrays, r"^array_of_equalsized_arrays<1,1>\{.+\}$"),
|
21
|
-
(lgdo.Array, r"^array
|
21
|
+
(lgdo.Array, r"^array<\d+>\{.+\}$"),
|
22
22
|
]
|
23
23
|
)
|
24
24
|
"""Mapping between LGDO types and regular expression defining the corresponding datatype string"""
|
@@ -327,6 +327,9 @@ class Table(Struct):
|
|
327
327
|
else:
|
328
328
|
self_unwrap[obj] = flat_self[obj].view_as("np", with_units=False)
|
329
329
|
|
330
|
+
msg = f"evaluating {expr!r} with locals={(self_unwrap | parameters)} and {has_ak=}"
|
331
|
+
log.debug(msg)
|
332
|
+
|
330
333
|
# use numexpr if we are only dealing with numpy data types
|
331
334
|
if not has_ak:
|
332
335
|
out_data = ne.evaluate(
|
@@ -334,6 +337,9 @@ class Table(Struct):
|
|
334
337
|
local_dict=(self_unwrap | parameters),
|
335
338
|
)
|
336
339
|
|
340
|
+
msg = f"...the result is {out_data!r}"
|
341
|
+
log.debug(msg)
|
342
|
+
|
337
343
|
# need to convert back to LGDO
|
338
344
|
# np.evaluate should always return a numpy thing?
|
339
345
|
if out_data.ndim == 0:
|
@@ -353,6 +359,9 @@ class Table(Struct):
|
|
353
359
|
globs = {"ak": ak, "np": np}
|
354
360
|
out_data = eval(expr, globs, (self_unwrap | parameters))
|
355
361
|
|
362
|
+
msg = f"...the result is {out_data!r}"
|
363
|
+
log.debug(msg)
|
364
|
+
|
356
365
|
# need to convert back to LGDO
|
357
366
|
if isinstance(out_data, ak.Array):
|
358
367
|
if out_data.ndim == 1:
|
@@ -19,6 +19,7 @@ def lh5_file(tmptestdir):
|
|
19
19
|
struct = lgdo.Struct()
|
20
20
|
struct.add_field("scalar", lgdo.Scalar(value=10, attrs={"sth": 1}))
|
21
21
|
struct.add_field("array", types.Array(nda=np.array([1, 2, 3, 4, 5])))
|
22
|
+
struct.add_field("array2d", types.Array(shape=(23, 56), fill_val=69, dtype=int))
|
22
23
|
struct.add_field(
|
23
24
|
"aoesa",
|
24
25
|
types.ArrayOfEqualSizedArrays(shape=(5, 5), dtype=np.float32, fill_val=42),
|
@@ -84,6 +84,10 @@ def test_read_array(lh5_file):
|
|
84
84
|
is DEFAULT_HDF5_SETTINGS["compression"]
|
85
85
|
)
|
86
86
|
|
87
|
+
lh5_obj, n_rows = store.read("/data/struct_full/array2d", lh5_file)
|
88
|
+
assert isinstance(lh5_obj, types.Array)
|
89
|
+
assert lh5_obj == types.Array(shape=(23, 56), fill_val=69, dtype=int)
|
90
|
+
|
87
91
|
|
88
92
|
def test_read_array_slice(lh5_file):
|
89
93
|
store = lh5.LH5Store()
|
@@ -351,6 +355,7 @@ def test_read_with_field_mask(lh5_file):
|
|
351
355
|
assert sorted(lh5_obj.keys()) == [
|
352
356
|
"aoesa",
|
353
357
|
"array",
|
358
|
+
"array2d",
|
354
359
|
"empty_struct",
|
355
360
|
"scalar",
|
356
361
|
"table",
|
@@ -22,6 +22,7 @@ def test_eval_dependency():
|
|
22
22
|
],
|
23
23
|
),
|
24
24
|
"e": lgdo.VectorOfVectors([[1, 2, 3], [4], [], [8, 6]]),
|
25
|
+
"ee": lgdo.VectorOfVectors([[[1], [2, 3]], [[], [4]], [[]], [[8, 6]]]),
|
25
26
|
"tbl": lgdo.Table(
|
26
27
|
col_dict={
|
27
28
|
"z": lgdo.Array([1, 1, 1, 1]),
|
@@ -60,6 +61,10 @@ def test_eval_dependency():
|
|
60
61
|
assert isinstance(r, lgdo.VectorOfVectors)
|
61
62
|
assert r == lgdo.VectorOfVectors([[3, 5, 7], [9], [], [17, 13]])
|
62
63
|
|
64
|
+
r = obj.eval("2*ee + 1")
|
65
|
+
assert isinstance(r, lgdo.VectorOfVectors)
|
66
|
+
assert r == lgdo.VectorOfVectors([[[3], [5, 7]], [[], [9]], [[]], [[17, 13]]])
|
67
|
+
|
63
68
|
r = obj.eval("e > 2")
|
64
69
|
assert isinstance(r, lgdo.VectorOfVectors)
|
65
70
|
assert r == lgdo.VectorOfVectors([[False, False, True], [True], [], [True, True]])
|
@@ -11,7 +11,7 @@ import pint
|
|
11
11
|
import pytest
|
12
12
|
|
13
13
|
import lgdo
|
14
|
-
from lgdo import Array, VectorOfVectors
|
14
|
+
from lgdo import Array, VectorOfVectors, lh5
|
15
15
|
|
16
16
|
VovColl = namedtuple("VovColl", ["v2d", "v3d", "v4d"])
|
17
17
|
|
@@ -414,3 +414,13 @@ def test_view_as(testvov):
|
|
414
414
|
assert ak.is_valid(ak_arr)
|
415
415
|
assert len(ak_arr) == len(v3d)
|
416
416
|
assert ak.all(ak_arr == [[[1, 2], [3, 4, 5]], [[2], [4, 8, 9, 7]], [[5, 3, 1]]])
|
417
|
+
|
418
|
+
|
419
|
+
def test_lh5_iterator_view_as(lgnd_test_data):
|
420
|
+
it = lh5.LH5Iterator(
|
421
|
+
lgnd_test_data.get_path("lh5/l200-p03-r000-phy-20230312T055349Z-tier_psp.lh5"),
|
422
|
+
"ch1067205/dsp/energies",
|
423
|
+
)
|
424
|
+
|
425
|
+
for obj, _, _ in it:
|
426
|
+
assert ak.is_valid(obj.view_as("ak"))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/dependency_links.txt
RENAMED
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/entry_points.txt
RENAMED
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/not-zip-safe
RENAMED
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/legend_pydataobj.egg-info/requires.txt
RENAMED
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/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.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/__init__.py
RENAMED
File without changes
|
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/read/composite.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/src/lgdo/lh5/_serializers/write/__init__.py
RENAMED
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/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
|
File without changes
|
File without changes
|
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/tests/compression/test_radware_sigcompress.py
RENAMED
File without changes
|
File without changes
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/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
|
{legend_pydataobj-1.6.0 → legend_pydataobj-1.6.2}/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
|