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
8 stars 21 forks source link

Add `nodes_to_dataframe` and `edges_to_dataframe` methods for SQLite databases #109

Closed cmutel closed 2 years ago

cmutel commented 2 years ago

Closes #106. Doesn't work for IO tables.

Chose not to use caching; if you need this, it is easy to add, and the memory hit for normal users is big enough that the benefits don't outweigh the tradeoffs IMHO.

Pinging @romainsacchi @michaelweinold @BenPortner if you want to give input.

cmutel commented 2 years ago

edges_to_dataframe uses the extraction function from wurst, which has good performance. However, for other reasons, wurst loads GIS libraries, which is a bit heavy for everyday installs, so this is optional.

cmutel commented 2 years ago

After some reflection, I think we should move the extraction functions from wurst to bw2data, and leave a shim in wurst. This would make things a bit simpler, while avoiding duplication of code.

cmutel commented 2 years ago

Moved wurst functions to bw2data in 55f107177ead8a73cdf88a5b5be56bf6811bf27f.