8000 Deduplicate some code between floating_axes and grid_helper_curvelinear. by anntzer · Pull Request #13394 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Deduplicate some code between floating_axes and grid_helper_curvelinear. #13394

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

Merged
merged 1 commit into from
Feb 27, 2019

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Feb 9, 2019

floating_axes.GridHelperCurveLinear inherits from
grid_helper_curvelinear.GridHelperCurveLinear.

  • In the constructor, remove the duplicated docstring and the init of
    self._old_values (also in the base class).
  • Remove commented out update_grid_finder and _update, which are
    directly inherited from the base class anyways.
  • The new_fixed_axis implementation looks the same in both classes,
    except that 1) they refer to different FixedAxisArtistHelper classes
    (add a comment to clarify) and 2) one of them sets clipping and not
    the other (likely a bug; leave a comment suggesting to investigate).
  • Remove commented-out setting of grid_info in _update_grid (grid_info
    is being redefined below anyways).
  • Remove commented-out setting of _grid_params in base class (that
    attribute doesn't exist anywhere else in the codebase).

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

`floating_axes.GridHelperCurveLinear` inherits from
`grid_helper_curvelinear.GridHelperCurveLinear`.

- In the constructor, remove the duplicated docstring and the init of
  `self._old_values` (also in the base class).
- Remove commented out `update_grid_finder` and `_update`, which are
  directly inherited from the base class anyways.
- The `new_fixed_axis` implementation looks the same in both classes,
  except that 1) they refer to different FixedAxisArtistHelper classes
  (add a comment to clarify) and 2) one of them sets clipping and not
  the other (likely a bug; leave a comment suggesting to investigate).
- Remove commented-out setting of `grid_info` in _update_grid (grid_info
  is being redefined below anyways).
- Remove commented-out setting of `_grid_params` in base class (that
  attribute doesn't exist anywhere else in the codebase).
@QuLogic QuLogic merged commit ce184f9 into matplotlib:master Feb 27, 2019
@QuLogic QuLogic added this to the v3.2.0 milestone Feb 27, 2019
@anntzer anntzer deleted the axisartist-dedup branch February 27, 2019 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0