0 votes
526 views

Hi, I am trying to modify the value of a parameter in python. However, I am getting the following error : "'NoneType' object has no attribute 'append'". What can i do?

this is my code to change the parameter "Test_Parameter" value to 2000 :

import olca client = olca.Client(8080)

setup = olca.CalculationSetup()

redef = olca.ParameterRedef()

redef.name = 'Test_Parameter'

redef.value = 2000

setup.parameter_redefs.append(redef)

setup.calculation_type = olca.CalculationType.SIMPLE_CALCULATION

setup.impact_method = client.find(olca.ImpactMethod, 'ReCiPe Midpoint (H)')

setup.product_system = client.find(olca.ProductSystem, 'Test_Process')

setup.amount = 1.0

result = client.calculate(setup)

client.excel_export(result, 'result4.xlsx')

many many thanks in advance,

in openLCA by (160 points)

1 Answer

+2 votes
by (480 points)

Hi... maybe try adding this statement before "redef = olca.ParameterRedef()"

setup.parameter_redefs = []

...