Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
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)
Пример #4
0
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)