当前位置: 首页>>代码示例>>Python>>正文


Python PropertyTree.get_string方法代码示例

本文整理汇总了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']
开发者ID:dalg24,项目名称:cap-notebooks,代码行数:33,代码来源:pycap_measure_impedance_spectrum.py


注:本文中的pycap.PropertyTree.get_string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。