Skip to content

Commit 9f9af6f

Browse files
authored
Merge pull request #759 from reneeotten/last_changes_before_release
(Last) minor changes before release?
2 parents e4f85a2 + fae74b8 commit 9f9af6f

9 files changed

+18
-59
lines changed

.codecov.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
codecov:
22
token: 11c28e95-6e64-4829-9887-04e4cd661bf6
3-
4-
comment:
5-
after_n_builds: 8
3+
comment:
4+
after_n_builds: 8
65

76
coverage:
87
status:

THANKS.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Roam, Alexander Stark, Alexandre Beelen, Andrey Aristov, Nicholas Zobrist,
5555
Ethan Welty, Julius Zimmermann, Mark Dean, Arun Persaud, Ray Osborn, @lneuhaus,
5656
Marcel Stimberg, Yoshiera Huang, Leon Foks, Sebastian Weigand, Florian LB,
5757
Michael Hudson-Doyle, Ruben Verweij, @jedzill4, @spalato, Jens Hedegaard Nielsen,
58-
Martin Majli, Kristian Meyer, and many others.
58+
Martin Majli, Kristian Meyer, @azelcer, Ivan Usov, and many others.
5959

6060
The lmfit code obviously depends on, and owes a very large debt to the code
6161
in scipy.optimize. Several discussions on the SciPy-user and lmfit mailing

azure-pipelines.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ stages:
4444
python setup.py install
4545
displayName: 'Install lmfit'
4646
- script: |
47-
sudo apt update && sudo apt install -qq -y texlive-latex-extra latexmk
47+
sudo apt-get update && sudo apt-get install -qq -y texlive-latex-extra latexmk
4848
displayName: 'Install TeX Live'
4949
- script: |
5050
cd doc ; make all
@@ -74,7 +74,7 @@ stages:
7474
versionSpec: '$(python.version)'
7575
displayName: 'Use Python $(python.version)'
7676
- script: |
77-
sudo apt update && sudo apt install -yq --no-install-suggests --no-install-recommends \
77+
sudo apt-get update && sudo apt-get install -yq --no-install-suggests --no-install-recommends \
7878
libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache \
7979
swig libmpc-dev
8080
displayName: 'Install dependencies'
@@ -130,7 +130,7 @@ stages:
130130
versionSpec: '$(python.version)'
131131
displayName: 'Use Python $(python.version)'
132132
- script: |
133-
sudo apt update && sudo apt install -yq --no-install-suggests --no-install-recommends \
133+
sudo apt-get update && sudo apt-get install -yq --no-install-suggests --no-install-recommends \
134134
libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache \
135135
swig libmpc-dev
136136
displayName: 'Install dependencies'
@@ -206,10 +206,10 @@ stages:
206206
steps:
207207
- script: |
208208
sudo add-apt-repository ppa:deadsnakes/nightly
209-
sudo apt update && sudo apt install -y --no-install-recommends python3.10-dev python3.10-distutils
209+
sudo apt-get update && sudo apt-get install -y --no-install-recommends python3.10-dev python3.10-distutils
210210
displayName: Install Python development version from the deadsnakes PPA
211211
- script: |
212-
sudo apt update && sudo apt install -yq --no-install-suggests --no-install-recommends \
212+
sudo apt-get update && sudo apt-get install -yq --no-install-suggests --no-install-recommends \
213213
libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache \
214214
swig libmpc-dev
215215
displayName: 'Install dependencies'

doc/whatsnew.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ consult the `lmfit GitHub repository`_.
1414

1515
.. _whatsnew_103_label:
1616

17-
Version 1.0.3 Release Notes (unreleased)
18-
========================================
17+
Version 1.0.3 Release Notes (October 14, 2021)
18+
==============================================
1919

2020
Potentially breaking change:
2121

@@ -39,6 +39,7 @@ Bug fixes/enhancements:
3939
``float``, ``int``, or ``complex`` return value to a ``numpy.ndarray`` (Issue #684 and PR #754)
4040
- fix ``dho`` (Damped Harmonic Oscillator) lineshape (PR #755; @rayosborn)
4141
- reset ``Minimizer._abort`` to ``False`` before starting a new fit (Issue #756 and PR #757; @azelcer)
42+
- fix typo in ``guess_from_peak2d`` (@ivan-usovl; PR #758)
4243

4344
Various:
4445

@@ -54,6 +55,7 @@ Various:
5455
- mark ``test_manypeaks_speed.py`` as flaky to avoid intermittent test failures (repeat up to 5 times; PR #745)
5556
- update scipy dependency to >= 1.14.0 (PR #751)
5657
- improvement to output of examples in sphinx-gallery and use higher resolution figures (PR #753)
58+
- remove deprecated functions ``lmfit.printfuncs.report_errors`` and ``asteval`` argument in ``Parameters`` class (PR #759)
5759

5860

5961
.. _whatsnew_102_label:

lmfit/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
from .confidence import conf_interval, conf_interval2d
3939
from .minimizer import Minimizer, MinimizerException, minimize
4040
from .parameter import Parameter, Parameters
41-
from .printfuncs import (ci_report, fit_report, report_ci, report_errors,
42-
report_fit)
41+
from .printfuncs import ci_report, fit_report, report_ci, report_fit
4342
from .model import Model, CompositeModel
4443
from . import lineshapes, models
4544

lmfit/parameter.py

+3-16
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from copy import deepcopy
44
import json
5-
import warnings
65

76
from asteval import Interpreter, get_ast_names, valid_symbol_name
87
from numpy import arcsin, array, cos, inf, isclose, sin, sqrt
@@ -45,30 +44,18 @@ class Parameters(dict):
4544
4645
"""
4746

48-
def __init__(self, asteval=None, usersyms=None):
47+
def __init__(self, usersyms=None):
4948
"""
5049
Arguments
5150
---------
52-
asteval : :class:`asteval.Interpreter`, optional
53-
Instance of the `asteval.Interpreter` to use for constraint
54-
expressions. If None (default), a new interpreter will be
55-
created. **Warning: deprecated**, use `usersyms` if possible!
5651
usersyms : dict, optional
5752
Dictionary of symbols to add to the
5853
:class:`asteval.Interpreter` (default is None).
5954
6055
"""
6156
super().__init__(self)
6257

63-
self._asteval = asteval
64-
if asteval is None:
65-
self._asteval = Interpreter()
66-
else:
67-
msg = ("The use of the 'asteval' argument for the Parameters class"
68-
" was deprecated in lmfit v0.9.12 and will be removed in a "
69-
"later release. Please use the 'usersyms' argument instead!")
70-
warnings.warn(FutureWarning(msg))
71-
self._asteval = asteval
58+
self._asteval = Interpreter()
7259

7360
_syms = {}
7461
_syms.update(SCIPY_FUNCTIONS)
@@ -101,7 +88,7 @@ def __deepcopy__(self, memo):
10188
all individual Parameter objects are copied.
10289
10390
"""
104-
_pars = self.__class__(asteval=None)
91+
_pars = self.__class__()
10592

10693
# find the symbols that were added by users, not during construction
10794
unique_symbols = {key: self._asteval.symtable[key]

lmfit/printfuncs.py

-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from math import log10
44
import re
5-
import warnings
65

76
import numpy as np
87

@@ -341,14 +340,6 @@ def cell(x, cat='td'):
341340
return ''.join(html)
342341

343342

344-
def report_errors(params, **kws):
345-
"""Print a report for fitted params: see error_report()."""
346-
warnings.warn("The function 'report_errors' is deprecated as of lmfit "
347-
"0.9.14 and will be removed in the next release. Please "
348-
"use 'report_fit' instead.", FutureWarning)
349-
print(fit_report(params, **kws))
350-
351-
352343
def report_fit(params, **kws):
353344
"""Print a report of the fitting results."""
354345
print(fit_report(params, **kws))

tests/test_parameters.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from copy import copy, deepcopy
55
import pickle
66

7-
import asteval
87
import numpy as np
98
from numpy.testing import assert_allclose
109
import pytest
@@ -45,21 +44,9 @@ def test_check_ast_errors():
4544
pars.add('par1', expr='2.0*par2')
4645

4746

48-
def test_parameters_init_with_asteval():
49-
"""Test for initialization of the Parameters class with asteval."""
50-
ast_int = asteval.Interpreter()
51-
52-
msg = ("The use of the 'asteval' argument for the Parameters class was "
53-
"deprecated in lmfit v0.9.12 and will be removed in a later "
54-
"release. Please use the 'usersyms' argument instead!")
55-
with pytest.warns(FutureWarning, match=msg):
56-
pars = lmfit.Parameters(asteval=ast_int)
57-
assert pars._asteval == ast_int
58-
59-
6047
def test_parameters_init_with_usersyms():
6148
"""Test for initialization of the Parameters class with usersyms."""
62-
pars = lmfit.Parameters(asteval=None, usersyms={'test': np.sin})
49+
pars = lmfit.Parameters(usersyms={'test': np.sin})
6350
assert 'test' in pars._asteval.symtable
6451

6552

tests/test_printfuncs.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import lmfit
66
from lmfit import (Minimizer, Parameters, ci_report, conf_interval, fit_report,
7-
report_ci, report_errors, report_fit)
7+
report_ci, report_fit)
88
from lmfit.lineshapes import gaussian
99
from lmfit.models import GaussianModel
1010
from lmfit.printfuncs import alphanumeric_sort, getfloat_attr, gformat
@@ -222,12 +222,6 @@ def test_report_fit(fitresult, capsys):
222222
assert header in captured.out
223223

224224

225-
def test_report_errors_deprecated(fitresult):
226-
"""Verify that a FutureWarning is shown when calling report_errors."""
227-
with pytest.warns(FutureWarning):
228-
report_errors(params=fitresult.params)
229-
230-
231225
def test_report_leastsq_no_errorbars(fitresult):
232226
"""Verify correct message when uncertainties could not be estimated."""
233227
# general warning is shown

0 commit comments

Comments
 (0)