def test_saveload(self): filename = "tmp_pickle_file" obj_init = "Something" tools.saveobj(filename, obj_init) obj_read = tools.loadobj(filename) self.assertEqual(obj_read, obj_init) os.remove(filename)
def load(path): """ Imports session from disk """ for name in ['parameters', 'paths']: fullfile = join(_full(path), 'seisflows_' + name + '.json') sys.modules['seisflows_' + name] = Dict(loadjson(fullfile)) for name in names: fullfile = join(_full(path), 'seisflows_' + name + '.p') sys.modules['seisflows_' + name] = loadobj(fullfile)
def load(path): """ Imports session from disk """ for name in ['parameters', 'paths']: fullfile = join(_full(path), 'seisflows_'+name+'.json') sys.modules['seisflows_'+name] = Dict(loadjson(fullfile)) for name in names: fullfile = join(_full(path), 'seisflows_'+name+'.p') sys.modules['seisflows_'+name] = loadobj(fullfile)