Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI: Inventory table reordered by string not float #231

Closed
Athunc opened this issue Apr 9, 2019 · 9 comments
Closed

GUI: Inventory table reordered by string not float #231

Athunc opened this issue Apr 9, 2019 · 9 comments

Comments

@Athunc
Copy link
Contributor

Athunc commented Apr 9, 2019

A minor issue: In the MLCA results Inventory Table, reordering the table by the content of a column which contains only numbers, orders them as strings, meaning by alphabetnumerical sequence rather than quantity.

@Athunc Athunc changed the title GUI: reordering inventory table by string not float GUI: Inventory table reordered by string not float Apr 9, 2019
@dgdekoning
Copy link
Contributor

I don't think this is the case.

When sorting by one of the functional units it sorts the entire table by that column, if there are other functional units their ordering is also altered to reflect the changed rows caused by the sort.

Can you give an example of the ordering being done incorrectly?

@nheeren
Copy link

nheeren commented Aug 8, 2019

I think this example / screenshot illustrates the issue nicely. Numbers are not sorted correctly. Numbers with scientific notation come before the ones with decimals, although their value is smaller.

Screenshot 2019-08-08 at 13 12 09

@dgdekoning
Copy link
Contributor

Thanks! It looks like this is one of the tables from the activity tab, right?

@nheeren
Copy link

nheeren commented Aug 8, 2019

Yes, but i think it also occurs in other tables.

@dgdekoning
Copy link
Contributor

I wonder if this has to do with the differences between the implementations of the ABTableWidget (QTableWidget) class and the (renamed since yesterday) ABDataFrameView (QTableView) class.
Switching over to a single implementation for all tables is something @bsteubing has been wanting to do for a while.

Looking a bit deeper I think the sorting issue is caused by formatting the amounts as a string, at least for ExchangeTable tables. Which does indeed mess up sorting.

@dgdekoning
Copy link
Contributor

With all of the tables refactored to use view classes (which will actually show values as floats, booleans, strings, integers) I think this issue is now resolved. Will close it when the new stable version is released.

@dgdekoning
Copy link
Contributor

Fixed in 2.3.3

Please give me a heads-up if this occurs again.

@nheeren
Copy link

nheeren commented Sep 19, 2019

Similar issue, different place. I noticed in the 'LCA results' > 'Process Contributions' table, when I click on the LCIA score for sorting and after that change the cut-off, the order will get messed up. Not a big deal, but I thought I'll mention it...

Screenshot 2019-09-19 at 23 21 16

@dgdekoning
Copy link
Contributor

The issue now isn't so much that the order is being messed up but that the sorting isn't being re-applied when the table is changed.

Altering the cut-off causes AB to completely rebuild the underlying DataFrame (ordering it by index by default as you see in the image).

I'm thinking that the relevant model or the view class can be improved by checking if sorting has been performed before it rebuilds the table and then applying the correct sorting afterwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants