🌐 AI搜索 & 代理 主页
Skip to content

Commit 9409d4c

Browse files
trygvradstory645
andcommitted
Apply suggestions from code review
Co-authored-by: hannah <story645@gmail.com>
1 parent d5c43e0 commit 9409d4c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/matplotlib/colorizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _scale_norm(self, norm, vmin, vmax, A):
7878
raise ValueError(
7979
"Passing a Normalize instance simultaneously with "
8080
"vmin/vmax is not supported. Please pass vmin/vmax "
81-
"directly to the norm when creating it")
81+
"as arguments to the norm object when creating it")
8282

8383
# always resolve the autoscaling so we have concrete limits
8484
# rather than deferring to draw time.
@@ -174,7 +174,7 @@ def _pass_image_data(x, alpha=None, bytes=False, norm=True):
174174

175175
if norm and (xx.max() > 1 or xx.min() < 0):
176176
raise ValueError("Floating point image RGB values "
177-
"must be in the 0..1 range")
177+
"must be in the [0,1] range")
178178
if bytes:
179179
xx = (xx * 255).astype(np.uint8)
180180
elif xx.dtype == np.uint8:

lib/matplotlib/tests/test_colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ def test_scalarmappable_nan_to_rgba(bytes):
14301430

14311431
# Out-of-range fail
14321432
x[1, 0, 0] = 42
1433-
with pytest.raises(ValueError, match='0..1 range'):
1433+
with pytest.raises(ValueError, match=r'\[0,1\] range'):
14341434
sm.to_rgba(x[..., :3], bytes=bytes)
14351435

14361436

0 commit comments

Comments
 (0)