Closed marc-vdm closed 2 months ago
See related discussion here https://github.com/LCA-ActivityBrowser/activity-browser/issues/596#issuecomment-1325671704
https://unstats.un.org/unsd/classifications/Econ/Download/In%20Text/ISIC_Rev_4_english_structure.Txt This tree view should be incorporated in the static files, and then read by AB to build a tree view of the different categories. On the branch https://github.com/marc-vdm/activity-browser/tree/including_classifications there are already some of these classifications loaded for most of the ecoinvent activities. The activities should be grouped under their respective tree view when showing it.
The tree should be built up similar to Impact Categories, and the filtering should be made to work similar to it. When not in the tree view, the categories should not necessarily be shown, although that might be discussed still.
Furthermore, dragging and dropping activities should still be possible: dragging a parent tree level should drag and drop all child levels.
Finally, it might be useful to make the tree view code work more general, i.e. to reuse the same class when building the tree view of different things.
Databases that do not have these classifications loaded, should disable the tree view. Databases always load in list view by default.
One more thing:
It may be good to check out whether it's smart to move the storage of the data up to the
Ok, so we get the data from ActivityBiosphereWidget
instead of having two dataframes, one for the tree and one for the list, but perhaps that's not a problem at all since we already use the MetaDataStore
. Happy to think along on this you want.df_from_metadata(self, db_name: str) -> pd.DataFrame:
, you can probably do something similar in the treeview to get the data, probably all you need is df = AB_metadata.get_database_metadata(db_name)
, though you may need to transform the data from a pd.DataFrame
to a dict
or something.
On the branch https://github.com/marc-vdm/activity-browser/tree/including_classifications there are already some of these classifications loaded for most of the ecoinvent activities.
The classifications are now available in master
, so no need to base the branch of my fork, just from master
is fine 👍
Resolved in #1047
[!NOTE] This issue has been implemented in the new release of Activity Browser 🚀 (version 2.10.0), you can get the new version by updating Activity Browser.
Do you want to be notified of new releases of Activity Browser? Subscribe to our updates mailing list ✉.
🤖 beep boop! I'm a bot and this message was an automated action. If updating does not make sense for this issue, just ignore this.
As discussed a few times, a tree view for databases would be nice to have, this could be based on some classification system already present in databases like ecoinvent.
For whoever picks this up: Through other work, I found that the classifications are stored in the Metadatastore:
This
db
object is a Pandas Dataframe, with a columnclassifications
. Each entry is a list in which the classifications are stored as tuples:(name of classification, class)
Hope that saves some work for whoever picks this up.
TODO