diff --git a/src/shapepipe/modules/mask_package/mask.py b/src/shapepipe/modules/mask_package/mask.py index 17e052a6e..38a452c85 100644 --- a/src/shapepipe/modules/mask_package/mask.py +++ b/src/shapepipe/modules/mask_package/mask.py @@ -1070,7 +1070,7 @@ def _exec_WW(self, types="HALO"): self._WW_stdout, self._WW_stderr = execute(cmd) else: - ValueError("Types must be in ['HALO','SPIKE','ALL']") + raise ValueError("Types must be in ['HALO','SPIKE','ALL']") if (self._WW_stderr != "") or (self._rm_reg_stderr != ""): self._err = True diff --git a/src/shapepipe/modules/mccd_interp_runner.py b/src/shapepipe/modules/mccd_interp_runner.py index bf87ea150..82ec7b65f 100644 --- a/src/shapepipe/modules/mccd_interp_runner.py +++ b/src/shapepipe/modules/mccd_interp_runner.py @@ -114,13 +114,13 @@ def mccd_interp_runner( inst.process_me(psf_model_dir, psf_model_pattern, f_wcs_path) elif mode == "VALIDATION": - ValueError( + raise ValueError( "MODE has to be in MULTI-EPOCH or CLASSIC. For validation" + " use MCCD validation runner." ) else: - ValueError("MODE has to be in : [CLASSIC, MULTI-EPOCH]") + raise ValueError("MODE has to be in : [CLASSIC, MULTI-EPOCH]") # No return objects return None, None diff --git a/src/shapepipe/modules/psfex_interp_runner.py b/src/shapepipe/modules/psfex_interp_runner.py index 601ffb0b5..67c21adfc 100644 --- a/src/shapepipe/modules/psfex_interp_runner.py +++ b/src/shapepipe/modules/psfex_interp_runner.py @@ -150,7 +150,7 @@ def psfex_interp_runner( else: # Raise error for invalid run mode - ValueError("MODE has to be in : [CLASSIC, MULTI-EPOCH, VALIDATION]") + raise ValueError("MODE has to be in : [CLASSIC, MULTI-EPOCH, VALIDATION]") # No return objects return None, None diff --git a/src/shapepipe/pipeline/file_handler.py b/src/shapepipe/pipeline/file_handler.py index 9352248de..a2808259f 100644 --- a/src/shapepipe/pipeline/file_handler.py +++ b/src/shapepipe/pipeline/file_handler.py @@ -792,7 +792,7 @@ def _generate_re_pattern(match_pattern): """ if not isinstance(match_pattern, str): - TypeError("Match pattern must be a string.") + raise TypeError("Match pattern must be a string.") chars = [char for char in match_pattern if not char.isalnum()] split_pattern = "|".join(chars).replace(".", r"\.") diff --git a/src/shapepipe/pipeline/file_io.py b/src/shapepipe/pipeline/file_io.py index 0bb8fb763..35f64bc27 100644 --- a/src/shapepipe/pipeline/file_io.py +++ b/src/shapepipe/pipeline/file_io.py @@ -1389,7 +1389,7 @@ def add_col( ) if type(col_data) != np.ndarray: - TypeError("col_data must be a numpy.ndarray") + raise TypeError("col_data must be a numpy.ndarray") if hdu_no is None: hdu_no = self.hdu_no