本文整理汇总了Python中gnome.model.Model.load方法的典型用法代码示例。如果您正苦于以下问题:Python Model.load方法的具体用法?Python Model.load怎么用?Python Model.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnome.model.Model
的用法示例。
在下文中一共展示了Model.load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_load_model
# 需要导入模块: from gnome.model import Model [as 别名]
# 或者: from gnome.model.Model import load [as 别名]
def test_save_load_model(uncertain, zipsave, saveloc_):
'''
create a model, save it, then load it back up and check it is equal to
original model
'''
model = make_model(uncertain)
ice_mover = IceMover(testdata['IceMover']['ice_curr_curv'],
testdata['IceMover']['ice_top_curv'])
model.movers += ice_mover
model.outputters += IceJsonOutput([ice_mover])
model.zipsave = zipsave
print 'saving scenario to {}...'.format(saveloc_)
_json_, savefile, _refs = model.save(saveloc_)
print 'loading scenario ...'
model2 = Model.load(savefile)
assert model == model2
示例2: test_location_file
# 需要导入模块: from gnome.model import Model [as 别名]
# 或者: from gnome.model.Model import load [as 别名]
def test_location_file():
'''
Simple test to check if json_ contains nothing - default model is created
'''
model = Model.load('.', {'json_': 'save'})
assert model == Model()