GreenDelta / olca-ipc.py

Mozilla Public License 2.0
29 stars 17 forks source link

Implement schema entities as dataclasses #15

Closed Miguel-g-c closed 3 years ago

Miguel-g-c commented 3 years ago

This PR implement openLCA entities as dataclasses. In order to do that, 3 main changes were implemented:

  1. scripts/genmodel.py was modified in order to produce dataclasses from the latest olca-schema yaml files.
  2. A new olca/schema.py file was generated with the previous script.
  3. In olca/ipc.py dataclasses were also introduced for ProductResult and ContributionItem. Finally, ProcessRef was modified to Ref.

The changes were tested running every test. All tests were passed without problems.

Miguel-g-c commented 3 years ago

The required changes have been introduced. Also, typing List and Tuple have been changed for stdlib list and tuple that now supports [] since version 3.9.