里面有几个问题。我将逐一阐述。
1)通用唯一标识:new_activity = old_activity.copy()
创建一个新的 UUIDnew_activity
。就你而言,hp_qc.key==hp_ch.key
将返回False
。因此一切都很好。
2) 添加交换:一旦您找到您想要链接的活动(例如,qc_elec
), 你可以这样做:
hp_qc.new_exchange(input=qc_elect.key, amount = amount, type='technosphere')
where my_amount
是本次兑换的实际金额。
3)然而,这将是much在你的情况下更简单adapt交换而不是删除并替换它:
hp_qc=hp_ch.copy()
hp_qc['location']='CA-QC'
# Assign the electricity input you want to change to a variable
elect_to_hp = [exc for exc in hp_qc.technosphere() if 'electricity, low voltage' in exc['name']][0]
# Change the input of this exchange so it links to `qc_elect`
elect_to_hp.input = qc_elect
# Save the resulting activity
elect_to_hp.save()
交换将与之前的电力输入相同(相同的数量、相同的不确定性、相同的文件)。然后,您需要这样更改您想要的字段(例如评论、不确定性):
elect_to_hp['comment'] = 'Recontextualisation'
4)不确定性,谱系:
您说得很对:(1) 谱系分数应该进行调整,(2) 总不确定性应该因此改变,(3) Brightway 中不使用谱系分数来计算总不确定性。但是,您可以使用以下方法轻松计算新的不确定性scale without pedigree
(相当于基本不确定性)、系谱分数和已发表的附加不确定性因素(转载自here为了您的方便,请在下面)计算新的不确定性(新的scale
如果 PDF 是对数正态的)一旦您修改了系谱分数。
ecoinvent_33_pedigree_matrix = {
'reliability':
{
1:0.0,
2:0.0006,
3:0.002,
4:0.008,
5:0.04
},
'completeness':
{
1: 0.0,
2: 0.0001,
3: 0.0006,
4: 0.002,
5: 0.008
},
'temporal correlation':
{
1:0.0,
2:0.0002,
3:0.002,
4:0.008,
5:0.04
},
'geographical correlation':
{
1:0.0,
2:0.000025,
3:0.0001,
4:0.0006,
5:0.002
},
'further technological correlation':
{
1:0.0,
2:0.0006,
3:0.008,
4:0.04,
5:0.12
}
}