Skip to content

Commit 3016908

Browse files
committed
Fix peaklist save to / load from hdf5 header size exceed 64KB bug.
1 parent 79e46ec commit 3016908

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

dimspy/portals/hdf5_portal.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,8 @@ def _eval(v):
2525
except (ValueError, SyntaxError):
2626
return str(v)
2727

28-
def _packMeta(v):
29-
dv = cp.dumps(v)
30-
# in case unicode chars, which are 4 times larger then str in python
31-
return ['O', dv] if sys.getsizeof(dv) / 1000. < 16 else \
32-
['C', zlib.compress(dv)]
33-
34-
def _unpackMeta(v):
35-
dv = zlib.decompress(v[1]) if v[0] == 'C' else v[1]
36-
return cp.loads(dv)
28+
_packMeta = lambda x: [zlib.compress(cp.dumps(x))]
29+
_unpackMeta = lambda x: cp.loads(zlib.decompress(x[0]))
3730

3831

3932
# peaklists portals

0 commit comments

Comments
 (0)