Closed jacobtriestocode closed 1 month ago
Many thanks for reporting this error. The reason for this is that the underlying JSON format for categories changed now in openLCA 2 (the example works because it has no category). We need to update the IPC model for this which is generated from the JSON schema. As this is a breaking change for the Python class model, we need to do this in a different branch / version. For now, the only workaround is to switch to an older dev-version of openLCA 2 in the archive
directory of the distribution folder. But we will update this very soon...
For now, I found the last version where this wasn't an issue was the 2022-02-18 alpha release.
Thank you guys for the response, I'll watch for updates to the IPC code.
An error occurs when using Client.get(olca.Process, process.id) on some processes and doesn't occur for other processes. This error occurs in the latest alpha version of OpenLCA (2.0.0.alpha4). When the same database (before upgrading for the new version of OpenLCA) is used in the stable version (1.11), it doesn't. This error can be replicated in at least one of the free databases from openLCA Nexus by using the example code that I have included below. The Nexus database is the ELCD database and can be downloaded from here:
https://nexus.openlca.org/database/ELCD
A process from another database (used internally) has also been attached and can be imported into OpenLCA to demonstrate a process where the error does not occur in the 2.0.0.alpha4 build. The example code below tries to access a process from ELCD and the importable process, getting the AttributeError each time when using Client.get() on the ELCD process and not getting the error for the imported process (you might need to comment out the error throwing code if testing outside of a Jupyter notebook):
The 'Corn Grain_1' process can be imported with this OpenLCA format zip
CropLifeAmerica.zip