Skip to content

Commit

Permalink
Fix remaining typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaireDons committed Sep 25, 2024
1 parent 0ab0c96 commit 1152599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion s2spy/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _check_data_resolution_match(
"daily": np.timedelta64(1, "D"),
}
time_intervals = np.diff(data["time"].to_numpy())
temporal_resolution = np.median(time_intervals).astype("timedelta64[D]")
temporal_resolution: np.timedelta64 = np.median(time_intervals).astype("timedelta64[D]")
if timescale == "monthly":
temporal_resolution = temporal_resolution.astype(int)
min_days, max_days = (28, 31)
Expand Down
2 changes: 1 addition & 1 deletion s2spy/rgdr/label_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _calculate_overlap(
mask_a = xr.where(cluster_labels.sel(split=split_a) == cluster_a, 1, 0).values
mask_b = xr.where(cluster_labels.sel(split=split_b) == cluster_b, 1, 0).values

return np.sum(np.logical_and(mask_a, mask_b)) / np.sum(mask_a)
return np.sum(np.logical_and(mask_a, mask_b)) / np.sum(mask_a) # type: ignore


def calculate_overlap_table(cluster_labels: xr.DataArray) -> pd.DataFrame:
Expand Down

0 comments on commit 1152599

Please sign in to comment.