+1 vote
34 views
Hello,

I am trying to calculate a product system named "Oil" using Python from Spider. Following the tutorial here is the code I use. I set the target amount to different value, however, on the document result4.xlsx the target amount will follow the target amount value set in the openLCA.  So it seems the value set in Spider is not taken into account.

Has it happened to anyone? Could you propose any possible solution on this?

Thank you in advanced!

import olca

client = olca.Client(8080)

setup = olca.CalculationSetup()

setup.parameter_redefs = []

setup.impact_method = client.find(olca.ImpactMethod, 'IPCC 2001')

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

setup.calculation_type = olca.CalculationType.SIMPLE_CALCULATION

setup.amount = 4.0

result = client.calculate(setup)

client.excel_export(result, 'result4.xlsx')
in openLCA by (300 points)

1 Answer

+1 vote
by (6.6k points)
selected by
 
Best answer

I think this is related to this bug in openLCA 1.9. Could you check if this is fixed in the current 1.10.1 version:

http://www.openlca.org/download/ > Latest build

The results should be correctly scaled now. However, in the exported Excel file the amount is still set to the reference amount of the underlying product system and not to the amount of calculation setup (but the results should be correct). I opened this bug entry for this: https://github.com/GreenDelta/olca-app/issues/100

Thanks!

by (300 points)
Hi Michael,
I tried the version 1.10.1 and in this new version the target amount follows the one set in the calculation setup. Indeed the displayed "Amount:" still does not follow the calculation setup.
Thanks a lot for your feedback! I will start using the version 1.10 from now on.
Cheers,
Astu
...