| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Sorry, something went wrong.
|
Can you add a test that doesn't work on main, but is fixed by this PR? Probably in tests/test_colorbar.py. |
Sorry, something went wrong.
|
As there is now a warning, which is clearly better than an error, you will need to take that intro consideration in the test. Something like: with pytest.warns(UserWarning) as record:
ax.contour([[1, 1], [1, 1]])
assert len(record) == 1should do. Also, please add a comment like: # Smoke test for gh#23817at the beginning of the test (so that it is clear what is tested as there is "no assert" (the assert above is really not crucial for the test purpose)). Edit: the warning was probably always there, but earlier "hidden" by the error, so the first sentence is not completely correct... |
Sorry, something went wrong.
|
Thanks for the help! I've added the changes, and I'll circle back later to see if all these tests pass. |
Sorry, something went wrong.
|
It seems like there is a divide by zero(?) elsewhere in the code now: lib/matplotlib/tests/test_colorbar.py:251:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lib/matplotlib/figure.py:1276: in colorbar
cb = cbar.Colorbar(cax, mappable, **cb_kw)
lib/matplotlib/_api/deprecation.py:384: in wrapper
return func(*inner_args, **inner_kwargs)
lib/matplotlib/colorbar.py:396: in __init__
self._draw_all()
lib/matplotlib/colorbar.py:535: in _draw_all
X, Y = self._mesh()
lib/matplotlib/colorbar.py:1110: in _mesh
y, _ = self._proportional_y()
here matplotlib/lib/matplotlib/colorbar.py Lines 1223 to 1225 in cb9ae92 One should probably check something there as well? I do not know if the length of _boundaries[self._inside] is one or the first and last element is the same. |
Sorry, something went wrong.
We could probably just put in a check like this: Another idea: The boundaries are set in _process_values(), here: matplotlib/lib/matplotlib/colorbar.py Lines 1050 to 1055 in 1b3019d Not sure which section of this function we're setting the boundaries in for this case though. I imagine it would be here: matplotlib/lib/matplotlib/colorbar.py Lines 1056 to 1068 in 1b3019d I'll try the change that you mentioned for now, though. |
Sorry, something went wrong.
|
Hi @Andes0113 - is this ready for a second round of reviews? |
Sorry, something went wrong.
|
@melissawm Think this PR is ready to be closed since there are branching PRs that attempt to do the same thing and are further along in the process. I'd take a look at the more recent related PRs #24656 and #24698 because I've stopped working on this issue. |
Sorry, something went wrong.
|
Thanks for the update @Andes0113 - hope to see you again around Matplotlib! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This pull request aims to solve issue #23817 in which an error would be thrown in the event that yscaled's length was 1. To fix this, I added a check to see if yscaled's length was 1, and if so, to set automin and automax to yscaled's only value. I also moved the declaration of automin and automax inside the if statement where extendlength is declared as suggested by @oscargus , since they are unused otherwise.
PR Checklist
Tests and Styling
Documentation