Skip to content

Commit 2ee82ff

Browse files
fixed error in testing
1 parent 5c219b1 commit 2ee82ff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

climada/engine/impact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ def local_exceedance_impact(
570570
test_frequency = 1 / np.array(return_periods)
571571

572572
exceedance_impact = np.full(
573-
(self.imp_mat.shape[1], test_frequency.shape[0]),
573+
(self.imp_mat.shape[1], len(test_frequency)),
574574
np.nan if method == "interpolate" else 0.0,
575575
)
576576

climada/hazard/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def local_exceedance_intensity(
557557
test_frequency = 1 / np.array(return_periods)
558558

559559
exceedance_intensity = np.full(
560-
(self.intensity.shape[1], test_frequency.shape[0]),
560+
(self.intensity.shape[1], len(test_frequency)),
561561
np.nan if method == "interpolate" else 0.0,
562562
)
563563

@@ -687,7 +687,7 @@ def local_return_period(
687687
raise ValueError(f"Unknown method: {method}")
688688

689689
return_periods = np.full(
690-
(self.intensity.shape[1], threshold_intensities.shape[0]), np.nan
690+
(self.intensity.shape[1], len(threshold_intensities)), np.nan
691691
)
692692

693693
nonzero_centroids = np.where(self.intensity.getnnz(axis=0) > 0)[0]

0 commit comments

Comments
 (0)