matplotlib icon indicating copy to clipboard operation
matplotlib copied to clipboard

Added get_shape method

Open Lumijek opened this issue 3 years ago • 4 comments

PR Summary

Added get_shape method and updated __str__ to AxesImage as specified by (#22494)

PR Checklist

Tests and Styling

  • [x] Has pytest style unit tests (and pytest passes).
  • [x] Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A ] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [x] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [x] Documentation is sphinx and numpydoc compliant (the docs should build without error).

Lumijek avatar Feb 19 '22 20:02 Lumijek

Please add tests for these changes.

You can example generate a test image as:

    ax = plt.gca()
    im = AxesImage(ax)
    z = np.arange(12, dtype=float).reshape((4, 3))
    im.set_data(z)

and then call the methods (in separate tests) and add an assert for the expected results. Add these tests to https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/tests/test_image.py

oscargus avatar Mar 06 '22 21:03 oscargus

Please do not merge the main branch into your feature branch (we prefer to rebase if there are conflicts).

tacaswell avatar Mar 06 '22 22:03 tacaswell

@Lumijek are you still planning to continue on this? If not, I'd pick this up so that it can move forward.

timhoffm avatar Apr 18 '22 19:04 timhoffm

Moved to draft until someone picks this up.

jklymak avatar May 18 '22 09:05 jklymak

It's been a while so I can write some tests for this. I don't know what the procedure is for picking up orphaned PRs though.

saranti avatar Mar 10 '23 08:03 saranti

Thanks @saranti, basically just create a new branch and a new PR referencing this one. You could git cherry-pick the relevant commit from here into your branch, or just write your new branch from scratch, whichever you prefer.

rcomer avatar Mar 10 '23 09:03 rcomer

Closing in favor of #25425

tacaswell avatar Mar 10 '23 16:03 tacaswell