0 votes
47 views

Hi,

I am new to openLCA and the IPC python integration of it. We are currently trying to find a way to establish a type of Livelink (known from umberto LCA software), where the amount of a process input/output or a parameter is linked with a value from an Excel file cell. So when changing the values in Excel we can update the values in openLCA of all at the same time. And then continue working in the openLCA GUI and not in the python IDE.

I managed to do something similiar by parameterizing my product system and then use the IPC server integration to create a calculation setup with a parameter list, like so:

    # set the parameter values before running the calculation
    for param in parameters:
        if param.name in df_scenario:
            print(f"Setting parameter {param.name} to {df_scenario[param.name]}")
            param_value = df_scenario[param.name]
            parameter_redef_list.append(o.ParameterRedef(name=param.name, value=param_value, context=param.context))
        else:
            print(f"Parameter {param.name} not found in excel, thus not changed.")
 
    setup = o.CalculationSetup(
        target=o.Ref(
            ref_type=o.RefType.ProductSystem,
            id="faccf12d-b8d3-4f80-8814-b3548681a879",
        ),
        impact_method=o.Ref(id="90c47e13-8fc1-4de1-8319-8917f197bc7f"),
        parameters=parameter_redef_list
    )

I was wondering if there is a way to just update the values in openLCA without running a calculation, because like this values are not actually changed in the database just for the one-time calculation setup and I cannot use the updated values within the openLCA GUI.

I just want to query the Parameters in my product system and then change them to the values queried from the Excel sheet. What I managed to do is to query all processes within the product system, then change the values of the process` parameters and then use client.put(process). This kinda works, but is a bit tedious and I did not find a solution yet for global parameters.

Any help would be much appreciated. Thank you!

in openLCA by (120 points)

Please log in or register to answer this question.

...