Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pynumdiff/finite_difference/_finite_difference.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def first_order(x, dt, params=None, options={}, num_iterations=None):
- **dxdt_hat** -- estimated derivative of x
"""
if params != None and 'iterate' in options:
warn("""`params` and `options` parameters will be removed in a future version. Use `num_iterations` instead.""", DeprecationWarning)
warn("`params` and `options` parameters will be removed in a future version. Use `num_iterations` instead.", DeprecationWarning)
if isinstance(params, list): params = params[0]
return _iterate_first_order(x, dt, params)
elif num_iterations:
Expand Down
4 changes: 2 additions & 2 deletions pynumdiff/linear_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from ._linear_model import lineardiff
except:
from warnings import warn
warn("""Limited Linear Model Support Detected! CVXPY is not installed.
Install CVXPY to use lineardiff derivatives. You can still use other methods.""")
warn("Limited Linear Model Support Detected! CVXPY is not installed. " +
"Install CVXPY to use lineardiff derivatives. You can still use other methods.")

from ._linear_model import savgoldiff, polydiff, spectraldiff

Expand Down
16 changes: 8 additions & 8 deletions pynumdiff/linear_model/_linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def savgoldiff(x, dt, params=None, options=None, polynomial_order=None, window_s
- **dxdt_hat** -- estimated derivative of x
"""
if params != None: # Warning to support old interface for a while. Remove these lines along with params in a future release.
warn("""`params` and `options` parameters will be removed in a future version. Use `polynomial_order`,
`window_size`, and `smoothing_win` instead.""", DeprecationWarning)
warn("`params` and `options` parameters will be removed in a future version. Use `polynomial_order`, " +
"`window_size`, and `smoothing_win` instead.", DeprecationWarning)
polynomial_order, window_size, smoothing_win = params
elif polynomial_order == None or window_size == None or smoothing_win == None:
raise ValueError("`polynomial_order`, `window_size`, and `smoothing_win` must be given.")
Expand Down Expand Up @@ -192,8 +192,8 @@ def polydiff(x, dt, params=None, options=None, polynomial_order=None, window_siz
- **dxdt_hat** -- estimated derivative of x
"""
if params != None:
warn("""`params` and `options` parameters will be removed in a future version. Use `polynomial_order`
and `window_size` instead.""", DeprecationWarning)
warn("`params` and `options` parameters will be removed in a future version. Use `polynomial_order` " +
"and `window_size` instead.", DeprecationWarning)
polynomial_order, window_size = params
if options != None:
if 'sliding' in options: sliding = options['sliding']
Expand Down Expand Up @@ -426,8 +426,8 @@ def lineardiff(x, dt, params=None, options=None, order=None, gamma=None, window_
- **dxdt_hat** -- estimated derivative of x
"""
if params != None:
warn("""`params` and `options` parameters will be removed in a future version. Use `order`,
`gamma`, and `window_size` instead.""", DeprecationWarning)
warn("`params` and `options` parameters will be removed in a future version. Use `order`, " +
"`gamma`, and `window_size` instead.", DeprecationWarning)
order, gamma, window_size = params
if options != None:
if 'sliding' in options: sliding = options['sliding']
Expand Down Expand Up @@ -483,8 +483,8 @@ def spectraldiff(x, dt, params=None, options=None, high_freq_cutoff=None, even_e
- **dxdt_hat** -- estimated derivative of x
"""
if params != None: # Warning to support old interface for a while. Remove these lines along with params in a future release.
warn("""`params` and `options` parameters will be removed in a future version. Use `high_freq_cutoff`,
`even_extension`, and `pad_to_zero_dxdt` instead.""", DeprecationWarning)
warn("`params` and `options` parameters will be removed in a future version. Use `high_freq_cutoff`, " +
"`even_extension`, and `pad_to_zero_dxdt` instead.", DeprecationWarning)
high_freq_cutoff = params[0] if isinstance(params, list) else params
if options != None:
if 'even_extension' in options: even_extension = options['even_extension']
Expand Down
8 changes: 4 additions & 4 deletions pynumdiff/total_variation_regularization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from ._total_variation_regularization import velocity, acceleration, jerk, jerk_sliding, smooth_acceleration
except:
from warnings import warn
warn("""Limited Total Variation Regularization Support Detected! CVXPY is not installed.
Many Total Variation Methods require CVXPY including: velocity, acceleration, jerk, jerk_sliding, smooth_acceleration.
Please install CVXPY to use these methods. Recommended to also install MOSEK and obtain a MOSEK license.
You can still use: total_variation_regularization.iterative_velocity.""")
warn("Limited Total Variation Regularization Support Detected! CVXPY is not installed. " +
"Many Total Variation Methods require CVXPY including: velocity, acceleration, jerk, jerk_sliding, smooth_acceleration. " +
"Please install CVXPY to use these methods. Recommended to also install MOSEK and obtain a MOSEK license. " +
"You can still use: total_variation_regularization.iterative_velocity.")

from ._total_variation_regularization import iterative_velocity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@
# #
# (1) #
# scipy.sparse.linalg.cg seems to require more #
# iterations to reach the same result as #
# iterations to reach the same result as #
# MATLAB's pcg. (scipy version 1.1.0) #
# A good guess is the length of the data #
# A good guess is the length of the data #
# #
# (2) #
# Drop last entry of derivative (u) for small scale #
Expand Down
Loading