[MyPy][1/N] Fix mypy errors in some tests/ directories and enforce follow-imports=silent (#49570)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Martin Hickey
2026-07-30 05:02:51 -07:00
committed by GitHub
co-authored by Harry Mellor
parent 89d97d9a16
commit 38a267cdd5
30 changed files with 166 additions and 101 deletions
@@ -170,7 +170,7 @@ def load_image(
list of meta info for each image in *file_paths*
"""
imgs = []
imgs: list[np.ndarray] = []
metas = []
temporal_coords = []
location_coords = []
@@ -209,11 +209,11 @@ def load_image(
except Exception:
logger.exception("Could not extract timestamp for %s", file)
imgs = np.stack(imgs, axis=0) # num_frames, H, W, C
imgs = np.moveaxis(imgs, -1, 0).astype("float32") # C, num_frames, H, W
imgs = np.expand_dims(imgs, axis=0) # add batch di
stacked = np.stack(imgs, axis=0) # num_frames, H, W, C
stacked = np.moveaxis(stacked, -1, 0).astype("float32") # C, num_frames, H, W
stacked = np.expand_dims(stacked, axis=0) # add batch di
return imgs, temporal_coords, location_coords, metas
return stacked, temporal_coords, location_coords, metas
class PrithviMultimodalDataProcessor(IOProcessor[ImagePrompt, ImageRequestOutput]):
@@ -327,7 +327,7 @@ class PrithviMultimodalDataProcessor(IOProcessor[ImagePrompt, ImageRequestOutput
}
)
return prompts
return prompts # type: ignore[return-value]
def post_process(
self,