brightway-lca / brightway2-data

Tools for the management of inventory databases and impact assessment methods. Part of the Brightway LCA framework.
https://docs.brightway.dev/
BSD 3-Clause "New" or "Revised" License
11 stars 24 forks source link

Add event tracking to projects #174

Closed jsvgoncalves closed 2 weeks ago

jsvgoncalves commented 5 months ago

This PR adds event sourcing to brightway2-data.

It does this by:

  1. creating a parent ORM class, SignaledDataset, that other ORM classes can inherit from.
  2. adding signals for events which can be used to source the database
  3. adding a revisions to each project, that use snowflake ids for distributed id generation
{
"metadata": {
  "revision": <this-revision-id>
  "parent_revision": <parent-revision-id>
  "title": "<optional>"
  "description": "<optional>"
  "authors": "<optional>" (maybe shouldn't be optional)
},
"data": […]
}
jsvgoncalves commented 2 weeks ago

@cmutel @bbguimaraes have fun with the 2k lines, kthxbye.

No seriously, please just have (yet) another look, and I suggest we merge this (no-ff please) so that we can then also merge in #202. Any issues found during more extensive testing can be handled in their own PRs.