Skip to content

Commit 0dcfcde

Browse files
committed
adding assert that cropping and subsampling cannot be used together
1 parent be947a1 commit 0dcfcde

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

makani/utils/driver.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ def _set_data_shapes(self, params, dataset):
172172
params.img_shape_y_resampled = dataset.img_shape_y_resampled
173173
params.subsampling_factor = dataset.subsampling_factor
174174

175+
if (params.subsampling_factor > 1) and ((params.img_crop_shape_x != params.img_shape_x) or (params.img_crop_shape_y != params.img_shape_y)):
176+
raise ValueError("Image cropping and data subsampling cannot be used together. Please set the crop shape to the image shape or set subsampling factor to 1.")
177+
175178
# derived quantities
176179
params["N_in_predicted_channels"] = params.N_in_channels
177180

0 commit comments

Comments
 (0)