]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
reef: mgr/diskprediction_local: avoid more mypy errors 62369/head
authorJohn Mulligan <phlogistonjohn@asynchrono.us>
Tue, 18 Mar 2025 19:56:25 +0000 (15:56 -0400)
committerJohn Mulligan <phlogistonjohn@asynchrono.us>
Tue, 18 Mar 2025 19:56:25 +0000 (15:56 -0400)
Similar to c4111033172db28c4737e8438f27901811919ce4 this patch
suppresses mypy errors in the diskprediction_local mgr module.
I probably put the magic comment on more lines than needed but
mypy does not have a block-comment method to suppress checking
for just a region of code today.
This patch is not a backport as the issue is only impacting
reef CI jobs and so it is applied directly to the reef branch.

Signed-off-by: John Mulligan <phlogistonjohn@asynchrono.us>
src/pybind/mgr/diskprediction_local/predictor.py

index 9ce57bf951e16beb1408e3b5056328a5df4a9b31..fa38165b0e5f2cccd11afac20e8dffb75df20273 100644 (file)
@@ -168,14 +168,14 @@ class RHDiskFailurePredictor(Predictor):
         roll_window_size = 6
 
         # rolling means generator
-        dataset_size = disk_days_attrs.shape[0] - roll_window_size + 1
-        gen = (disk_days_attrs[i: i + roll_window_size, ...].mean(axis=0)
-               for i in range(dataset_size))
+        dataset_size = disk_days_attrs.shape[0] - roll_window_size + 1  # type:ignore
+        gen = (disk_days_attrs[i: i + roll_window_size, ...].mean(axis=0)  # type:ignore
+               for i in range(dataset_size))  # type:ignore
         means = np.vstack(gen)  # type: ignore
 
         # rolling stds generator
-        gen = (disk_days_attrs[i: i + roll_window_size, ...].std(axis=0, ddof=1)
-               for i in range(dataset_size))
+        gen = (disk_days_attrs[i: i + roll_window_size, ...].std(axis=0, ddof=1)  # type: ignore
+               for i in range(dataset_size))  # type:ignore
         stds = np.vstack(gen)  # type: ignore
 
         # coefficient of variation