ipet icon indicating copy to clipboard operation
ipet copied to clipboard

Use sortlevel argument in evaluation

Open fschloesser opened this issue 7 years ago • 11 comments

Currently 'sortlevel' it is set but not used.

fschloesser avatar Jul 06 '17 09:07 fschloesser

What exactly is this option supposed to do?

fschloesser avatar Jul 17 '17 09:07 fschloesser

Have you read the documentation of sortlevel?

sortlevel : level on which to base column sorting, '0' for group level, '1' for column level

GregorCH avatar Jul 17 '17 10:07 GregorCH

I have, but i don't get it. And group level is not even used anymore.

fschloesser avatar Jul 17 '17 10:07 fschloesser

The column headers consist of >= 1 levels, depending on attributes such as indexsplit. The sortlevel functionality should allow to specify the level of the column keys, by which the resulting long table should be sorted. Implicitly, we currently use a sortlevel of 1, I guess.

GregorCH avatar Jul 17 '17 10:07 GregorCH

You are right, group level is too specific and has been generalized in the mean time (because multiple levels of group keys are possible).

GregorCH avatar Jul 17 '17 10:07 GregorCH

Thank you. So it should just be a pandas call to some kind of sortlevel func in a few lines, right? Does this apply to both aggregated and long table?

fschloesser avatar Jul 17 '17 10:07 fschloesser

Yes, there is a pandas function, (sort_axis, I guess). We are free to do whatever we want. I would suggest that it applies to both data frames, although the meaning would be a bit different for the aggregated table, because the column keys are used for the rows, as well.

GregorCH avatar Jul 17 '17 10:07 GregorCH

There should be, IMHO, the possibilty not to sort, maybe by assigning None to the sortlevel (Note that this should be even the default behavior).

GregorCH avatar Jul 17 '17 10:07 GregorCH

I have dealt with this in 0d5bd2ca19f03abf2bfcb59827398654ce158570

fschloesser avatar Aug 07 '18 13:08 fschloesser

Why did you decide to push this directly instead of creating a merge request?

GregorCH avatar Aug 08 '18 08:08 GregorCH

Because it was a simple thing (i thought). And in this project simple things seem to almost never be done via a pull request.

fschloesser avatar Aug 08 '18 09:08 fschloesser