Brightway2修改现有的ecoinvent活动

时间:2018-01-22 12:37:31

标签: brightway

之前有一个问题here,但它对我的问题没有帮助:

当我尝试使用.amount = myamount更改交换金额时 我总是得到一个"不能设置属性错误"。

这就是我所做的:

## search for activity
msw = [get_activity(key) for key, ds in eco.items() if 
           'treatment of municipal solid waste, incineration' in ds['name'] and 
           ds['location'] == ('BE') and ds['unit'] == 'kilogram']

##make a copy
msw_be = msw.copy()

##get exchange
Carbon_dioxide_non_fossil = [exc for exc in mswi_be.biosphere() if 'Carbon dioxide, non-fossil' in exc['name']][0]

然后

##change amount
Carbon_dioxide_non_fossil.amount = 0.75152

这是我得到错误的地方。 谢谢你的帮助。

1 个答案:

答案 0 :(得分:0)

您的活动就像字典一样,不支持属性访问。试试这个:

Carbon_dioxide_non_fossil['amount'] = 0.75152
Carbon_dioxide_non_fossil.save()