diff --git a/package/MDAnalysis/analysis/polymer.py b/package/MDAnalysis/analysis/polymer.py index 7a0510eab0..0d832d1198 100644 --- a/package/MDAnalysis/analysis/polymer.py +++ b/package/MDAnalysis/analysis/polymer.py @@ -317,7 +317,7 @@ def fit(self): def _conclude(self): norm = np.linspace(self.chainlength - 1, 1, self.chainlength - 1) - norm *= len(self._atomgroups) * self._trajectory.n_frames + norm *= len(self._atomgroups) * self.n_frames self.results.bond_autocorrelation = ( self.results.raw_bond_autocorr / norm ) diff --git a/testsuite/MDAnalysisTests/analysis/test_persistencelength.py b/testsuite/MDAnalysisTests/analysis/test_persistencelength.py index 54005c8a66..cd11071ee3 100644 --- a/testsuite/MDAnalysisTests/analysis/test_persistencelength.py +++ b/testsuite/MDAnalysisTests/analysis/test_persistencelength.py @@ -72,6 +72,10 @@ def test_ag_ValueError(self, u): def test_run(self, p_run): assert len(p_run.results.bond_autocorrelation) == 280 + def test_run_partial(self, p): + p.run(start=0, stop=2) + assert_almost_equal(p.results.bond_autocorrelation[0], 1.0, 3) + def test_lb(self, p_run): assert_almost_equal(p_run.results.lb, 1.485, 3)