Created
June 6, 2023 21:14
-
-
Save cmutel/f81ba6d0a3018edfec44e8aa45368376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bw2data as bd | |
import bw2calc as bc | |
bd.projects.set_current("ghg-scores") | |
db = bd.Database("eg") | |
db.register() | |
a = db.new_node(code="a", name="a") | |
a.save() | |
b = db.new_node(code="b", name="b") | |
b.save() | |
ghg_flow = db.new_node(code="ghgs", name="GHG score", unit="kg CO2-eq.", type="emission") | |
ghg_flow.save() | |
a.new_edge(input=b, amount=1, type="technosphere").save() | |
b.new_edge(input=ghg_flow, amount=7, type="biosphere").save() | |
only_ghg_flows_lcia_method = bd.Method(("GHG scores", "direct")) | |
only_ghg_flows_lcia_method.write([(ghg_flow.key, 1)]) | |
lca = bc.LCA({a: 1}, ("GHG scores", "direct")) | |
lca.lci() | |
lca.lcia() | |
lca.score | |
>>> 7.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment