Skip to content

Commit

Permalink
numpydoc build on peakstability
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenhua0320 committed Aug 19, 2024
1 parent ee41be5 commit 5576e1b
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions src/diffpy/srmise/peakstability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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))

Expand All @@ -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):
Expand Down

0 comments on commit 5576e1b

Please sign in to comment.