Created
July 22, 2024 12:28
-
-
Save cmutel/fd6528ad1f6546b3551a68e5b9effd40 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
ei = bd.Database("ecoinvent-3.9.1-cutoff") | |
banana_co = bd.get_node(database=ei.name, name='banana production', location="CO") | |
banana_cr = bd.get_node(database=ei.name, name='banana production', location="CR") | |
impact_categories = [ | |
('ReCiPe Endpoint (H,A)', 'ecosystem quality', 'climate change, ecosystems'), | |
('ReCiPe Endpoint (H,A)', 'human health', 'climate change, human health') | |
] | |
method_config = {"impact_categories": impact_categories} | |
# Check configuration | |
bc.method_config.MethodConfig(**method_config) | |
demands = { | |
'π¨π΄': {banana_co.id: 1}, | |
'π¨π·': {banana_cr.id: 1} | |
} | |
data_objs = bd.get_multilca_data_objs(functional_units=demands, method_config=method_config) | |
mlca = bc.MultiLCA( | |
demands=demands, | |
method_config=method_config, | |
data_objs=data_objs | |
) | |
mlca.lci() | |
mlca.lcia() | |
mlca.scores | |
>>> { | |
(('ReCiPe Endpoint (H,A)', 'ecosystem quality', 'climate change, ecosystems'), 'π¨π΄'): 1., | |
(('ReCiPe Endpoint (H,A)', 'ecosystem quality', 'climate change, ecosystems'), 'π¨π·'): 2., | |
(('ReCiPe Endpoint (H,A)', 'human health', 'climate change, human health'), 'π¨π΄'): 3., | |
(('ReCiPe Endpoint (H,A)', 'human health', 'climate change, human health'), 'π¨π·'): 4. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment