GreenDelta / olca-ipc.py

Mozilla Public License 2.0
29 stars 17 forks source link

Adding to a custom category #28

Closed pwierzgala closed 1 year ago

pwierzgala commented 1 year ago

Problem definition

I'd like to create a process in a specified directory (category) but it works only for directories that exist before running the code. I am not sure if it's a bug or feature. Could you tell if it is possible to create an OpenLCA directory using olca-ipc 2.0.0? I expected that when the category attribute is specified for a process then the specified path will be created if it doesn't exist.

Sample code

import olca_ipc as ipc
import olca_schema as o

process = o.Process()
process.id = '111'
process.name = 'my_name'
process.category = 'my_category' 

client = ipc.Client()
status = client.put(process)
print(status)

Versions

OpenLCA 2.0.0
olca-ipc==2.0.0
olca-schema==0.0.11
msrocka commented 1 year ago

Right, this is an error in openLCA which should be fixed in the next version. We will upload a version with this fix to the latest build folder beginning of next week.

bogus-bill commented 1 year ago

Hello @msrocka, this would be of huge help for us thanks very much 🙏

msrocka commented 1 year ago

@pwierzgala @bogus-bill it should be fixed in the latest development version which can be downloaded here: https://share.greendelta.com/index.php/s/76uAFtMKDIWGoXC (this folder is also linked under the latest builds tab of the openLCA download page)