Coverage for python/lsst/analysis/tools/warning_control.py: 100%

16 statements  

« prev     ^ index     » next       coverage.py v7.5.1, created at 2024-05-16 04:37 -0700

1# This file is part of analysis_tools. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <https://www.gnu.org/licenses/>. 

21 

22__all__ = ( 

23 "filterwarnings_action", 

24 "numpy_all_nan", 

25 "numpy_all_nan_slice", 

26 "numpy_divide_zero_divide", 

27 "numpy_divide_zero_log", 

28 "numpy_divide_zero_log10", 

29 "numpy_dof_zero", 

30 "numpy_invalid_value_cos", 

31 "numpy_invalid_value_divide", 

32 "numpy_invalid_value_log", 

33 "numpy_invalid_value_log10", 

34 "numpy_invalid_value_subtract", 

35 "numpy_invalid_value_sin", 

36 "numpy_invalid_value_sqrt", 

37 "numpy_mean_empty", 

38) 

39 

40# This will be applied to all actions. 

41# "ignore" and "error" should be used for running and debugging, respectively. 

42filterwarnings_action = "ignore" 

43 

44numpy_all_nan = r"All-NaN axis encountered" 

45numpy_all_nan_slice = r"All-NaN slice encountered" 

46numpy_divide_zero_divide = r"divide by zero encountered in divide" 

47numpy_divide_zero_log = r"divide by zero encountered in log" 

48numpy_divide_zero_log10 = r"divide by zero encountered in log10" 

49numpy_dof_zero = r"Degrees of freedom <= 0 for slice." 

50numpy_invalid_value_cos = r"invalid value encountered in cos" 

51numpy_invalid_value_divide = r"invalid value encountered in divide" 

52numpy_invalid_value_log = r"invalid value encountered in log" 

53numpy_invalid_value_log10 = r"invalid value encountered in log10" 

54numpy_invalid_value_subtract = r"invalid value encountered in subtract" 

55numpy_invalid_value_sin = r"invalid value encountered in sin" 

56numpy_invalid_value_sqrt = r"invalid value encountered in sqrt" 

57numpy_mean_empty = r"Mean of empty slice"