GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix pzmap grid (matplotlib angle_helper) by bnavigator · Pull Request #456 · python-control/python-control

Conversation

@bnavigator

@bnavigator bnavigator commented Aug 20, 2020

Copy link
Copy Markdown
Contributor

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.

All reactions
@bnavigator
update mpl_toolkit function
df0051c
@bnavigator bnavigator added this to the 0.8.4 milestone Aug 20, 2020
@bnavigator bnavigator added the bug label Aug 20, 2020
@bnavigator bnavigator self-assigned this Aug 20, 2020
@coveralls

coveralls commented Aug 20, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Coverage Status

Coverage increased (+2.0%) to 86.168% when pulling 5632796 on bnavigator:fix-mpl-grid into 08d5e6c on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
fix grid formatter
abc0c3c
@bnavigator bnavigator mentioned this pull request Aug 20, 2020
Extend returnScipySignalLTI() to discrete systems #445
Merged
@bnavigator
fix wrong config read on pzmap
bdbd198
@bnavigator

bnavigator commented Aug 20, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
bnavigator marked this pull request as ready for review August 20, 2020 21:30
@bnavigator
bnavigator force-pushed the fix-mpl-grid branch 2 times, most recently from e646370 to 6445a6a Compare August 20, 2020 21:42
@bnavigator
add pzmap_test
2ca5220
@bnavigator
bnavigator force-pushed the fix-mpl-grid branch from 6445a6a to 2ca5220 Compare August 20, 2020 22:29
@bnavigator

bnavigator commented Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

Look at that increased coverage :)

Found another config/"defaults" handling bug in pzmap through the tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
test for correct grid and no plot. fix pzmap config handling
5632796
@bnavigator
bnavigator force-pushed the fix-mpl-grid branch from b292feb to 5632796 Compare August 20, 2020 23:36
This was referenced Aug 21, 2020
pzmap(sys, grid=True) fails #458
Closed
pzmap(sys, grid=True) fails #457
Closed
This was linked to issues Aug 21, 2020
pzmap(sys, grid=True) fails #457
Closed
pzmap(sys, grid=True) fails #458
Closed
@roryyorke

roryyorke commented Aug 21, 2020

Copy link
Copy Markdown
Contributor

Looks good to me.

bnavigator reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator

bnavigator commented Aug 21, 2020

Copy link
Copy Markdown
Contributor Author

With @roryyorke's approved review and the fact that without this fix current CI runs fail, I fell confident on merging this now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
bnavigator merged commit 6ede92e into python-control:master Aug 21, 2020
@bnavigator bnavigator mentioned this pull request Aug 21, 2020
Added IPython LaTeX representation method for StateSpace objects #450
Merged
@bnavigator
bnavigator deleted the fix-mpl-grid branch January 5, 2021 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@bnavigator bnavigator

Labels

bug

Projects

None yet

Milestone

0.8.4

Development

Successfully merging this pull request may close these issues.

pzmap(sys, grid=True) fails pzmap(sys, grid=True) fails

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bnavigator @coveralls @roryyorke
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.