legend-pydataobj 1.11.2__py3-none-any.whl → 1.11.3__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.
- {legend_pydataobj-1.11.2.dist-info → legend_pydataobj-1.11.3.dist-info}/METADATA +2 -2
- {legend_pydataobj-1.11.2.dist-info → legend_pydataobj-1.11.3.dist-info}/RECORD +16 -16
- {legend_pydataobj-1.11.2.dist-info → legend_pydataobj-1.11.3.dist-info}/WHEEL +1 -1
- lgdo/__init__.py +6 -6
- lgdo/_version.py +2 -2
- lgdo/compression/__init__.py +3 -3
- lgdo/lh5/__init__.py +2 -2
- lgdo/lh5/_serializers/__init__.py +10 -10
- lgdo/lh5/exceptions.py +6 -0
- lgdo/types/__init__.py +3 -3
- lgdo/types/histogram.py +8 -3
- lgdo/types/lgdo.py +6 -0
- lgdo/types/table.py +6 -0
- {legend_pydataobj-1.11.2.dist-info → legend_pydataobj-1.11.3.dist-info}/LICENSE +0 -0
- {legend_pydataobj-1.11.2.dist-info → legend_pydataobj-1.11.3.dist-info}/entry_points.txt +0 -0
- {legend_pydataobj-1.11.2.dist-info → legend_pydataobj-1.11.3.dist-info}/top_level.txt +0 -0
@@ -1,26 +1,26 @@
|
|
1
|
-
lgdo/__init__.py,sha256=
|
2
|
-
lgdo/_version.py,sha256=
|
1
|
+
lgdo/__init__.py,sha256=QMYK9HhoMi0pbahPN8mPD18gyTxscFgo7QKfCxVhy-0,3196
|
2
|
+
lgdo/_version.py,sha256=T2YM9w8KO8zThn0UoO-QJVXyTdR0uuWyR6VszamBivY,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
|
6
6
|
lgdo/logging.py,sha256=82wIOj7l7xr3WYyeHdpSXbbjzHJsy-uRyKYUYx2vMfQ,1003
|
7
7
|
lgdo/units.py,sha256=VQYME86_ev9S7Fq8RyCOQNqYr29MphTTYemmEouZafk,161
|
8
8
|
lgdo/utils.py,sha256=WRTmXnaQ-h2hVxwJ27qiOigdsD3DHcaDrdDjvupCuZU,3940
|
9
|
-
lgdo/compression/__init__.py,sha256=
|
9
|
+
lgdo/compression/__init__.py,sha256=xHt_8Th0LxxNwj9iYHf5uGNTm3A_4qyW7zEVdAX3NwI,1127
|
10
10
|
lgdo/compression/base.py,sha256=82cQJujfvoAOKBFx761dEcx_xM02TBCBBuBo6i78tuI,838
|
11
11
|
lgdo/compression/generic.py,sha256=tF3UhLJbUDcovLxpIzgQRxFSjZ5Fz3uDRy9kI4mFntQ,2515
|
12
12
|
lgdo/compression/radware.py,sha256=GcNTtjuyL7VBBqziUBmSqNXuhqy1bJJgvcyvyumPtrc,23839
|
13
13
|
lgdo/compression/utils.py,sha256=W2RkBrxPpXlat84dnU9Ad7d_tTws0irtGl7O1dNWjnk,1140
|
14
14
|
lgdo/compression/varlen.py,sha256=6ZZUItyoOfygDdE0DyoISeFZfqdbH6xl7T0eclfarzg,15127
|
15
|
-
lgdo/lh5/__init__.py,sha256=
|
15
|
+
lgdo/lh5/__init__.py,sha256=FflSA1LF3RTom1YvlGmTleJcl1ytxwez8B_Hn_o10wU,811
|
16
16
|
lgdo/lh5/core.py,sha256=__-A6Abctzfwfo4-xJi68xs2e4vfzONEQTJVrUCOw-I,13922
|
17
17
|
lgdo/lh5/datatype.py,sha256=O_7BqOlX8PFMyG0ppkfUT5aps5HEqX0bpuKcJO3jhu0,1691
|
18
|
-
lgdo/lh5/exceptions.py,sha256=
|
18
|
+
lgdo/lh5/exceptions.py,sha256=3kj8avXl4eBGvebl3LG12gJEmw91W0T8PYR0AfvUAyM,1211
|
19
19
|
lgdo/lh5/iterator.py,sha256=ZaBBnmuNIjinwO0JUY55wLxX8Om9rVRRzXBC5uHmSKM,19772
|
20
20
|
lgdo/lh5/store.py,sha256=3wAaQDd1Zmo0_bQ9DbB-FbKS4Uy_Tb642qKHXtZpSw4,10643
|
21
21
|
lgdo/lh5/tools.py,sha256=T9CgHA8A3_tVBMtiNJ6hATQKhdqI61m3cX4p2wGKc6c,9937
|
22
22
|
lgdo/lh5/utils.py,sha256=ioz8DlyXZsejwnU2qYdIccdHcF12H62jgLkZsiDOLSM,6243
|
23
|
-
lgdo/lh5/_serializers/__init__.py,sha256=
|
23
|
+
lgdo/lh5/_serializers/__init__.py,sha256=eZzxMp1SeZWG0PkEXUiCz3XyprQ8EmelHUmJogC8xYE,1263
|
24
24
|
lgdo/lh5/_serializers/read/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
lgdo/lh5/_serializers/read/array.py,sha256=uWfMCihfAmW2DE2ewip2qCK_kvQC_mb2zvOv26uzijc,1000
|
26
26
|
lgdo/lh5/_serializers/read/composite.py,sha256=yTm5dfTgkIL7eG9iZXxhdiRhG04cQLd_hybP4wmxCJE,11809
|
@@ -34,22 +34,22 @@ lgdo/lh5/_serializers/write/array.py,sha256=eyVPwwddVOR9TNNyliCNYlS-XYXsdTEA8QoT
|
|
34
34
|
lgdo/lh5/_serializers/write/composite.py,sha256=I6lH0nWFIpAfZyG4-0rLxzg3mfazZ_FEhQVp1FZ0aA4,9254
|
35
35
|
lgdo/lh5/_serializers/write/scalar.py,sha256=JPt_fcdTKOSFp5hfJdcKIfK4hxhcD8vhOlvDF-7btQ8,763
|
36
36
|
lgdo/lh5/_serializers/write/vector_of_vectors.py,sha256=puGQX9XF5P_5DVbm_Cc6TvPrsDywgBLSYtkqFNltbB4,3493
|
37
|
-
lgdo/types/__init__.py,sha256=
|
37
|
+
lgdo/types/__init__.py,sha256=DNfOErPiAZg-7Gygkp6ZKAi20Yrm1mfderZHvKo1Y4s,821
|
38
38
|
lgdo/types/array.py,sha256=sUxh1CNCaefrnybt5qdjmmMpVQa_RqFxUv1tJ_pyBbc,6537
|
39
39
|
lgdo/types/arrayofequalsizedarrays.py,sha256=DOGJiTmc1QCdm7vLbE6uIRXoMPtt8uuCfmwQawgWf5s,4949
|
40
40
|
lgdo/types/encoded.py,sha256=JW4U5ow7KLMzhKnmhdnxbC3SZJAs4bOEDZWKG4KY1uU,15293
|
41
41
|
lgdo/types/fixedsizearray.py,sha256=7RjUwTz1bW0pcrdy27JlfrXPAuOU89Kj7pOuSUCojK8,1527
|
42
|
-
lgdo/types/histogram.py,sha256=
|
43
|
-
lgdo/types/lgdo.py,sha256=
|
42
|
+
lgdo/types/histogram.py,sha256=y6j2VDuGYYnLy7WI4J90ApS0PAwic4kCpouZPX09Nus,19974
|
43
|
+
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
|
-
lgdo/types/table.py,sha256=
|
46
|
+
lgdo/types/table.py,sha256=KPxKeLKqKQPkC_H75XraW0c1KRAhDdyGKBktVkD-KLw,18779
|
47
47
|
lgdo/types/vectorofvectors.py,sha256=cic9PsZ5EptQ6RMsykYeVHA8T7fh_KBZCcqeTP4i1wU,24395
|
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.
|
51
|
-
legend_pydataobj-1.11.
|
52
|
-
legend_pydataobj-1.11.
|
53
|
-
legend_pydataobj-1.11.
|
54
|
-
legend_pydataobj-1.11.
|
55
|
-
legend_pydataobj-1.11.
|
50
|
+
legend_pydataobj-1.11.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
51
|
+
legend_pydataobj-1.11.3.dist-info/METADATA,sha256=rYpLl_oH_V8OMAXKOb-0YOl_Y_GdtCfi91ZnrI7rVTU,44382
|
52
|
+
legend_pydataobj-1.11.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
53
|
+
legend_pydataobj-1.11.3.dist-info/entry_points.txt,sha256=Uu5MTlppBZxB4QGlLv-oX8FqACWjAZDNii__TBDJwLQ,72
|
54
|
+
legend_pydataobj-1.11.3.dist-info/top_level.txt,sha256=KyR-EUloqiXcQ62IWnzBmtInDtvsHl4q2ZJAZgTcLXE,5
|
55
|
+
legend_pydataobj-1.11.3.dist-info/RECORD,,
|
lgdo/__init__.py
CHANGED
@@ -62,23 +62,23 @@ from .types import (
|
|
62
62
|
)
|
63
63
|
|
64
64
|
__all__ = [
|
65
|
+
"LGDO",
|
65
66
|
"Array",
|
66
|
-
"ArrayOfEqualSizedArrays",
|
67
67
|
"ArrayOfEncodedEqualSizedArrays",
|
68
|
+
"ArrayOfEqualSizedArrays",
|
68
69
|
"FixedSizeArray",
|
69
70
|
"Histogram",
|
70
|
-
"
|
71
|
+
"LH5Iterator",
|
72
|
+
"LH5Store",
|
71
73
|
"Scalar",
|
72
74
|
"Struct",
|
73
75
|
"Table",
|
74
|
-
"VectorOfVectors",
|
75
76
|
"VectorOfEncodedVectors",
|
77
|
+
"VectorOfVectors",
|
76
78
|
"WaveformTable",
|
79
|
+
"__version__",
|
77
80
|
"load_dfs",
|
78
81
|
"load_nda",
|
79
82
|
"ls",
|
80
83
|
"show",
|
81
|
-
"LH5Iterator",
|
82
|
-
"LH5Store",
|
83
|
-
"__version__",
|
84
84
|
]
|
lgdo/_version.py
CHANGED
lgdo/compression/__init__.py
CHANGED
lgdo/lh5/__init__.py
CHANGED
@@ -24,22 +24,22 @@ from .write.scalar import _h5_write_scalar
|
|
24
24
|
from .write.vector_of_vectors import _h5_write_vector_of_vectors
|
25
25
|
|
26
26
|
__all__ = [
|
27
|
-
"_h5_read_lgdo",
|
28
|
-
"_h5_read_vector_of_vectors",
|
29
|
-
"_h5_read_ndarray",
|
30
27
|
"_h5_read_array",
|
28
|
+
"_h5_read_array_of_encoded_equalsized_arrays",
|
29
|
+
"_h5_read_array_of_equalsized_arrays",
|
31
30
|
"_h5_read_encoded_array",
|
32
31
|
"_h5_read_fixedsize_array",
|
33
|
-
"_h5_read_array_of_equalsized_arrays",
|
34
|
-
"_h5_read_struct",
|
35
|
-
"_h5_read_table",
|
36
32
|
"_h5_read_histogram",
|
33
|
+
"_h5_read_lgdo",
|
34
|
+
"_h5_read_ndarray",
|
37
35
|
"_h5_read_scalar",
|
38
|
-
"
|
36
|
+
"_h5_read_struct",
|
37
|
+
"_h5_read_table",
|
39
38
|
"_h5_read_vector_of_encoded_vectors",
|
40
|
-
"
|
39
|
+
"_h5_read_vector_of_vectors",
|
41
40
|
"_h5_write_array",
|
42
|
-
"_h5_write_vector_of_vectors",
|
43
|
-
"_h5_write_struct",
|
44
41
|
"_h5_write_lgdo",
|
42
|
+
"_h5_write_scalar",
|
43
|
+
"_h5_write_struct",
|
44
|
+
"_h5_write_vector_of_vectors",
|
45
45
|
]
|
lgdo/lh5/exceptions.py
CHANGED
@@ -16,6 +16,9 @@ class LH5DecodeError(Exception):
|
|
16
16
|
+ super().__str__()
|
17
17
|
)
|
18
18
|
|
19
|
+
def __reduce__(self) -> tuple: # for pickling.
|
20
|
+
return self.__class__, (*self.args, self.file, self.obj)
|
21
|
+
|
19
22
|
|
20
23
|
class LH5EncodeError(Exception):
|
21
24
|
def __init__(
|
@@ -32,3 +35,6 @@ class LH5EncodeError(Exception):
|
|
32
35
|
f"while writing object {self.group}/{self.name} to file {self.file}: "
|
33
36
|
+ super().__str__()
|
34
37
|
)
|
38
|
+
|
39
|
+
def __reduce__(self) -> tuple: # for pickling.
|
40
|
+
return self.__class__, (*self.args, self.file, self.group, self.name)
|
lgdo/types/__init__.py
CHANGED
@@ -15,17 +15,17 @@ from .vectorofvectors import VectorOfVectors
|
|
15
15
|
from .waveformtable import WaveformTable
|
16
16
|
|
17
17
|
__all__ = [
|
18
|
+
"LGDO",
|
18
19
|
"Array",
|
19
|
-
"ArrayOfEqualSizedArrays",
|
20
20
|
"ArrayOfEncodedEqualSizedArrays",
|
21
|
+
"ArrayOfEqualSizedArrays",
|
21
22
|
"FixedSizeArray",
|
22
23
|
"Histogram",
|
23
|
-
"LGDO",
|
24
24
|
"Scalar",
|
25
25
|
"Struct",
|
26
26
|
"Table",
|
27
|
-
"VectorOfVectors",
|
28
27
|
"VectorOfEncodedVectors",
|
28
|
+
"VectorOfVectors",
|
29
29
|
"WaveformTable",
|
30
30
|
]
|
31
31
|
|
lgdo/types/histogram.py
CHANGED
@@ -418,13 +418,18 @@ class Histogram(Struct):
|
|
418
418
|
|
419
419
|
def __setitem__(self, name: str, obj: LGDO) -> None:
|
420
420
|
# do not allow for new attributes on this
|
421
|
-
|
422
|
-
|
421
|
+
known_keys = ("binning", "weights", "isdensity")
|
422
|
+
if name in known_keys and not dict.__contains__(self, name):
|
423
|
+
# but allow initialization while unpickling (after __init__() this is unreachable)
|
424
|
+
dict.__setitem__(self, name, obj)
|
425
|
+
else:
|
426
|
+
msg = "histogram fields cannot be mutated "
|
427
|
+
raise TypeError(msg)
|
423
428
|
|
424
429
|
def __getattr__(self, name: str) -> None:
|
425
430
|
# do not allow for new attributes on this
|
426
431
|
msg = "histogram fields cannot be mutated"
|
427
|
-
raise
|
432
|
+
raise AttributeError(msg)
|
428
433
|
|
429
434
|
def add_field(self, name: str | int, obj: LGDO) -> None: # noqa: ARG002
|
430
435
|
"""
|
lgdo/types/lgdo.py
CHANGED
@@ -11,6 +11,12 @@ import pandas as pd
|
|
11
11
|
class LGDO(ABC):
|
12
12
|
"""Abstract base class representing a LEGEND Data Object (LGDO)."""
|
13
13
|
|
14
|
+
def __new__(cls, *_args, **_kwargs):
|
15
|
+
# allow for (un-)pickling LGDO objects.
|
16
|
+
obj = super().__new__(cls)
|
17
|
+
obj.attrs = {}
|
18
|
+
return obj
|
19
|
+
|
14
20
|
@abstractmethod
|
15
21
|
def __init__(self, attrs: dict[str, Any] | None = None) -> None:
|
16
22
|
self.attrs = {} if attrs is None else dict(attrs)
|
lgdo/types/table.py
CHANGED
@@ -41,6 +41,12 @@ class Table(Struct):
|
|
41
41
|
:meth:`__len__` to access valid data, which returns the ``size`` attribute.
|
42
42
|
"""
|
43
43
|
|
44
|
+
def __new__(cls, *args, **kwargs):
|
45
|
+
# allow for (un-)pickling LGDO objects.
|
46
|
+
obj = super().__new__(cls, *args, **kwargs)
|
47
|
+
obj.size = None
|
48
|
+
return obj
|
49
|
+
|
44
50
|
def __init__(
|
45
51
|
self,
|
46
52
|
col_dict: Mapping[str, LGDO] | pd.DataFrame | ak.Array | None = None,
|
File without changes
|
File without changes
|
File without changes
|