Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5f52428

Browse filesBrowse files
authored
Merge pull request #27513 from oscargus/transformtestdoc
Fix docs and add tests for transform and deprecate `BboxTransformToMaxOnly`
2 parents e90058d + 7d98270 commit 5f52428
Copy full SHA for 5f52428

File tree

Expand file treeCollapse file tree

3 files changed

+25
-1
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+25
-1
lines changed
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
``BboxTransformToMaxOnly``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
... is deprecated without replacement. If you rely on this, please make a copy of the
5+
code.

‎lib/matplotlib/tests/test_transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_transforms.py
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,3 +1054,21 @@ def test_transformedbbox_contains():
10541054
assert bb.contains(1.25, 1.5)
10551055
assert not bb.fully_contains(1.25, 1.5)
10561056
assert not bb.fully_contains(.1, .1)
1057+
1058+
1059+
def test_interval_contains():
1060+
assert mtransforms.interval_contains((0, 1), 0.5)
1061+
assert mtransforms.interval_contains((0, 1), 0)
1062+
assert mtransforms.interval_contains((0, 1), 1)
1063+
assert not mtransforms.interval_contains((0, 1), -1)
1064+
assert not mtransforms.interval_contains((0, 1), 2)
1065+
assert mtransforms.interval_contains((1, 0), 0.5)
1066+
1067+
1068+
def test_interval_contains_open():
1069+
assert mtransforms.interval_contains_open((0, 1), 0.5)
1070+
assert not mtransforms.interval_contains_open((0, 1), 0)
1071+
assert not mtransforms.interval_contains_open((0, 1), 1)
1072+
assert not mtransforms.interval_contains_open((0, 1), -1)
1073+
assert not mtransforms.interval_contains_open((0, 1), 2)
1074+
assert mtransforms.interval_contains_open((1, 0), 0.5)

‎lib/matplotlib/transforms.py

Copy file name to clipboardExpand all lines: lib/matplotlib/transforms.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2617,9 +2617,10 @@ def get_matrix(self):
26172617
return self._mtx
26182618

26192619

2620+
@_api.deprecated("3.9")
26202621
class BboxTransformToMaxOnly(BboxTransformTo):
26212622
"""
2622-
`BboxTransformTo` is a transformation that linearly transforms points from
2623+
`BboxTransformToMaxOnly` is a transformation that linearly transforms points from
26232624
the unit bounding box to a given `Bbox` with a fixed upper left of (0, 0).
26242625
"""
26252626
def get_matrix(self):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.