Add a warning for the default fitting kind
future version to change from rational to cubic
@@ -2671,8 +2671,9 @@ class Network(object):
# freq = Frequency.from_f(f,**kwargs)
# self.interpolate_self(freq, **interp_kwargs)
- def extrapolate_to_dc(self, points: int = None, dc_sparam: NumberLike = None, kind: str = 'rational',
- coords: str = 'cart', **kwargs) -> 'Network':
+ def extrapolate_to_dc(self, points: int = None, dc_sparam: NumberLike = None,
+ kind: str = 'warn', coords: str = 'cart',
+ **kwargs) -> 'Network':
"""
Extrapolate S-parameters down to 0 Hz and interpolate to uniform spacing.
@@ -2691,7 +2692,7 @@ class Network(object):
dc_sparam : class:`npy.ndarray` or None
NxN S-parameters matrix at 0 Hz.
If None S-parameters at 0 Hz are determined by linear extrapolation.
- kind : str or int
+ kind : str or int, default is 'rational'
Specifies the kind of interpolation as a string ('linear',
'nearest', 'zero', 'slinear', 'quadratic, 'cubic') or
as an integer specifying the order of the spline
@@ -2717,6 +2718,13 @@ class Network(object):
impulse_response
step_response
"""
+ if kind == 'warn':
+ warnings.warn("The default `kind` parameter will change "
+ "from `rational` to `cubic` in future version."
+ "Use `kind='rational'` to keep the old default."
+ "To silent this warning, explitly define `kind`.")
+ kind = 'rational'
+
result = self.copy()
if self.frequency.f[0] == 0:
