Skip to content

Parameters not saved in Analysis classes #2206

@PicoCentauri

Description

@PicoCentauri

In all analysis classes the parameters start, stop, step and verbose are not saved if they are changed after the object was run once.

After looking into the code I found that for the start, stop and step parameters this is an issue due to the fix of the old deprecated syntax. For the verbose one just have to save this in the _verbose attribute of the object. All these things are easy to fix and I could provide a patch.

Code to reproduce the behavior

from MDAnalysis.analysis.lineardensity import LinearDensity
from MDAnalysis.tests.datafiles import PSF_TRICLINIC, DCD_TRICLINIC

u = mda.Universe(PSF_TRICLINIC, DCD_TRICLINIC)
ldens = LinearDensity(u.atoms, verbose=True)

ldens.run(start=0, stop=10)
print(ldens.start, ldens.stop)

ldens.run(start=0, stop=5, verbose=False)
print(ldens.start, ldens.stop)

Currently version of MDAnalysis

Python 3.6, mda 0.19.3, MacOS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions