Skip to content

Commit

Permalink
Merge pull request #1030 from bmorris3/fit_lines-bugfix
Browse files Browse the repository at this point in the history
Bugfix: shuffled arg order in _fit_lines
  • Loading branch information
rosteen authored Mar 14, 2023
2 parents 662b329 + 593b997 commit 0ac49cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ New Features
Bug Fixes
^^^^^^^^^

- Fix bug in ``fit_lines`` which gave unexpected outputs from the ``get_fit_info``
and ``ignore_units`` keyword arguments [#1030]

1.9.1 (2022-11-22)
------------------

Expand Down
15 changes: 12 additions & 3 deletions specutils/fitting/fitmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,18 @@ def fit_lines(spectrum, model, fitter=fitting.LevMarLSQFitter(calc_uncertainties

ignore_units = getattr(model_guess, model_guess.param_names[0]).unit is None

fit_model = _fit_lines(spectrum, model_guess, fitter,
exclude_regions, weights, model_window,
ignore_units, get_fit_info, **kwargs)
fit_model = _fit_lines(
spectrum,
model_guess,
fitter=fitter,
exclude_regions=exclude_regions,
weights=weights,
window=model_window,
get_fit_info=get_fit_info,
ignore_units=ignore_units,
**kwargs
)

if model_guess.name is not None:
fit_model.name = model_guess.name

Expand Down

0 comments on commit 0ac49cf

Please sign in to comment.