-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select flow in database by name and provider #7
Comments
The providers cannot be attached to a flow but to an exchange. An exchange is an input or output of a flow in a process. And there it is just a marker for the product system completion algorithms. In general, a provider of a product is a process with this product in an output exchange (and since openLCA 1.6+ a process with a provider of a waste treatment service is a process with a waste flow as input). There are some helper methods in the openLCA core API for finding providers of flows, e.g. from org.openlca.core.database import FlowDao, ProcessDao
from org.openlca.core.matrix.cache import FlowTypeTable, ProcessTable
f_table = FlowTypeTable.create(db)
p_table = ProcessTable.create(db, f_table)
my_product = FlowDao(db).getForName('p1')[0]
p_dao = ProcessDao(db)
for process_id in p_table.getProviders(my_product.id):
process = p_dao.getForId(process_id)
log.info('{}', process.name) |
I tried to use your @msrocka code regarding the implementation of providers for flows in a process. The implementation of a flow in the existing process at my database works find, despite the fact that I can´t implement it with the corresbonding unit [t*km].
`
` |
You are using openLCA 1.6, right? The method |
With Has the command for
` |
Update: As I don´t have much experience with programming, I don´t know whether the different code I wrote is helpful. Nevertheless, I get the same output. I could update an existing process with a new Input (Flow with the corresbonding provider).
|
Getting a flow from the database
elcd_3_2_greendelta_v2_16
is no problem with the following functionBut if the flow has several providers how can I pick one?
For example I can get the flow
transport in t*km
but I cannot choose the providerLorry transport, Euro 0, 1, 2, 3, 4 mix, 22 t total weight, 17,3t max payload - RER
. I don't even know how to verify which provider is assigned to the flow.The text was updated successfully, but these errors were encountered: