diff options
author | Anton Ritter-Gogerly <anton@antonviktor.com> | 2020-01-26 14:12:31 +1100 |
---|---|---|
committer | Anton Ritter-Gogerly <anton@antonviktor.com> | 2020-01-27 09:20:55 +1100 |
commit | 764c25bb8a9e5be60455ac7d6947318efbbb93aa (patch) | |
tree | 16f4f9b133ac94139f1abf398ef0dae55841f767 /numpy/polynomial/polyutils.py | |
parent | 9b7e890b014f6ad3b4288246f0565f7afd6eca84 (diff) | |
download | numpy-764c25bb8a9e5be60455ac7d6947318efbbb93aa.tar.gz |
Updated files in polynomial/ to use fstrings
Diffstat (limited to 'numpy/polynomial/polyutils.py')
-rw-r--r-- | numpy/polynomial/polyutils.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py index 9b8e9fc42..ec7ba6f1d 100644 --- a/numpy/polynomial/polyutils.py +++ b/numpy/polynomial/polyutils.py @@ -468,10 +468,10 @@ def _vander_nd(vander_fs, points, degrees): n_dims = len(vander_fs) if n_dims != len(points): raise ValueError( - "Expected {} dimensions of sample points, got {}".format(n_dims, len(points))) + f"Expected {n_dims} dimensions of sample points, got {len(points)}") if n_dims != len(degrees): raise ValueError( - "Expected {} dimensions of degrees, got {}".format(n_dims, len(degrees))) + f"Expected {n_dims} dimensions of degrees, got {len(degrees)}") if n_dims == 0: raise ValueError("Unable to guess a dtype or shape when no points are given") @@ -786,12 +786,11 @@ def _deprecate_as_int(x, desc): else: if ix == x: warnings.warn( - "In future, this will raise TypeError, as {} will need to " - "be an integer not just an integral float." - .format(desc), + f"In future, this will raise TypeError, as {desc} will " + "need to be an integer not just an integral float.", DeprecationWarning, stacklevel=3 ) return ix - raise TypeError("{} must be an integer".format(desc)) + raise TypeError(f"{desc} must be an integer") |