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

12 statements  

« prev     ^ index     » next       coverage.py v7.4.0, created at 2024-01-10 14:08 +0000

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_divide_zero_divide", 

26 "numpy_divide_zero_log", 

27 "numpy_divide_zero_log10", 

28 "numpy_dof_zero", 

29 "numpy_invalid_value_divide", 

30 "numpy_invalid_value_log", 

31 "numpy_invalid_value_log10", 

32 "numpy_invalid_value_sqrt", 

33 "numpy_mean_empty", 

34) 

35 

36# This will be applied to all actions. 

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

38filterwarnings_action = "ignore" 

39 

40numpy_all_nan = r"All-NaN axis encountered" 

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

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

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

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

45numpy_invalid_value_divide = r"invalid value encountered in divide" 

46numpy_invalid_value_log = r"invalid value encountered in log" 

47numpy_invalid_value_log10 = r"invalid value encountered in log10" 

48numpy_invalid_value_sqrt = r"invalid value encountered in sqrt" 

49numpy_mean_empty = r"Mean of empty slice"