-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsdnetInstructions.txt
32 lines (26 loc) · 1.06 KB
/
msdnetInstructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Msdnet version 1.0.0 needs the following fix in store.py (when installed in a conda environment, this file can be found in miniconda3/envs/<NAMEOFENVIRONMENT>/lib/python3.7/site-packages/msdnet):
The function is:
def __store_grp_in_dict(grp, dct):
for key, val in grp.attrs.items():
dct[key] = val.item()
for key, val in grp.items():
if isinstance(val, h5py.Group):
newdct = {}
__store_grp_in_dict(val, newdct)
dct[key] = newdct
elif isinstance(val, h5py.Dataset):
dct[key] = val[:]
but should become:
def __store_grp_in_dict(grp, dct):
for key, val in grp.attrs.items():
try:
dct[key] = val.item()
except ValueError: # Fix for old network files with python lists in attributes
dct[key] = val
for key, val in grp.items():
if isinstance(val, h5py.Group):
newdct = {}
__store_grp_in_dict(val, newdct)
dct[key] = newdct
elif isinstance(val, h5py.Dataset):
dct[key] = val[:]