A small improvement in consistency within pymbar would improve usability in alchemlyb.
Backgound
Although the input, u_kn, for MBAR is defined to be a np.ndarray, it is converted to an array in line 239 with:
self.u_kn = np.array(u_kn, dtype=np.float64)
Packages (i.e., alchemlyb) then instead will pass a pd.DataFrame and find that all works as expected due to this conversion.
Problem
When MBAR.fit(verbose=True) is used, there is an indexing error if the provided u_kn is a pd.DataFrame. This is because of line 296:
uzero = u_kn[k, indices] - u_kn[l, indices]
where u_kn is used instead of self.u_kn.
Solution
If self.u_kn were used in this line instead of u_kn, the users of alchemlyb would be able to benefit from the option, verbose=True.
A small improvement in consistency within pymbar would improve usability in alchemlyb.
Backgound
Although the input, u_kn, for MBAR is defined to be a np.ndarray, it is converted to an array in line 239 with:
self.u_kn = np.array(u_kn, dtype=np.float64)
Packages (i.e., alchemlyb) then instead will pass a pd.DataFrame and find that all works as expected due to this conversion.Problem
When
MBAR.fit(verbose=True)
is used, there is an indexing error if the provided u_kn is a pd.DataFrame. This is because of line 296:uzero = u_kn[k, indices] - u_kn[l, indices]
where u_kn is used instead of self.u_kn.Solution
If
self.u_kn
were used in this line instead ofu_kn
, the users of alchemlyb would be able to benefit from the option,verbose=True
.