Sorting Contribution Analysis tables better #887
Labels
feature
Issues/PRs related to a new feature
good first issue
Issues to get started with AB development with
prio:low
Issues that are low priority
Milestone
Currently, results tables in
EF contributions
andProcess contributions
sort the data (and also the graphs) based on the first data (numbers) column large >> small. While this is nice, it may be nicest to sort on the larges contributor in total. We could achieve this by temporarily creating a new column in the pandas df that takes themax()
of the row, and sort the table on that. As these tables are generally not large, this extra step should not take any meaningful time.Sorting the data like this would allow AB to show data based on the most relevant contributors in general, not just for the first process shown. e.g. the figure below, which is sorted on the lowest bar in the graph (and first column):
We could instead sort on the largest contributors in total, like the excel example below:
This should be done here:
activity-browser/activity_browser/bwutils/multilca.py
Line 393 in 1715a17
ca.sort_array()
both sorts and filters the data. We can re-sort afterwards with the improved sorting.we can sort like this (source):
For the second sorting on this col, we can assume almost sorted arrangement, and thus we should use Timsort, as explained here
The text was updated successfully, but these errors were encountered: