+1 vote

the following code is what I used. I found the update in another question that fixed the problem of the USE_DEFAULT_ALLOCATION being undefined. restarted OLCA and IPC when I test the same product system with the default and economic allocation, the result is the same through IPC, but different when using the calculation dialog box (the 'none' allocation selection from the dialog box in oLCA gives the result found with IPC).
tst =['product system name']
for sc in tst:
# create the calculation setup
    setup = olca.CalculationSetup()

# define the calculation type here
# see http://greendelta.github.io/olca-schema/html/CalculationType.html
    setup.calculation_type = olca.CalculationType.CONTRIBUTION_ANALYSIS
    setup.allocation_method = olca.AllocationType.ECONOMIC_ALLOCATION
# select the product system and LCIA method
    setup.impact_method = client.find(olca.ImpactMethod, 'ReCiPe 2016 Midpoint (H)')
    setup.product_system = client.find(olca.ProductSystem, sc)

# amount is the amount of the functional unit (fu) of the system that
# should be used in the calculation; unit, flow property, etc. of the fu
# can be also defined; by default openLCA will take the settings of the
# reference flow of the product system
    setup.amount = 1.0
# calculate the result and export it to an Excel file
    result = client.calculate(setup)
    client.excel_export(result, sc + 'ea.xlsx')

# the result remains accessible (for exports etc.) until
# you dispose it, which you should always do when you do
# not need it anymore

in openLCA by (720 points)

Please log in or register to answer this question.