Simapro CSV导入Brightway2后200+未链接交换的技术问询
解决Brightway2导入Simapro CSV时的未链接交换问题
按照Brightway2官方示例导入Simapro CSV文件后,仍有200余个交换未完成链接,这些未链接交换的名称遵循固定格式,示例如下:
Cement, Portland {CH}| market for | Cut-off, U
Concrete mixing factory {CH}| construction | Cut-off, U
Diesel, burned in building machine {GLO}| market for | Cut-off, U
Electricity, medium voltage {CH}| market for | Cut-off, U
Gravel, round {CH}| market for gravel, round | Cut-off, U
Heat, district or industrial, natural gas {CH}| market for heat, district or industrial, natural gas | Cut-off, U
针对这种格式,Brightway2的bw2io库已有现成处理方案,无需完全从零编写自定义策略:
- 优先尝试
bw2io.strategies.simapro模块中的split_simapro_name策略,它专门用于拆分Simapro这种多字段拼接的名称,能提取出物质/活动名称、位置、类别等关键信息,为后续匹配数据库条目提供基础。 - 搭配
link_technosphere_by_activity_hash或link_technosphere_by_name_location这类通用链接策略,利用拆分后的字段进行精准匹配,能大幅减少未链接交换的数量。 - 如果内置策略仍有遗漏,可基于拆分后的字段(比如物质名称、位置、市场标识)编写轻量自定义逻辑,例如针对含"market for"的交换,直接匹配对应物质的市场活动条目。
内容的提问来源于stack exchange,提问作者Raphael Jolivet
相关产品推荐
相关产品推荐

