本文整理汇总了Python中pycap.PropertyTree.get_string方法的典型用法代码示例。如果您正苦于以下问题:Python PropertyTree.get_string方法的具体用法?Python PropertyTree.get_string怎么用?Python PropertyTree.get_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycap.PropertyTree
的用法示例。
在下文中一共展示了PropertyTree.get_string方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from pycap import PropertyTree [as 别名]
# 或者: from pycap.PropertyTree import get_string [as 别名]
for p in range(params):
usage+=' --param_'+str(p)+' val_'+str(p)
parser=OptionParser(usage)
# register options
for p in range(params):
parser.add_option('--param_'+str(p),type=float)
# parse the command line arguments
(options,args)=parser.parse_args()
# make device database
device_database=PropertyTree()
device_database.parse_xml('super_capacitor.xml')
# adjust the parameters in the database
options_dict=vars(options)
for var in options_dict:
path=uq_database.get_string('uq.'+var+'.name')
# next line is there to ensure that path already exists
old_value=device_database.get_double(path)
new_value=options_dict[var]
print var,path,new_value
device_database.put_double(path,new_value)
# build the energy storage device
device=EnergyStorageDevice(device_database.get_child('device'))
# parse the electrochmical impedance spectroscopy database
eis_database=PropertyTree()
eis_database.parse_xml('eis.xml')
# measure the impedance
impedance_spectrum_data=measure_impedance_spectrum(device,eis_database.get_child('eis'))
# extract the results
frequency=impedance_spectrum_data['frequency']