Passed
Push — master ( 8b2ed0...4823d2 )
by Daniel
03:53
created

pickle_psets   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 16
dl 0
loc 21
rs 10
c 0
b 0
f 0
1
import os
2
import amd
3
import pickle
4
5
root_dir = r'average-minimum-distance\tests\data'
6
7
filenames = {
8
    'cubic':           r'cubic.hdf5',
9
    'T2_simulated':    r'T2_simulated.hdf5',
10
    'T2_experimental': r'T2_experimental.hdf5',
11
    'CSD_families':    r'CSD_families.hdf5',
12
}
13
14
paths = {name: os.path.join(root_dir, filenames[name]) for name in filenames}
15
16
refs = {name: list(amd.SetReader(paths[name])) for name in paths}
17
18
for name, psets in refs.items():
19
    with open(os.path.join(root_dir, name + '.pkl'), 'wb') as f:
20
        pickle.dump(psets, f)