Dear all,
in my OpenLCA IPC python I have two types of flows (besides in or output ;)): from ecoinvent or not
non Ecoinvent:
mass_flow_property=client.get(schema.FlowProperty, name="Mass") # unit Mass
Substrat_flow=schema.new_flow('Substrat',schema.FlowType.PRODUCT_FLOW,mass_flow_property))
SubstratIn=schema.new_input(WProzess,Substrat_flow,inputs["subst_mass"],'kg')
Ecoinvent
argon_gas=client.get(schema.Flow, "a94ce0ad-46f5-407c-b445-671e353875f0") # Flow Argon fluessig
ArgonIn=schema.new_input(WProzess, argon_gas, argon_mass,'kg')
ArgonIn.default_provider=client.get(schema.Process,"aa6e701a-3728-4375-90b2-0e63eda7a627")
The parameters "argon_mass" and inputs["subst_mass"] are variables regarding amount of flows.
My question is if the proposed lines for new_input is correct to choose 'kg' for those flows? Unfortunately, right now this approach ends up in an error...:
File "C:\...\myscript.py", line 72, in <module>
ArgonIn=schema.new_input(WAMProzess, argon_gas, argon_mass,'kg')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\HorwatitschD\AppData\Local\Programs\Python\Python311\Lib\site-packages\olca_schema\__init__.py", line 255, in new_input
exchange = new_exchange(process, flow, amount, unit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\HorwatitschD\AppData\Local\Programs\Python\Python311\Lib\site-packages\olca_schema\__init__.py", line 229, in new_exchange
exchange.unit = as_ref(unit)
^^^^^^^^^^^^
File "C:\Users\HorwatitschD\AppData\Local\Programs\Python\Python311\Lib\site-packages\olca_schema\__init__.py", line 424, in as_ref
return e if isinstance(e, Ref) else e.to_ref()
^^^^^^^^
AttributeError: 'str' object has no attribute 'to_ref'
Looking at the error messages, it seems that the allocation of the unit hasn´t worked... Does somebody has a clue...??
Kind regards