GreenDelta / olca-app

Source code of openLCA
openlca.org
Mozilla Public License 2.0
194 stars 43 forks source link

upstream providers not included in product system || Jupyter Notebook #142

Closed R2D2-ad closed 2 years ago

R2D2-ad commented 3 years ago

Hello everyone.

I recently watched the Webinar from Julian Rickert, 'Using Jupyter Notebooks witn openlca' and I find it to be a very interesting approach. I am trying to do a simple example (making tea example), using his notebook codes, with some adjustments, I created the product systems that i want from the processes but when I check their Model Graph, I see that there is no connection between the processes.. Any thoughts? I would appreciate any guidance, since I am new in this topic.

Thanks a lot.

ju1ianr commented 3 years ago

Hi! :) In the webinar, I didn't set any providers, as the webinar was more about the automatic creation/import of processes (without any focus on the providers). However, you can set the providers via olca-ipc as well (and you probably should): The important thing here is to differentiate between flows and exchanges. Exchanges are the in- and outputs of processes. Flows are "part of" exchanges, and you can set the default provider of any exchange upon creation, for example for a new exchange object with the name "exchange".

exchange.default_provider = client.get(olca.Process, ##process.ref##)

Of course, you need to change ##process.ref##, e.g. to the UUID of the providing process.

You can read more, here: https://greendelta.github.io/olca-ipc.py/olca/schema.html#olca.schema.Exchange

Kind regards Julian