0 votes
84 views
Hi,

I'd like to run several direct calculations of the same process where only the provider of a certain flow changes from one run to the next.

I'd like to do this in bulk using a python script to set the correct provider for my flow and then launch the calculation for my process.

Can anyone suggest a script which I could get inspired from ?

Thanks a lot,

Laurent

PS : maybe being more specific about what I want to do will help...

I have a simple process "manufacturing dummy_product" which contains the flow "raw_material". This flow can have multiple providers, each standing for one raw material (wool, polyester, carbon fiber etc...).

I'd like to write a script which launches N successive direct calculations of my process "manufacturing dummy_product" using each time one of N providers for the flow "raw_material" for each possible RM.
in openLCA by (240 points)

1 Answer

0 votes
by (760 points)

If you work with the python ipc API, then you can find the syntax here: https://greendelta.github.io/olca-ipc.py/olca/index.html

In general (in a loop), you have to select the exchanges for your raw materials and use

exchange.default_provider = client.get(olca.Process, 'UUID') to set the default provider.

Then you need to update your process ( client.update(process) ), calculate and store your results somewhere (in a dataframe?).

by (240 points)
Great !
Thanks Juian for the link and the hints about the program structure. I'll try to manage from there!
...