From 5576e1b32da8715c622d80cd22b2b48defe26b3c Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Mon, 19 Aug 2024 18:56:12 +0800 Subject: [PATCH] numpydoc build on peakstability --- src/diffpy/srmise/peakstability.py | 35 ++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/diffpy/srmise/peakstability.py b/src/diffpy/srmise/peakstability.py index 83d2897..28c9517 100644 --- a/src/diffpy/srmise/peakstability.py +++ b/src/diffpy/srmise/peakstability.py @@ -125,7 +125,17 @@ def plot(self, **kwds): ) def setcurrent(self, idx): - """Make the idxth model the active one.""" + """Make the idxth model the active one. + + Parameters + ---------- + idx : int + The index of the model to be tested. + + Returns + ------- + None + """ self.current = idx if idx is not None: result = self.results[idx] @@ -140,11 +150,15 @@ def setcurrent(self, idx): def animate(self, results=None, step=False, **kwds): """Show animation of extracted peaks from first to last. - Parameters: - step - Require keypress to show next plot - results - The indices of results to show + Keywords passed to pyplot.plot() - Keywords passed to pyplot.plot()""" + Parameters + ---------- + step : bool + Require keypress to show next plot + results array-like + The indices of results to show + """ if results is None: results = range(len(self.results)) @@ -165,9 +179,16 @@ def animate(self, results=None, step=False, **kwds): self.setcurrent(oldcurrent) def run(self, err, savecovs=False): - """err is sequence of uncertainties to run at. + """Running the uncertainty for the results. + + Parameters + ---------- + err : array-like + The sequence of uncertainties to run at. + savecovs : bool + boolean to determine to save covariance matrix. Default is False. + If savecovs is True, return the covariance matrix for each final fit.""" - If savecovs is True, return the covariance matrix for each final fit.""" self.results = [] covs = [] for i, e in enumerate(err):