Replies: 6 comments
|
Given that we are using pandas.DataFrame, using .loc should be able to pinpoint the exact point. So we could say that it is not enforced. |
|
Do we want to start with adding sorting but not necessarily guarantee anything? We just have to make sure that docs, examples, and alchemlyb and the tests are all using .loc. |
|
@orbeckst Absolutely, I was checking it and have changed a couple of tests but they failed so I might need to diagnose some issue. |
|
I was trying to replace the iloc with loc and there seems to be some issue with doing this in the dev side. For the user, this is not an issue as the user would know the lambda states, but for the developer, the lambda states are unknown. The way to get it is via To resolve the issue in #201, we could do So I think in the code we can still keep the iloc |
|
I don't quite follow your comment:
In PR #201 we disabled sorting if I read alchemlyb/src/alchemlyb/parsing/namd.py Line 269 in 11033ee concat(sort=True) did not actually work) so that our dataframes are not sorted (at least in the NAMD parser).
@xiki-tempula can you point me to the code where we are actually sorting the df? By the way, this line alchemlyb/src/alchemlyb/parsing/namd.py Line 304 in 11033ee sort=False, too?
|
|
@orbeckst |
Uh oh!
There was an error while loading. Please reload this page.
In the context of #201 it became apparent that the order of columns in a DataFrame can become important if care is not taken to access the correct columns via
.loc(and instead.ilocis used, assuming a specific ordering of columns).#201 (comment) raises the question if alchemlyb should (or can) make guarantees about how dataframes are structured.
The Standard Forms of Raw Data only state what the column labels are but not the order. The examples seem to imply that, for instance, lambda columns are ordered from 0 to 1, but this is not actually stated, and hence no guarantee is actually made.
All reactions