Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
fix(IIRuncFilter): warn user if Ux is float but kind not diag
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrub committed Jun 16, 2020
1 parent 0e7fd18 commit 47e01f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion PyDynamic/uncertainty/propagate_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,16 @@ def IIRuncFilter(x, Ux, b, a, Uab=None, state=None, kind="corr"):

# make Ux an array
if not isinstance(Ux, np.ndarray):
Ux = Ux * np.ones_like(x) # translate iid noise to vector
Ux = np.full(x.shape, Ux) # translate iid noise to vector

if kind is not "diag":
kind = "diag"
raise UserWarning(
f"Ux of type float and `kind='{kind}'` was given. To ensure the behavior "
"described in the docstring (float -> standard deviation of white noise "
" in x), `kind='diag'` is set. \n"
"To suppress this warning, explicitly set `kind='diag'`"
)

# system, corr_unc and processed_input are cached as well to reduce computational load
if not state:
Expand Down

0 comments on commit 47e01f5

Please sign in to comment.