Hey :)
I experience the same issue like in Results between OpenLCA and OLCA-IPC differ.
I am using the ecoinvent 3.9.1 consequential upr data, OpenLCA 2.0.4 and olca 2.0.2 .
I experience this issue with the original market electricity processes. I create product systems within openlca and use the specific id to calculate with olca. For all electricity processes I have tested so far, I get different results in OpenLCA ('calculate') and olca. I double checked the impact method. I have the feeling, that olca does not recognize or include all provider contributions.
I created the procut system from this process: 'ebd1677d-a57c-3309-aefe-be1cd88f68a1' with the following setting: Linking approach during creation: Prefer default providers; Preferred process type: System process
Here is the code:
import olca_ipc as ipc
import olca_schema as o
import pandas as pd
def lcaproductsystem(id):
impact_categories = []
product_system = [id]
# create a calculation setup
setup = o.CalculationSetup(
target=o.Ref(
ref_type=o.RefType.ProductSystem,
id=id,
),
impact_method=o.Ref('c99194f6-351f-425a-82eb-6cd9654cefca'),
)
# run a calculation
client = ipc.Client()
result: ipc.Result = client.calculate(setup)
state = result.wait_until_ready()
result.get_impact_categories()
impact_category_ref = o.Ref(
ref_type=o.RefType.ImpactCategory,
id='6446ccbd-fd85-4332-95aa-d6107b3ceef6' # ID of the impact category
)
results = result.get_total_impacts()
contributions = result.get_impact_contributions_of(impact_category_ref)
impact_categories = [(str(n.impact_category.name)) + ' ' + str(n.impact_category.ref_unit) for n in results]
df = pd.DataFrame(columns=product_system, index=impact_categories)
df[str(product_system)] = [n.amount for n in results]
result.dispose()
return df, contributions
x = lcaproductsystem(id = '623ac099-df08-4abe-b534-769710b7ea77')