-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Milestone
Description
Bug summary
There is a typo in the method name contains_branch_seperately from lib/matplotlib/transforms.py:
matplotlib/lib/matplotlib/transforms.py
Line 1421 in a3fcf0b
| def contains_branch_seperately(self, other_transform): |
This should be spelled contains_branch_separately (separate not seperate).
Since this is a public API method, I propose:
- Rename the method to
contains_branch_separately(correct spelling) - Create an alias from the old
contains_branch_seperatelyspelling to the new method for backwards compatibility - Add a deprecation warning when the old name is used
- Update any internal uses and documentation to use the correct spelling
Happy to prepare a PR for this if that makes sense!
Code for reproduction
# Copied from lib/matplotlib/transforms.py
def contains_branch_seperately(self, other_transform):
"""
Return whether the given branch is a sub-tree of this transform on
each separate dimension.
A common use for this method is to identify if a transform is a blended
transform containing an Axes' data transform. e.g.::
x_isdata, y_isdata = trans.contains_branch_seperately(ax.transData)
"""
if self.output_dims != 2:
raise ValueError('contains_branch_seperately only supports '
'transforms with 2 output dimensions')
# for a non-blended transform each separate dimension is the same, so
# just return the appropriate shape.
return (self.contains_branch(other_transform), ) * 2Actual outcome
Code runs as expected, but method name contains a typo.
Expected outcome
Method name should be correctly spelled as contains_branch_separately
Additional information
No response
Operating system
No response
Matplotlib Version
Current main branch, as of a3fcf0b (25 August 2025)
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
Metadata
Metadata
Assignees
Labels
No labels