Open jbarnoud opened 2 years ago
Hey @jbarnoud! Weighted RMSD calculations require weight values for all atoms defined in the list, the way it is implemented. But in the benchmarking test, the parameter of the weights list hasn't been defined correctly corresponding to the number of atoms (contains only 2 values). Suggestions:
num_atoms
elements for corresponding num_atoms
.
Please guide me as I'm new to this stuff. I can take up this issue. For https://github.com/MDAnalysis/mdanalysis/blob/55fa72f34f50294f088fe0a43b75eda792d3d366/benchmarks/benchmarks/analysis/rms.py#L17-L24 I suggest we change weights
to be either True
or None
. We then let setup()
https://github.com/MDAnalysis/mdanalysis/blob/55fa72f34f50294f088fe0a43b75eda792d3d366/benchmarks/benchmarks/analysis/rms.py#L26 either set self.weights
to None
or, for weights==True
, to the weights computed from the masses according to the relative weight formula in the rmsd() docs
self.weights = self.A.masses() / np.sum(self.A.masses())
Then the actual call to https://github.com/MDAnalysis/mdanalysis/blob/55fa72f34f50294f088fe0a43b75eda792d3d366/benchmarks/benchmarks/analysis/rms.py#L46-L50 in time_rmsd()
can be simply
rms.rmsd(a=self.A,
b=self.B,
weights=self.weights,
center=center,
superposition=superposition)
Expected behavior
Benchmarks run without errors.
Actual behavior
The benchmarks for
analysis.rms
fail with the following exceptions: