activity-browser icon indicating copy to clipboard operation
activity-browser copied to clipboard

Database tree view for databases with ISIC data

Open marc-vdm opened this issue 2 years ago • 1 comments

Remaining TODO

  • [x] Put classifications CSV file in static folder
  • [ ] rename CSV to .txt in case setup.py is case sensitive
    • https://github.com/LCA-ActivityBrowser/activity-browser/blob/d5114f4d33facfbc50c5c81c3bd1d978af7de5b9/setup.py#L9
  • [x] Generate tree from file
  • [x] Link processes to tree whenever database is opened with ISIC classifications --> time how long this will take to create
  • [x] Write UI treeview --> how to deal with search between the tree/list?
  • [x] Implement search
  • [x] re-add functionality of drag/drop
    • [x] single activities
    • [x] multiple activities
  • [x] context menus --> include expand/collapse options
  • [ ] bug: don't open activities on double-click on root/branch, only activities
  • [ ] key col. empty?
  • [ ] Move things to superclass for shared method/activity class where possible
    • Most important is DF search if possible, this will simplify and speed up search significantly
  • [ ] Link widget signals to update search settings for following signals (#785):
    • signals.new_activity.connect()
    • signals.duplicate_activity.connect()
    • signals.duplicate_activities.connect()
    • signals.duplicate_activity_to_db.connect()
    • signals.delete_activity.connect()
    • signals.delete_activities.connect()
  • [ ] Add proper docstrings
  • [ ] Nice to have: Implement cell (row?) tooltips like #1130

Feature:

Resolves #632

  • Automatically adds tree view option to a database tab when at least 1 activity with an ISIC class is present.
  • Has different search capabilities, can return search results for any item in the tree, also does not apply the list filters present in the list.
  • ~~Has all normal functionality present in the list view~~ (WIP)

image

Checklist

  • [ ] Keep pull requests small so they can be easily reviewed.
  • [ ] Update the documentation, please follow the numpy style guide
  • [ ] Update tests.
  • [x] Categorize the PR by setting a good title and adding one of the labels: bug, feature, ui, change, documentation, breaking, ci as they show up in the changelog
  • [x] Link this PR to related issues.

marc-vdm avatar Sep 22 '23 09:09 marc-vdm

Coverage Status

coverage: 55.287% (-0.9%) from 56.137% when pulling 5787787cde09f6652506251025e5dfdd27ea5945 on marc-vdm:database_tree_view into 0dca40453d3274107977710bdc56d30a99e61258 on LCA-ActivityBrowser:main.

coveralls avatar Sep 22 '23 09:09 coveralls

@mrvisscher

I think everything works as intended, but I have one weird issue:

I needed to update MetaDataStore for duplication explicitly (https://github.com/LCA-ActivityBrowser/activity-browser/pull/1047/commits/3c804a40d2ca9a74458c9ec8a9695fc4e73482ba), which was added to the Action instead of the proxy, this is probably not right, but couldn't make sense of it otherwise.

The reason I needed to add this is because while the tree updates to show the duplicated activity, it does not update the classifications field, thus adding the activity to no classification instead of the tree branch it should go under. Now that I added these MetaDataStore updates, it works as it should, but probably not in a way it should be implemented.

I think the issue is somewhere in the MetaDataStore, but haven't figured it out yet.

marc-vdm avatar Jun 07 '24 20:06 marc-vdm