Skip to content

Commit f4f9986

Browse files
committed
MAINT: return more unique error codes from C-level _downcoef_axis routines
1 parent 2f5b736 commit f4f9986

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pywt/_extensions/c/wt.template.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,25 @@ int CAT(TYPE, _downcoef_axis)(const TYPE * const restrict input, const ArrayInfo
3636
if (input_info.ndim != output_info.ndim)
3737
return 1;
3838
if (axis >= input_info.ndim)
39-
return 1;
39+
return 2;
4040

4141
for (i = 0; i < input_info.ndim; ++i){
4242
if (i == axis){
4343
switch (transform) {
4444
case DWT_TRANSFORM:
4545
if (dwt_buffer_length(input_info.shape[i], wavelet->dec_len,
4646
dwt_mode) != output_info.shape[i])
47-
return 1;
47+
return 3;
4848
break;
4949
case SWT_TRANSFORM:
5050
if (swt_buffer_length(input_info.shape[i])
5151
!= output_info.shape[i])
52-
return 1;
52+
return 4;
5353
break;
5454
}
5555
} else {
5656
if (input_info.shape[i] != output_info.shape[i])
57-
return 1;
57+
return 5;
5858
}
5959
}
6060

@@ -160,7 +160,7 @@ int CAT(TYPE, _downcoef_axis)(const TYPE * const restrict input, const ArrayInfo
160160
cleanup:
161161
free(temp_input);
162162
free(temp_output);
163-
return 2;
163+
return 6;
164164
}
165165

166166

0 commit comments

Comments
 (0)