+2 votes
340 views

Hi,

I'm looking into the ecoinvent process electricity production of Wind off-shore. Within the openLCA software (v1.10) i see processes of this type for multiple countries. However when I try to use Python to get the same data, I don't seem to be able to select or even see the country the process belongs to. Also when getting the results all processes create the same values, while in openLCA the values per country differ.

Does anyone know how to do this? Or is this simply not possible with the python package.

See below my code:

Thanks,

Hans

import pandas as pd
import olca
import uuid
 
params = {'mathtext.default''regular' }
client = olca.Client(8081)
setup = olca.CalculationSetup()
setup.calculation_type = olca.CalculationType.CONTRIBUTION_ANALYSIS
setup.impact_method = client.find(olca.ImpactMethod, 'ReCiPe 2016 Midpoint (H)')
setup.amount = 1.0
 
process_descriptor = client.get_descriptors(olca.Process)
 
process_list = []
id_list = []
des_list = []
 
for process in process_descriptor:
    process_list.append(process.name)
    id_list.append(process.id)
    des_list.append(process.description)
processes_df = pd.DataFrame(list(zip(process_list,
                                   id_list)),
                               columns=['name''id'])
 
search_df = processes_df[processes_df['name'].str.contains(r'electricity production, wind, 1-3MW turbine, onshore')]
search_df.reset_index(drop=Trueinplace=True)
pd.set_option('display.max_colwidth'None)
search_df['name']
in openLCA by (230 points)

1 Answer

+1 vote
by (114k points)
edited by

Hi Hans, the process name does not contain the location, what you see in the category tree e.g. is a concatenation of the process name and the location; the name is shown in the editor.

=> You need to add the location attribute to your search to get results specific for different locations.

Hth, Andreas

- and maybe as an addition: to find one specific process dataset, you should anyhow not go after name and location etc. but take the UUID.

by (230 points)
Hey,
Thanks for the help!

While digging a bit further I even found a way to do this.
    process = client.get(model_type=olca.Process,model_id=process_id)
    process.location.name

Cheers,
Hans
...