Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Aug 31, 2022
1 parent 24dd6ea commit a38b5ec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lmfit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from asteval import Interpreter, get_ast_names
import numpy as np
from scipy.interpolate import splrep, splev
from scipy.interpolate import splev, splrep

from . import lineshapes
from .lineshapes import (breit_wigner, damped_oscillator, dho, doniach,
Expand Down Expand Up @@ -318,6 +318,7 @@ def guess(self, data, x, **kwargs):
__init__.__doc__ = COMMON_INIT_DOC
guess.__doc__ = COMMON_GUESS_DOC


class SplineModel(Model):
r"""A 1-D cubic spline model with a variable number of `knots` and
parameters `s0`, `s1`, ..., `sN`, for `N` knots.
Expand All @@ -332,7 +333,7 @@ class SplineModel(Model):
points, but for finely-spaced knots, the spline parameter values will
be very close to the `y` values of the resulting curve.
The maximum number of knots supported is 100.
The maximum number of knots supported is 300.
Using the `guess()` method to initialize parameter values is highly
recommended.
Expand All @@ -352,7 +353,7 @@ class SplineModel(Model):
Notes
-----
1. There must be at least 4 knot points, and not more than 100.
1. There must be at least 4 knot points, and not more than 300.
2. `nan_policy` sets what to do when a NaN or missing value is seen in
the data. Should be one of:
Expand All @@ -378,8 +379,7 @@ def __init__(self, xknots, independent_vars=['x'], prefix='',
xknots = np.asarray(xknots, dtype=np.float64)
try:
xknots = xknots.flatten()

except:
except Exception:
raise TypeError(self.NKNOTS_NDARRAY_ERR)

if len(xknots) > self.MAX_KNOTS:
Expand Down Expand Up @@ -1641,6 +1641,7 @@ def _parse_params(self):
'Linear': LinearModel,
'Quadratic': QuadraticModel,
'Polynomial': PolynomialModel,
'Spline': SplineModel,
'Gaussian': GaussianModel,
'Gaussian-2D': Gaussian2dModel,
'Lorentzian': LorentzianModel,
Expand Down

0 comments on commit a38b5ec

Please sign in to comment.