(fn, output_folder='output')
| 28 | |
| 29 | |
| 30 | def clean_fn(fn, output_folder='output'): |
| 31 | with open(fn, 'rb') as body_file: |
| 32 | body_data = pickle.load(body_file) |
| 33 | |
| 34 | output_dict = {} |
| 35 | for key, data in body_data.iteritems(): |
| 36 | if 'chumpy' in str(type(data)): |
| 37 | output_dict[key] = np.array(data) |
| 38 | else: |
| 39 | output_dict[key] = data |
| 40 | |
| 41 | out_fn = osp.split(fn)[1] |
| 42 | |
| 43 | out_path = osp.join(output_folder, out_fn) |
| 44 | with open(out_path, 'wb') as out_file: |
| 45 | pickle.dump(output_dict, out_file) |
| 46 | |
| 47 | |
| 48 | if __name__ == '__main__': |
no test coverage detected