+2 votes
850 views

I am attempting to assign an economic allocation method for a calculation setup in using olca.ipc in Python with "setup.allocation_method=olca.AllocationType.ECONOMIC_ALLOCATION" in the below code:

This does seem to work and exports the result table below:

What am I doing wrong?

in openLCA by (160 points)
by (720 points)
I have the same problem. when running through ipc, the calculation is performed without allocation and if I run from the windows interface and choose "none" I get the same answer as with ipc with:
etup.allocation_method = olca.AllocationType.ECONOMIC_ALLOCATION

when I choose economic or as defined in process using the program dialog box, I get a different answer. The ipc server returns an error if i assign setup.allocation_method = olca.AllocationType.USE_DEFAULT_ALLOCATION
by (720 points)
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 syteem with defaule and economic allocation, the result is the same through IPC, but different when using the calculation dialog box (the 'none' allocation gives the result found with IPC).

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
    client.dispose(result)
by (660 points)
Has anyone found a solution to this issue? I can't seem to get the allocation method in IPC working. The following chunk of code does nothing:
setup.allocation_method = olca.AllocationType.ECONOMIC_ALLOCATION

Please log in or register to answer this question.

...