1

我正在尝试创建新的影响评估方法来在 Brightway 中执行生命周期分析。我做了:

bw2data.ia_data_store.ImpactAssessmentDataStore(name=('Air pollutants', 'Ammonia')).register(name=('Air pollutants', 'Ammonia'))

但我得到:

TypeError:“NoneType”类型的参数不可迭代。更准确地说,当调用文件 data_store.py 中的 register(self,**kwargs) 函数时会发生错误。

我首先认为这是因为我没有提供任何元数据(只有一个名称),但根据文档我无法在注册之前设置元数据......

有谁知道为什么会发生这种情况以及如何更正我的代码?

非常感谢

4

1 回答 1

0

您应该专门使用MethodImpactAssessmentDataStore。

new_method_name = ('test', 'this', 'out')
Method(new_method_name).register()

该方法现在在您的 DataStore 中:

In    [m for m in methods if m[0]=='test']
Out   [('test', 'this', 'out')]

然后,您可以像这样添加数据(即实际添加特征因子):

Method(('test', 'this', 'out')).write(data)    
于 2018-07-30T18:10:47.600 回答