We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79e46ec commit 3016908Copy full SHA for 3016908
dimspy/portals/hdf5_portal.py
@@ -25,15 +25,8 @@ def _eval(v):
25
except (ValueError, SyntaxError):
26
return str(v)
27
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)
+_packMeta = lambda x: [zlib.compress(cp.dumps(x))]
+_unpackMeta = lambda x: cp.loads(zlib.decompress(x[0]))
37
38
39
# peaklists portals
0 commit comments