diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5952a6f..77115fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.9 + rev: v0.5.0 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/ioos_qc/qartod.py b/ioos_qc/qartod.py index 8d931d4..e2a779a 100644 --- a/ioos_qc/qartod.py +++ b/ioos_qc/qartod.py @@ -745,7 +745,7 @@ def run_test(test_threshold, flag_value) -> None: # find data ranges that are within threshold and flag them test_results = np.ma.filled(data_range < tolerance, fill_value=False) # data points before end of first window should pass - n_fill = count if count < len(inp) else len(inp) + n_fill = min(len(inp), count) test_results = np.insert(test_results, 0, np.full((n_fill,), False)) flag_arr[test_results] = flag_value