|
2 | 2 |
|
3 | 3 | from copy import deepcopy
|
4 | 4 | import json
|
5 |
| -import warnings |
6 | 5 |
|
7 | 6 | from asteval import Interpreter, get_ast_names, valid_symbol_name
|
8 | 7 | from numpy import arcsin, array, cos, inf, isclose, sin, sqrt
|
@@ -45,30 +44,18 @@ class Parameters(dict):
|
45 | 44 |
|
46 | 45 | """
|
47 | 46 |
|
48 |
| - def __init__(self, asteval=None, usersyms=None): |
| 47 | + def __init__(self, usersyms=None): |
49 | 48 | """
|
50 | 49 | Arguments
|
51 | 50 | ---------
|
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! |
56 | 51 | usersyms : dict, optional
|
57 | 52 | Dictionary of symbols to add to the
|
58 | 53 | :class:`asteval.Interpreter` (default is None).
|
59 | 54 |
|
60 | 55 | """
|
61 | 56 | super().__init__(self)
|
62 | 57 |
|
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() |
72 | 59 |
|
73 | 60 | _syms = {}
|
74 | 61 | _syms.update(SCIPY_FUNCTIONS)
|
@@ -101,7 +88,7 @@ def __deepcopy__(self, memo):
|
101 | 88 | all individual Parameter objects are copied.
|
102 | 89 |
|
103 | 90 | """
|
104 |
| - _pars = self.__class__(asteval=None) |
| 91 | + _pars = self.__class__() |
105 | 92 |
|
106 | 93 | # find the symbols that were added by users, not during construction
|
107 | 94 | unique_symbols = {key: self._asteval.symtable[key]
|
|
0 commit comments