I am trying to use python to change the values of 3 global parameters and then export the result to a csv file. I have followed the tutorials and other questions but it still is not working. I get the same value every time no matter what value the global parameters are supposed to take. I am using version 2.0.alpha2. Anyone know why the parameters are not updating?
setup = olca.CalculationSetup()
setup.parameter_redefs = []
s=0
f=open('Scenario_Results.txt', 'w')
for s in range(0, Num_Scenarios):
setup.parameter_redefs = []
for c in ParName:
redef = olca.ParameterRedef()
redef.name = c
redef.value = int(mydata.at[s,c])
redef.context = olca.ref(olca.ProductSystem, Product_Sys)
setup.parameter_redefs.append(redef)
setup.calculation_type = olca.CalculationType.CONTRIBUTION_ANALYSIS
setup.product_system = olca.ref(olca.ProductSystem, Product_Sys)
setup.impact_method = olca.ref(
olca.ImpactMethod,'3a052635-988a-46f6-ba4a-052ce1623e5e')
setup.amount = 1.0
setup.allocation_method = olca.AllocationType.USE_DEFAULT_ALLOCATION
result = client.calculate(setup)
client.excel_export(result, 'C:/Users/gdilullo/openLCA/jython_ide/workspace/Test_Python/Test Export.xlsx')
client.dispose(result)