Hello there,
First attempt to contribute to code development in the bw2 community, after the encouraging brightcon'
In a previous project, I have used the traverse_tagged_database function to group my foreground results by tags, when I had only one foreground database. Now, I have a much larger project, and to keep things sorted in the Activity-Browser, I created several foreground databases (machinery, biomass, pyrolysis, use1, use2, use3, use4, use5) and I use ecoinvent as a background database.
So, I made a first attempt to edit the function, adding a parameter fg_databases. If the parameter fg_databases is set to a list of databases, they are all considered in the traverse. Otherwise, the function behaves as in previous version. I am also trying to make sure that fg_databases does not include all databases involved in a given activity, to avoid recursing through the background database (but we can't prevent a user from adding a large database like ecoinvent anyway to the fg_databases).
As far as I've tested this small change, it seems to work fine for my needs.
Maybe there are some improvements to do - or should the new functions have a new name (like for multi_traverse) instead of overriding the current functions?
@ntropy-esa Sorry, I simply did not see this until now, thanks a lot! This will be in the upcoming 0.11.1 release, we need tests to make sure it works as expected.
Hello there, First attempt to contribute to code development in the bw2 community, after the encouraging brightcon'
In a previous project, I have used the
traverse_tagged_database
function to group my foreground results by tags, when I had only one foreground database. Now, I have a much larger project, and to keep things sorted in the Activity-Browser, I created several foreground databases (machinery, biomass, pyrolysis, use1, use2, use3, use4, use5) and I use ecoinvent as a background database.So, I made a first attempt to edit the function, adding a parameter fg_databases. If the parameter fg_databases is set to a list of databases, they are all considered in the traverse. Otherwise, the function behaves as in previous version. I am also trying to make sure that fg_databases does not include all databases involved in a given activity, to avoid recursing through the background database (but we can't prevent a user from adding a large database like ecoinvent anyway to the fg_databases).
As far as I've tested this small change, it seems to work fine for my needs.
Maybe there are some improvements to do - or should the new functions have a new name (like for multi_traverse) instead of overriding the current functions?