Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mc' into mc
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Jul 27, 2024
2 parents 00c69bf + 2584124 commit 1ab79d2
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions dev/update_lcia_methods.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import bw2data
import json

import bw2data

bw2data.projects.set_current("ei310")

lcia = []
Expand All @@ -11,23 +12,16 @@
dm = {
"name": list(method.name),
"unit": method.metadata["unit"],

}
exc = []
for name, cf in method.load():
act = bw2data.get_activity(name)
name = act["name"]
cat = list(act["categories"])
exc.append(
{
"name": name,
"categories": cat,
"amount": cf
}
)
exc.append({"name": name, "categories": cat, "amount": cf})
dm["exchanges"] = exc
lcia.append(dm)


with open("lcia_ei310.json", "w") as file:
json.dump(lcia, file)
json.dump(lcia, file)

0 comments on commit 1ab79d2

Please sign in to comment.