CIRAIG / brightway2-aggregated

Extension to Brightway2 LCA framework to create and work with aggregated data
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Creation of the unit process database to be aggregated #1

Open moritzos opened 3 weeks ago

moritzos commented 3 weeks ago

I would like to use Brightway2-aggregated (bw2-agg) to generate aggregated (cradle-to-gate) LCIA scores for production activities according to the CML method. These aggregated LCIA scores shall be used for further LCA calculations, among others using ecoinvent 3.9.1, premise and the Activity Browser. My issue concerns the creation of the unit process database as basis for the DatabaseAggregator. As I understand the bw2agg documentation, I need to set up a database with the unit processes (in my case the production activities) and its aggregated LCIA scores. For this purpose I created a excel sheet (see atteched screenshot), which I want to import in Brightway2 using the ExcelImporter. The excel sheet contains the output of the production activity (exchange type: production) as well as its LCIA impact scores (exchange type: biosphere) as exchanges. To create a bw2 database including this activity, I need to link the biosphere exchanges to a database. Otherwise I cannot use the .write_database() function to create the bw2 database, as I have unlinked biosphere flows. So my question is, how to link the impact scores (so the biosphere flows) to database, and to which database so that

In general, I use the biosphere database of ecoinvent 3.9.1. in this project, but of course it does not contain the LCIA impact score biosphere exchanges.

excelsheet_screenshot
moritzos commented 3 weeks ago

@PascalLesage or @cmutel do have an advice for me?

cmutel commented 3 weeks ago

I guess Pascal is not paying attention to Github mentions much anymore 😄

I think the point of bw2agg is to generate these new biosphere flows (representing LCIA scores) for you directly, so you don't need to worry about them yourself. In the end, it isn't that tough to loop over the processes in a database, store their scores, and then assign those scores to a new biosphere flow. So you should just import your unit process data as normal, the new elementary flows come later.

When rewriting bw2agg for 2.5 (see https://github.com/brightway-lca/bw_aggregation), I made it possible to have one database which can use both aggregated or normal unit process inventories depending on flags passed at runtime. I plan to extend this to use LCIA scores instead of "system" processes soon. BTW, this is for 2.5, but we also have the Activity-Browser running on 2.5 (https://github.com/cauldron/activity-browser/tree/brightway25), and expect to have an official release soon.

moritzos commented 3 weeks ago

Many thanks for the quick reply and the note on bw2.5, @cmutel. The problem is that I only have information about the LCIA scores for the unit processes. Unfortunately, I do not have any data on technosphere and/or biosphere flows that I could link to the ecoinvent database. As I understand it (but please correct me), I therefore cannot import the unit process data "as normal" and have to generate the LCIA scores myself as biosphere flows in the excel sheet. However, I don't know how I can link the biosphere flows (which represent the LCIA scores) to a database via the "databases" column in the excel sheet so that all flows are linked and I can generate the bw2 database (with .write_database() function). Is it an option to extend the existing biosphere database from ecoinvent in the project with the biosphere flows from the excel sheet? If so, how can I do this?

romainsacchi commented 1 week ago

Hi, @moritzos, I am not familiar with this library, but I think it was designed to go from a disaggregated database/datasets to a bunch of aggregated ones. You're trying to import an aggregate dataset (only containing LCIA flows as "inputs") and this might be problematic since these flows do not exist in the biosphere database.

Maybe, what you can do is aggregate a random dataset in the database to LCIA scores and add the resulting LCIA "flows" to the biosphere database as described here: https://brightway2-aggregated.readthedocs.io/en/latest/tech_ref.html#adding-unit-impacts-exchanges-to-biosphere-and-unit-impact-characterization-factors-to-methods

This way, the LCIA "flows" will exist in the biosphere database, and you should then be able to import your aggregated datasets containing LCIA flows. Does that make sense?