Skip to content

Commit 1c52991

Browse files
authored
Merge pull request #106 from florisvb/move-tvr-tests
#68 for TVR
2 parents 4f8e55a + d67270f commit 1c52991

6 files changed

Lines changed: 220 additions & 285 deletions

File tree

pynumdiff/finite_difference/_finite_difference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def first_order(x, dt, params=None, options={}, num_iterations=None):
1818
- **dxdt_hat** -- estimated derivative of x
1919
"""
2020
if params != None and 'iterate' in options:
21-
warn("""`params` and `options` parameters will be removed in a future version. Use `num_iterations` instead.""", DeprecationWarning)
21+
warn("`params` and `options` parameters will be removed in a future version. Use `num_iterations` instead.", DeprecationWarning)
2222
if isinstance(params, list): params = params[0]
2323
return _iterate_first_order(x, dt, params)
2424
elif num_iterations:

pynumdiff/linear_model/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from ._linear_model import lineardiff
66
except:
77
from warnings import warn
8-
warn("""Limited Linear Model Support Detected! CVXPY is not installed.
9-
Install CVXPY to use lineardiff derivatives. You can still use other methods.""")
8+
warn("Limited Linear Model Support Detected! CVXPY is not installed. " +
9+
"Install CVXPY to use lineardiff derivatives. You can still use other methods.")
1010

1111
from ._linear_model import savgoldiff, polydiff, spectraldiff
1212

pynumdiff/linear_model/_linear_model.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def savgoldiff(x, dt, params=None, options=None, polynomial_order=None, window_s
112112
- **dxdt_hat** -- estimated derivative of x
113113
"""
114114
if params != None: # Warning to support old interface for a while. Remove these lines along with params in a future release.
115-
warn("""`params` and `options` parameters will be removed in a future version. Use `polynomial_order`,
116-
`window_size`, and `smoothing_win` instead.""", DeprecationWarning)
115+
warn("`params` and `options` parameters will be removed in a future version. Use `polynomial_order`, " +
116+
"`window_size`, and `smoothing_win` instead.", DeprecationWarning)
117117
polynomial_order, window_size, smoothing_win = params
118118
elif polynomial_order == None or window_size == None or smoothing_win == None:
119119
raise ValueError("`polynomial_order`, `window_size`, and `smoothing_win` must be given.")
@@ -192,8 +192,8 @@ def polydiff(x, dt, params=None, options=None, polynomial_order=None, window_siz
192192
- **dxdt_hat** -- estimated derivative of x
193193
"""
194194
if params != None:
195-
warn("""`params` and `options` parameters will be removed in a future version. Use `polynomial_order`
196-
and `window_size` instead.""", DeprecationWarning)
195+
warn("`params` and `options` parameters will be removed in a future version. Use `polynomial_order` " +
196+
"and `window_size` instead.", DeprecationWarning)
197197
polynomial_order, window_size = params
198198
if options != None:
199199
if 'sliding' in options: sliding = options['sliding']
@@ -426,8 +426,8 @@ def lineardiff(x, dt, params=None, options=None, order=None, gamma=None, window_
426426
- **dxdt_hat** -- estimated derivative of x
427427
"""
428428
if params != None:
429-
warn("""`params` and `options` parameters will be removed in a future version. Use `order`,
430-
`gamma`, and `window_size` instead.""", DeprecationWarning)
429+
warn("`params` and `options` parameters will be removed in a future version. Use `order`, " +
430+
"`gamma`, and `window_size` instead.", DeprecationWarning)
431431
order, gamma, window_size = params
432432
if options != None:
433433
if 'sliding' in options: sliding = options['sliding']
@@ -483,8 +483,8 @@ def spectraldiff(x, dt, params=None, options=None, high_freq_cutoff=None, even_e
483483
- **dxdt_hat** -- estimated derivative of x
484484
"""
485485
if params != None: # Warning to support old interface for a while. Remove these lines along with params in a future release.
486-
warn("""`params` and `options` parameters will be removed in a future version. Use `high_freq_cutoff`,
487-
`even_extension`, and `pad_to_zero_dxdt` instead.""", DeprecationWarning)
486+
warn("`params` and `options` parameters will be removed in a future version. Use `high_freq_cutoff`, " +
487+
"`even_extension`, and `pad_to_zero_dxdt` instead.", DeprecationWarning)
488488
high_freq_cutoff = params[0] if isinstance(params, list) else params
489489
if options != None:
490490
if 'even_extension' in options: even_extension = options['even_extension']

pynumdiff/total_variation_regularization/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from ._total_variation_regularization import velocity, acceleration, jerk, jerk_sliding, smooth_acceleration
66
except:
77
from warnings import warn
8-
warn("""Limited Total Variation Regularization Support Detected! CVXPY is not installed.
9-
Many Total Variation Methods require CVXPY including: velocity, acceleration, jerk, jerk_sliding, smooth_acceleration.
10-
Please install CVXPY to use these methods. Recommended to also install MOSEK and obtain a MOSEK license.
11-
You can still use: total_variation_regularization.iterative_velocity.""")
8+
warn("Limited Total Variation Regularization Support Detected! CVXPY is not installed. " +
9+
"Many Total Variation Methods require CVXPY including: velocity, acceleration, jerk, jerk_sliding, smooth_acceleration. " +
10+
"Please install CVXPY to use these methods. Recommended to also install MOSEK and obtain a MOSEK license. " +
11+
"You can still use: total_variation_regularization.iterative_velocity.")
1212

1313
from ._total_variation_regularization import iterative_velocity
1414

pynumdiff/total_variation_regularization/__chartrand_tvregdiff__.py renamed to pynumdiff/total_variation_regularization/_chartrand_tvregdiff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@
133133
# #
134134
# (1) #
135135
# scipy.sparse.linalg.cg seems to require more #
136-
# iterations to reach the same result as #
136+
# iterations to reach the same result as #
137137
# MATLAB's pcg. (scipy version 1.1.0) #
138-
# A good guess is the length of the data #
138+
# A good guess is the length of the data #
139139
# #
140140
# (2) #
141141
# Drop last entry of derivative (u) for small scale #

0 commit comments

Comments
 (0)