mplstereonet icon indicating copy to clipboard operation
mplstereonet copied to clipboard

Address deprecation warning for 'Axes.cla'

Open hemmelig opened this issue 2 years ago • 2 comments

Address a deprecation warning for the Axes.cla method, which was added in matplotlib version 3.6. This is a very minor change, where instances of .cla have been changed to .clear.

Information on change: https://matplotlib.org/devdocs/api/next_api_changes/deprecations/23735-ES.html

hemmelig avatar Dec 29 '22 17:12 hemmelig

I suppose it would also be useful to soft deprecate the .cla method locally to maintain backwards compatibility for existing users of mplstereonet? Maybe just a wrapper:

    def cla(self):
        warnings.warn(
            "The `.cla` method has been deprecated in favour of `.clear` in "
            "matplotlib 3.6 and onwards."
        )
        self.clear()

with the appropriate import at the top.

hemmelig avatar Dec 29 '22 17:12 hemmelig

Hey,

I am also seeing this issue in the GemPy tests now.

Cheers Alex

AlexanderJuestel avatar Jan 09 '23 15:01 AlexanderJuestel