0 votes
27 views

Greetings,

I am using python with openLCA with an IPC server. I am currently trying to update the parameters that I have set for a process in order to see the changes in the results.

First, I created a process in the openLCA interface. This process has a local parameter p1 that has a standard value of 5e7

Then, I created a product system for this process and added the local parameter from the original process.

Now here is the issue: the values that I use to update p1 do not impact the results (i am using ReCiPe 2016 v1.03, endpoint (H)).

Here is my python code. Am I doing something wrong? (I am trying to update the parameter value using  redef.value = ... ).


import olca_ipc
import olca_schema as o

client = olca_ipc.Client(8080)

product = client.get(o.ProductSystem,"01e10557-8555-4681-bc02-663c58b36af6")
parameter = client.get_parameters(o.ProductSystem, product.id)[0]
method = client.get(
    o.ImpactMethod, name="ReCiPe 2016 v1.03, endpoint (H)"
)
setup = o.CalculationSetup()
redef = o.ParameterRedef()
redef.name = parameter.name
redef.value = 3333
redef.context = parameter.context
setup.parameter_redefs = [redef]

setup.target = product
setup.impact_method = client.get(o.ImpactMethod, name="ReCiPe 2016 v1.03, endpoint (H)")
result = client.calculate(setup)
result.wait_until_ready()
impacts = result.get_total_impacts()
print(impacts[0].amount)

Thanks in advance!

in openLCA by (120 points)

Please log in or register to answer this question.

...