# Buggy code
def __init__(self, universe, selection1, selection2, t0, tf, dtmax, nproc=1):
    self.universe = universe
    self.selection1 = selection1
    self.selection2 = selection2
    self.t0 = t0
    self.tf = tf - 1
    self.dtmax = dtmax
    self.nproc = nproc
    self.timeseries = None


# Traceback (NameError)
ts= 1
ts= 2
/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/base.py:116: DeprecationWarning: Setting the following kwargs should be done in the run() method: start, stop
DeprecationWarning)
/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/base.py:116: DeprecationWarning: Setting the following kwargs should be done in the run() method: start, stop
DeprecationWarning)
/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No acceptors found in selection 2. You might have to specify a custom 'acceptors' keyword. Selection will update so continuing with fingers crossed.
warnings.warn(errmsg, category=SelectionWarning)
/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No donors found in selection 2. You might have to specify a custom 'donors' keyword. Selection will update so continuing with fingers crossed.
warnings.warn(errmsg, category=SelectionWarning)
error
trying again
Process Process-1:
/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No acceptors found in selection 2. You might have to specify a custom 'acceptors' keyword. Selection will update so continuing with fingers crossed.
warnings.warn(errmsg, category=SelectionWarning)
/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py:650: SelectionWarning: No donors found in selection 2. You might have to specify a custom 'donors' keyword. Selection will update so continuing with fingers crossed.
warnings.warn(errmsg, category=SelectionWarning)
Process Process-2:
Traceback (most recent call last):
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/waterdynamics.py", line 659, in _HBA
sys.stdout.flush()
NameError: name 'sys' is not defined
Traceback (most recent call last):
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/waterdynamics.py", line 653, in _HBA
h.run(verbose=verbose)
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/hbonds/hbond_analysis.py", line 936, in run
verbose=kwargs.get('verbose', False))
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/lib/log.py", line 350, in __init__
assert numsteps > 0, "numsteps step must be >0"
AssertionError: numsteps step must be >0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/biggin/b131/bioc1523/software/anaconda/python3.6/2019.7/envs/all/lib/python3.7/site-packages/MDAnalysis/analysis/waterdynamics.py", line 658, in _HBA
sys.stdout.flush()
NameError: name 'sys' is not defined

# Fixed code
def __init__(self, universe, selection1, selection2, t0, tf, dtmax):
    self.universe = universe
    self.selection1 = selection1
    self.selection2 = selection2
    self.t0 = t0
    self.tf = tf - 1
    self.dtmax = dtmax
    self.timeseries = None