def test_saveload_json(self):
     filename = "tmp_json_file"
     obj_init =[u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
     tools.savejson(filename, obj_init)
     obj_read = tools.loadjson(filename)
     self.assertEqual(obj_read, obj_init)
     os.remove(filename)
 def test_saveload_json(self):
     filename = "tmp_json_file"
     obj_init =[u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
     tools.savejson(filename, obj_init)
     obj_read = tools.loadjson(filename)
     self.assertEqual(obj_read, obj_init)
     os.remove(filename)
Example #3
0
def save():
    """ Exports session to disk
    """
    unix.mkdir(_output())

    for name in ['parameters', 'paths']:
        fullfile = join(_output(), 'seisflows_' + name + '.json')
        savejson(fullfile, sys.modules['seisflows_' + name].__dict__)

    for name in names:
        fullfile = join(_output(), 'seisflows_' + name + '.p')
        saveobj(fullfile, sys.modules['seisflows_' + name])
Example #4
0
def save():
    """ Exports session to disk
    """
    unix.mkdir(_output())

    for name in ['parameters', 'paths']:
        fullfile = join(_output(), 'seisflows_'+name+'.json')
        savejson(fullfile, sys.modules['seisflows_'+name].__dict__)

    for name in names:
        fullfile = join(_output(), 'seisflows_'+name+'.p')
        saveobj(fullfile, sys.modules['seisflows_'+name])
Example #5
0
def save():
    """ Exports session to disk
        Write files:
        seisflows_parameters.json, seisflows_paths.json, seisflows_system.p,
        seisflows_preprocess.p, seisflows_solver.p, seisflows_postprocess.p,
        seisflows_optimize.p, seisflows_workflow.p
    """
    unix.mkdir(_output())
    for name in ['parameters', 'paths']:
        fullfile = join(_output(), 'seisflows_' + name + '.json')
        savejson(fullfile, sys.modules['seisflows_' + name].__dict__)

    for name in names:
        fullfile = join(_output(), 'seisflows_' + name + '.p')
        saveobj(fullfile, sys.modules['seisflows_' + name])