Skip to content

Commit 9a6acff

Browse files
committed
Improve value bounding in QwtLogTransform.bounded to handle array inputs and ensure proper type conversion
1 parent 047b119 commit 9a6acff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

qwt/transform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def bounded(self, value):
169169
:param float value: Value to be bounded
170170
:return: Value modified
171171
"""
172-
return np.clip(float(value), self.LogMin, self.LogMax)
172+
bval = np.clip(np.asarray(value, dtype=np.float64), self.LogMin, self.LogMax)
173+
return bval.item() if bval.ndim == 0 else bval
173174

174175
def transform(self, value):
175176
"""

0 commit comments

Comments
 (0)