I am trying to update the allocation factors using python. I can find the allocation values but I do not know how to relate the internal exchange id to the actual table. Below is the casual allocation table with confidential numbers removed. How to a link the internal id to the flows? In my code below I examined the properties of "c" and the product only tells my the column header (1-Bioethan...), and the exchange which I believe is related to the rows (Alpha amylase) only provides a internal id. Is there anyway to relate the internal id to the flow? Can I use the exchange id somehow to identify the flow? I have looked at the https://greendelta.github.io/olca-ipc.py/olca/index.html but I can't seem to figure out how the exchange relates to the flow.
import olca
from olca.schema import Process, Exchange
from olca import _allocation_of
from olca.ipc import ModelType
client = olca.Client(8080)
Production = client.find(Process, '1- Bioethanol production, at bioethanol plant')
Production2 = client.get(Production.olca_type, Production.id, Production.name)
print(Production2.olca_type)
x=Production2.allocation_factors
with open('readme.txt', 'w') as f:
for line in x:
f.write(str(line))
f.write('\n')
for c in x:
if c.allocation_type.name == 'CAUSAL_ALLOCATION':
print(c.value)