Hi, I'm trying to create a flow (eg, 316steel) and I want to categorize the flow with the existing category (eg, manufacture of metal material) using olca-ipc.
But I couldn't achieve it. The code didn't report an error, but the 316steel wasn't still in the manufacture of metal material.
The code:
import olca
import uuid
client=olca.Client(8080)
category = olca.Category()
category.id = str(uuid.uuid4())
category.name = 'manufacture of metal material'
category.model_type = olca.ModelType.FLOW
client.insert(category)
steel = olca.Flow()
steel.category = category
steel.id = str(uuid.uuid4())
steel.flow_type = olca.FlowType.PRODUCT_FLOW
steel.name = "steel316"
steel.description = "Added from the olca-ipc python API..."
mass=client.find(olca.FlowProperty, 'Mass')
mass_factor = olca.FlowPropertyFactor()
mass_factor.conversion_factor = 1.0
mass_factor.flow_property = mass
mass_factor.reference_flow_property = True
steel.flow_properties = [mass_factor]
I believe something is wrong with my code. I hope to find the errors in the code.
Thanks!