Coverage for src/susi/utils/pickle.py: 42%
12 statements
« prev ^ index » next coverage.py v7.5.0, created at 2025-06-13 14:15 +0000
« prev ^ index » next coverage.py v7.5.0, created at 2025-06-13 14:15 +0000
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3"""
4Functions for reading from and writing to pickle files
6@author: feller
7"""
9import pickle
10import os
13def pickle_read(config, file):
14 pickle_path = os.path.join(config.data.out_path, file)
15 with open(pickle_path, 'rb') as f:
16 data = pickle.load(f)
17 return data
20def pickle_write(config, file, data):
21 pickle_path = os.path.join(config.data.out_path, file)
22 with open(pickle_path, 'wb') as f:
23 pickle.dump(data, f)