Skip to content

Commit 442559a

Browse files
committed
Remove unnecessary warning catch following plotpy verrsion upgrade
1 parent be1ff39 commit 442559a

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ See DataLab [roadmap page](https://datalab-platform.com/en/contributing/roadmap.
3333

3434
* Intensity profile / Segment profile extraction:
3535
* When extracting a profile on an image with a ROI defined, the associated PlotPy feature show a warning message ('UserWarning: Warning: converting a masked element to nan.') but the profile is correctly extracted and displayed, with NaN values where the ROI is not defined.
36-
* This warning message will persist until PlotPy v2.5.2 is released
3736
* NaN values are now removed from the profile before plotting it
3837
* Simple processing features with a one-to-on mapping with a Python function (e.g. `numpy.absolute`, `numpy.log10`, etc.) and without parameters: fix result object title which was systematically ending with "|" (the character that usually precedes the list of parameters)
3938
* Butterworth filter: fix cutoff frequency ratio default value and valid range

cdl/computation/image/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
from __future__ import annotations
1414

15-
import warnings
1615
from collections.abc import Callable
1716
from typing import Any, Literal
1817

@@ -867,12 +866,7 @@ def compute_segment_profile(src: ImageObj, p: SegmentProfileParam) -> ImageObj:
867866
p.row2 = min(p.row2, data.shape[0] - 1)
868867
p.col2 = min(p.col2, data.shape[1] - 1)
869868
suffix = f"({p.row1}, {p.col1})-({p.row2}, {p.col2})"
870-
871-
# TODO: Remove the warning catch when upgrading to PlotPy >= 2.5.2
872-
with warnings.catch_warnings():
873-
warnings.simplefilter("ignore", UserWarning)
874-
x, y = csline(data, p.row1, p.col1, p.row2, p.col2)
875-
869+
x, y = csline(data, p.row1, p.col1, p.row2, p.col2)
876870
x, y = x[~np.isnan(y)], y[~np.isnan(y)] # Remove NaN values
877871
dst = dst_11_signal(src, "segment_profile", suffix)
878872
dst.set_xydata(np.array(x, dtype=float), np.array(y, dtype=float))

0 commit comments

Comments
 (0)