diff --git a/setup.cfg b/setup.cfg index 7882e00..eab3c20 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,7 +34,7 @@ install_requires = dspeed>=1.3.0a4 h5py>=3.2.0 hdf5plugin - legend-pydataobj>=1.5.0a1 + legend-pydataobj>=1.6 numpy>=1.21 pyfcutils tqdm>=4.27 diff --git a/src/daq2lh5/data_decoder.py b/src/daq2lh5/data_decoder.py index b784e9f..731a6cb 100644 --- a/src/daq2lh5/data_decoder.py +++ b/src/daq2lh5/data_decoder.py @@ -8,6 +8,7 @@ import numpy as np from lgdo import LGDO from lgdo.lh5 import LH5Store +from lgdo.lh5 import datatype as dtypeutils class DataDecoder: @@ -206,10 +207,10 @@ def make_lgdo(self, key: int | str = None, size: int = None) -> LGDO: continue # Parse datatype for remaining lgdos - datatype, shape, elements = lgdo.lh5.utils.parse_datatype(datatype) + lgdotype = dtypeutils.datatype(datatype) # ArrayOfEqualSizedArrays - if datatype == "array_of_equalsized_arrays": + if lgdotype is lgdo.ArrayOfEqualSizedArrays: length = attrs.pop("length") # only arrays of 1D arrays are supported at present dims = (1, 1) @@ -220,7 +221,7 @@ def make_lgdo(self, key: int | str = None, size: int = None) -> LGDO: continue # VectorOfVectors - if elements.startswith("array"): + if lgdotype is lgdo.VectorOfVectors: length_guess = size if "length_guess" in attrs: length_guess = attrs.pop("length_guess") @@ -234,7 +235,7 @@ def make_lgdo(self, key: int | str = None, size: int = None) -> LGDO: raise RuntimeError( type(self).__name__, ": do not know how to make a", - datatype, + lgdotype.__name__, "for", field, )