Skip to content

Commit

Permalink
Use warnings instead of numpy.warnings
Browse files Browse the repository at this point in the history
The numpy.warnings alias has been removed.
  • Loading branch information
timj committed Jun 20, 2023
1 parent 8139a81 commit db50b21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scarlet/lite/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def weight_sources(blend, mask_footprint=True):
slices = overlapped_slices(observation.bbox, bbox)
numerator = _model[slices[1]]
denominator = model[slices[0]]
with np.warnings.catch_warnings():
np.warnings.filterwarnings("ignore", r"invalid value encountered")
np.warnings.filterwarnings("ignore", r"divide by zero")
with warnings.catch_warnings():
warnings.filterwarnings("ignore", r"invalid value encountered")
warnings.filterwarnings("ignore", r"divide by zero")
ratio = numerator / denominator
ratio[denominator == 0] = 0
# sometimes numerical errors can cause a hot pixel to have a slightly
Expand Down

0 comments on commit db50b21

Please sign in to comment.