-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Unregister_scale() function to matplotlib.scale #31547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
12c9d66
9536088
0a4417d
cc686b1
99690bc
d9bf8cf
2747f55
e673532
d56e2ef
0081c89
8400592
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -433,3 +433,23 @@ def test_val_in_range_base_fallback(): | |
| assert s.val_in_range(np.nan) is False | ||
| assert s.val_in_range(np.inf) is False | ||
| assert s.val_in_range(-np.inf) is False | ||
|
|
||
|
|
||
| def test_unregister_scale(): | ||
| """Test that unregister_scale removes a scale correctly.""" | ||
| # Register a temporary custom scale | ||
| class TempScale(mscale.LinearScale): | ||
| name = 'temp_test_scale' | ||
|
|
||
| mscale.register_scale(TempScale) | ||
| assert 'temp_test_scale' in mscale._scale_mapping | ||
|
|
||
| # Now unregister it | ||
| mscale.unregister_scale('temp_test_scale') | ||
| assert 'temp_test_scale' not in mscale._scale_mapping | ||
|
|
||
|
|
||
| def test_unregister_scale_invalid(): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deregister
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @story645! I've updated the function and test names to use deregister_scale. Please taek a look.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still didn't catch everything, |
||
| """Test that unregister_scale raises ValueError for unknown scale.""" | ||
| with pytest.raises(ValueError, match="not registered"): | ||
| mscale.unregister_scale('this_does_not_exist') | ||
Uh oh!
There was an error while loading. Please reload this page.