legend-pydataobj 1.14.2__py3-none-any.whl → 1.14.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: legend_pydataobj
3
- Version: 1.14.2
3
+ Version: 1.14.3
4
4
  Summary: LEGEND Python Data Objects
5
5
  Author: The LEGEND Collaboration
6
6
  Maintainer: The LEGEND Collaboration
@@ -1,6 +1,6 @@
1
- legend_pydataobj-1.14.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
1
+ legend_pydataobj-1.14.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
2
2
  lgdo/__init__.py,sha256=fkRv79kdtBasw31gPVK9SdLQ2vEEajTV2t3UPDvFg9o,3206
3
- lgdo/_version.py,sha256=XJY_CvF8oIeHKlGNoyQktgBeMSHaZBYQy5zzYmcKBkI,513
3
+ lgdo/_version.py,sha256=NzEEMglzBvMvu9NyIM5lnzzARmP98REW0HB5Kp9fzqg,513
4
4
  lgdo/cli.py,sha256=s_EWTBWW76l7zWb6gaTSTjiT-0RzzcYEmjeFEQCVxfk,4647
5
5
  lgdo/lgdo_utils.py,sha256=6a2YWEwpyEMXlAyTHZMO01aqxy6SxJzPZkGNWKNWuS0,2567
6
6
  lgdo/logging.py,sha256=82wIOj7l7xr3WYyeHdpSXbbjzHJsy-uRyKYUYx2vMfQ,1003
@@ -20,7 +20,7 @@ lgdo/lh5/exceptions.py,sha256=Q374YeqajpptVCYfxJYrThiPZSnfpdbGV3qVwoUuEFo,1697
20
20
  lgdo/lh5/iterator.py,sha256=vuN98pa-xHDWXM2GMxvMxFEJGfHatMX6ajqnaP55PuY,20680
21
21
  lgdo/lh5/settings.py,sha256=cmPd6ZvneAF5sFMA1qf-9g_YSSygJcQSRmZDp1_sBEU,1001
22
22
  lgdo/lh5/store.py,sha256=nW8hwamd5yfaskuYaMrnWT7I-H7UiwQTXWHRpnfd9l4,8837
23
- lgdo/lh5/tools.py,sha256=4OWRA6f__yeZSXgrc3JIpO597x-gtj-s9Y2ycnS6yLM,6663
23
+ lgdo/lh5/tools.py,sha256=v1nmQl3hV4pES6Gu5jiDS7Ov7k4ZcP8d-3Gc5-snmrU,7038
24
24
  lgdo/lh5/utils.py,sha256=PPdOcqBCMqDsHy5vpQIoThoeFRtZHN4DL7IDKzucUxU,6905
25
25
  lgdo/lh5/_serializers/__init__.py,sha256=eZzxMp1SeZWG0PkEXUiCz3XyprQ8EmelHUmJogC8xYE,1263
26
26
  lgdo/lh5/_serializers/read/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -49,8 +49,8 @@ lgdo/types/table.py,sha256=huhgpzdAUx0bRaEaitwnb-Ve7oAu5B6zxPK5EXPUfg0,20233
49
49
  lgdo/types/vectorofvectors.py,sha256=k1LwNnX3TcRAhOujj85kNkfZN0MXZYL9aaMUbr82JlE,26910
50
50
  lgdo/types/vovutils.py,sha256=LW3ZcwECxVYxxcFadAtY3nnK-9-rk8Xbg_m8hY30lo4,10708
51
51
  lgdo/types/waveformtable.py,sha256=9S_NMg894NZTGt2pLuskwH4-zQ5EbLnzWI6FVui6fXE,9827
52
- legend_pydataobj-1.14.2.dist-info/METADATA,sha256=glxIddfCqz4ly2s46a-QYe_FWZYiSgaceXxkjmHfFTk,44443
53
- legend_pydataobj-1.14.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
- legend_pydataobj-1.14.2.dist-info/entry_points.txt,sha256=0KWfnwbuwhNn0vPUqARukjp04Ca6lzfZBSirouRmk7I,76
55
- legend_pydataobj-1.14.2.dist-info/top_level.txt,sha256=KyR-EUloqiXcQ62IWnzBmtInDtvsHl4q2ZJAZgTcLXE,5
56
- legend_pydataobj-1.14.2.dist-info/RECORD,,
52
+ legend_pydataobj-1.14.3.dist-info/METADATA,sha256=rIkDQcuhcusPO0b0wqT9ycAsY7B8Tc95MSE_bYFly-w,44443
53
+ legend_pydataobj-1.14.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
+ legend_pydataobj-1.14.3.dist-info/entry_points.txt,sha256=0KWfnwbuwhNn0vPUqARukjp04Ca6lzfZBSirouRmk7I,76
55
+ legend_pydataobj-1.14.3.dist-info/top_level.txt,sha256=KyR-EUloqiXcQ62IWnzBmtInDtvsHl4q2ZJAZgTcLXE,5
56
+ legend_pydataobj-1.14.3.dist-info/RECORD,,
lgdo/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '1.14.2'
21
- __version_tuple__ = version_tuple = (1, 14, 2)
20
+ __version__ = version = '1.14.3'
21
+ __version_tuple__ = version_tuple = (1, 14, 3)
lgdo/lh5/tools.py CHANGED
@@ -149,17 +149,27 @@ def show(
149
149
 
150
150
  # loop over keys
151
151
  while True:
152
- val = lh5_file[key]
153
- # we want to print the LGDO datatype
154
- dtype = val.attrs.get("datatype", default="no datatype")
155
- if dtype == "no datatype" and isinstance(val, h5py.Group):
156
- dtype = "HDF5 group"
157
-
158
- _attrs = ""
159
- if attrs:
160
- attrs_d = dict(val.attrs)
161
- attrs_d.pop("datatype", "")
162
- _attrs = "── " + str(attrs_d) if attrs_d else ""
152
+ is_link = False
153
+ link_type = lh5_file.get(key, getlink=True)
154
+ if isinstance(link_type, (h5py.SoftLink, h5py.ExternalLink)):
155
+ desc = f"-> {link_type.path}"
156
+ is_link = True
157
+
158
+ else:
159
+ val = lh5_file[key]
160
+
161
+ # we want to print the LGDO datatype
162
+ dtype = val.attrs.get("datatype", default="no datatype")
163
+ if dtype == "no datatype" and isinstance(val, h5py.Group):
164
+ dtype = "HDF5 group"
165
+
166
+ _attrs = ""
167
+ if attrs:
168
+ attrs_d = dict(val.attrs)
169
+ attrs_d.pop("datatype", "")
170
+ _attrs = "── " + str(attrs_d) if attrs_d else ""
171
+
172
+ desc = f"· {dtype} {_attrs}"
163
173
 
164
174
  # is this the last key?
165
175
  killme = False
@@ -171,9 +181,10 @@ def show(
171
181
  else:
172
182
  char = "├──"
173
183
 
174
- print(f"{indent}{char} \033[1m{key}\033[0m · {dtype} {_attrs}") # noqa: T201
184
+ print(f"{indent}{char} \033[1m{key}\033[0m {desc}") # noqa: T201
175
185
 
176
- if detail and isinstance(val, h5py.Dataset):
186
+ if not is_link and detail and isinstance(val, h5py.Dataset):
187
+ val = lh5_file[key]
177
188
  char = "| "
178
189
  if killme:
179
190
  char = " "
@@ -207,9 +218,9 @@ def show(
207
218
  print(toprint) # noqa: T201
208
219
 
209
220
  # if it's a group, call this function recursively
210
- if isinstance(val, h5py.Group):
221
+ if not is_link and isinstance(val, h5py.Group):
211
222
  show(
212
- val,
223
+ lh5_file[key],
213
224
  indent=indent + (" " if killme else "│ "),
214
225
  header=False,
215
226
  attrs=attrs,