0

ブライトウェイで、異なるユニットとの交換でアクティビティを定義することは可能ですか? (たとえば、メガジュールではなくテラジュール)。これをテストするために小さなコードを書きましたが、私の素朴なアプローチはうまくいかないようです:

co2_f=[f for f in bw.Database('biosphere3')
if 'Carbon dioxide' in f['name']
and ' fossil' in f['name']
and f['categories']==('air', 'low population density, long-term')
][0]
co2_f

for act in bw.Database('ei_35cutoff'):
    if act['unit']=='megajoule':
       break

db = bw.Database("a&e")

db.write({
("a&e", "cat1"): 
    {
    'name': 'cat1',
    'unit': 'kilogram',
    'exchanges': [
        {'input': act.key  ,'amount': 10,'type': 'technosphere','unit':'megajoule'},
        {'input': co2_f.key,'amount': 1,'type': 'biosphere','unit':'kilogram'}]
    },

("a&e", "cat2"): 
    {
    'name': 'cat2',
    'unit': 'kilogram',
    'exchanges': [
        {'input': act.key  ,'amount': 10,'type': 'technosphere','unit':'terajoule'},
        {'input': co2_f.key,'amount': 1,'type': 'biosphere','unit':'kilogram'}]
    },
("a&e", "cat3"): 
    {
    'name': 'cat3',
    'unit': 'kilogram',
    'exchanges': [
        {'input': act.key  ,'amount': 10,'type': 'technosphere','unit':'megajoule'},
        {'input': co2_f.key,'amount': 1,'type': 'biosphere','unit':'ton'}]
    },
})

ipcc2013 = ('IPCC 2013', 'climate change', 'GWP 100a')

for a in db:
    actlca=bw.LCA({a:1},method=ipcc2013)
    actlca.lci()
    actlca.lcia()
    print(a['name'],actlca.score)

すべてが同じ結果を生成します。あたかも CO2 が kgactでメガジュールであるかのように。

4

1 に答える 1

0

「Brightway2 は「ユニット」属性に基づいて交換をスケーリングしますか」という意味であれば、答えはノーです。

Brightway2 の他のほとんどすべてと同様に、これは不可能ではありません。ただし、ユニットは、processedBrightway によって保存されるデータの一部ではありません (つまり、 s がAおよびBマトリックスをMatrixBuilder構築するための保存された構造化配列の一部ではありません)。

処理されたデータと構築行列の詳細については、こちらこちらを参照してください。

于 2019-07-08T13:37:06.210 に答える