分析energyplus idf文件的模块
parseidf的Python项目详细描述
parseIDF.py
将idf文件(由energyplus使用)解析为 以下方式:
- 每个idf对象都由其字段列表表示,其中 第一个字段是对象类型。
- 每个这样的列表都附加到具有相同类型的对象列表中 字典,按类型索引:
{a=>;[[a,x,y,z],[a,a,b,c]],b=>;[[b,1,2],[b,1,2,3]]}
- 索引键都是大写的。
- 此外,所有字段值都是字符串,即不解释 创造价值。
示例
import parseidf with open(r'in.idf', 'r') as f: idf = parseidf.parse(f.read()) print idf.keys() # lists the object types in the idf file print idf['OUTPUT:VARIABLE'] # lists all the Output:Variable objects in the idf file
依赖关系
parseIDF依赖于ply(python lex&yacc): https://pypi.python.org/pypi/ply/3.4
许可证和信贷
这个项目是根据麻省理工学院的许可条款授权的。见 有关详细信息,请在项目根目录中文件“license”。
本单元由Daren Thomas在 Sustainable Architecture and Building Technologies (SuAT)在Institute of Technology in Architecture,eth zürich。