Ignore some overflow and invalid value warnings. >>> ignore_overflow_warnings()
()
| 146 | |
| 147 | |
| 148 | def ignore_overflow_warnings() -> None: |
| 149 | """ |
| 150 | Ignore some overflow and invalid value warnings. |
| 151 | |
| 152 | >>> ignore_overflow_warnings() |
| 153 | """ |
| 154 | warnings.filterwarnings( |
| 155 | "ignore", category=RuntimeWarning, message="overflow encountered in multiply" |
| 156 | ) |
| 157 | warnings.filterwarnings( |
| 158 | "ignore", |
| 159 | category=RuntimeWarning, |
| 160 | message="invalid value encountered in multiply", |
| 161 | ) |
| 162 | warnings.filterwarnings( |
| 163 | "ignore", category=RuntimeWarning, message="overflow encountered in absolute" |
| 164 | ) |
| 165 | warnings.filterwarnings( |
| 166 | "ignore", category=RuntimeWarning, message="overflow encountered in exp" |
| 167 | ) |
| 168 | |
| 169 | |
| 170 | if __name__ == "__main__": |