GeezerVison is showing github.com — Fix pzmap grid (matplotlib angle_helper) by bnavigator · Pull Request #456 · python-control/python-control
Conversation
CI runs started to fail today with:
Traceback (most recent call last):
959 File "pvtol-nested.py", line 169, in <module>
960 P, Z = pzmap(T, plot=True, grid=True)
961 File "/home/travis/build/python-control/python-control/control/pzmap.py", line 106, in pzmap
962 ax, fig = sgrid()
963 File "/home/travis/build/python-control/python-control/control/grid.py", line 82, in sgrid
964 ax.axis["wnxneg"] = axis = ax.new_floating_axis(0, 180)
965 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/axislines.py", line 575, in new_floating_axis
966 axes=self)
967 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py", line 350, in new_floating_axis
968 axisline = AxisArtist(axes, _helper)
969 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/axis_artist.py", line 746, in __init__
970 self._init_line()
971 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/axis_artist.py", line 887, in _init_line
972 self._axis_artist_helper.get_line(self.axes),
973 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py", line 270, in get_line
974 self.update_lim(axes)
975 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py", line 101, in update_lim
976 self.grid_helper.update_lim(axes)
977 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/axislines.py", line 327, in update_lim
978 self._update(x1, x2, y1, y2)
979 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py", line 319, in _update
980 self._update_grid(x1, y1, x2, y2)
981 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py", line 367, in _update_grid
982 self.grid_info = self.grid_finder.get_grid_info(x1, y1, x2, y2)
983 File "/home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/mpl_toolkits/axisartist/grid_finder.py", line 104, in get_grid_info
984 extremes = self.extreme_finder(self.inv_transform_xy, x1, y1, x2, y2)
985 File "/home/travis/build/python-control/python-control/control/grid.py", line 44, in __call__
986 self._adjust_extremes(lon_min, lon_max, lat_min, lat_max)
987AttributeError: 'ModifiedExtremeFinderCycle' object has no attribute '_adjust_extremes'
Apparently Matplotlib removed the private function _adjust_extremes between 3.2 and 3.3 (I could not find the commit yet. Clicking blame on github doesn't work. Their git history is weird).
The specific branch of pzmap and this portion of grid.py are not covered by the unit tests. Hence it was not discovered until now, when conda updated matplotlib and it fails in the pvtol-nested.pyexample.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coveralls
commented
Aug 20, 2020
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Coverage increased (+2.0%) to 86.168% when pulling 5632796 on bnavigator:fix-mpl-grid into 08d5e6c on python-control:master.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
bnavigator
commented
Aug 20, 2020
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
Added unit tests so we don't rely on the examples and coda. Two fixtures editsdefaults and mplcleanup written for #438 are perfect for the use case here, so I pulled them from there. That should be relative benign when merging.
Found a copy and paste error in the pzmap defaults handling
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Look at that increased coverage :)
Found another config/"defaults" handling bug in pzmap through the tests.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 21, 2020
This was
linked to
issues
Aug 21, 2020
bnavigator reacted with hooray emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
With @roryyorke's approved review and the fact that without this fix current CI runs fail, I fell confident on merging this now.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|