Open xiki-tempula opened 6 months ago
That is really interesting, can you share the data that reproduces this? Does it happen consistently?
The data comes from the package alchemtest, you can just pip install it.
conda create -n test -c conda-forge alchemlyb
conda activate test
pip install alchemtest
Thanks! (I wasn't playing enough attention and just assumed the pandas data frame came from disk or something)
Just happened to me and digging a bit it's fixed changing the following line in mbar.py:
uzero = u_kn[k, indices] - u_kn[l, indices]
to
uzero = u_kn.iloc[k, indices] - u_kn.iloc[l, indices]
because k, l and indices are 0-based indices coming from the execution of the builtin range() and np.arange() and not values from the index or columns of u_kn.
I'd be a little careful about changing lines in pymbar without checking effects on everything else. More likely to be something off with the way that alchemlyb is passing data into pymbar?
Let me be more precise. pymbar doesn't used pandas, so if it's a pandas error, it has to do with what is being passed into pymbar, i.e. something weird with the way the pandas dataframe is being interpreted as a numpy array as pymbar, which is not really a pymbar error, since it's expecting a numpy array - it's an issue with the way pandas are being cast as numpy arrays.
I see. That's easy to solve then I shall just convert this to a numpy array.
But it is still weird why would this only happen when verbose=True
That whole block is inside an if verbose=True
clause
I see. Then casting the input to numpy array should be good.
works but
Gives