<commit_before>"""Axis transform for spherical Mercator projection in matplotlib."""

__author__ = "<NAME>"
__email__ = "<EMAIL>"

import numpy as np
from matplotlib.ticker import AutoLocator
from matplotlib.transforms import Transform
from matplotlib.scale import ScaleBase
from .ticker import DegreeFormatter


class MercatorScale(ScaleBase):
    name = 'mercator'

    def __init__(self, axis, **kwargs):
        """
        Create a new scale instance.

        Parameters
        ----------
        maxlat : float, optional, default: 85.0511287798066
            Largest latitude allowed to be drawn. In the Mercator projection a
            latitude of 90 degrees transforms into infinity. To avoid drawing
            issues, all values outside of a predefined range [-maxlat, maxlat]
            will be masked.
        """
        ScaleBase.__init__(self)
        self.maxlat = kwargs.pop('maxlat', 85.0511287798066)

    def get_transform(self):
        return self.MercatorLatitudeTransform(self.maxlat)
<commit_msg>Update for matplotlib>=3.1.0 compatibility<commit_after>"""Axis transform for spherical Mercator projection in matplotlib."""

__author__ = "<NAME>"
__email__ = "<EMAIL>"

import numpy as np
from matplotlib.ticker import AutoLocator
from matplotlib.transforms import Transform
from matplotlib.scale import ScaleBase
from .ticker import DegreeFormatter


class MercatorScale(ScaleBase):
    name = 'mercator'

    def __init__(self, axis, **kwargs):
        """
        Create a new scale instance.

        Parameters
        ----------
        maxlat : float, optional, default: 85.0511287798066
            Largest latitude allowed to be drawn. In the Mercator projection a
            latitude of 90 degrees transforms into infinity. To avoid drawing
            issues, all values outside of a predefined range [-maxlat, maxlat]
            will be masked.
        """
        try:
            ScaleBase.__init__(self)
        except TypeError:
            ScaleBase.__init__(self, axis)
        self.maxlat = kwargs.pop('maxlat', 85.0511287798066)

    def get_transform(self):
        return self.MercatorLatitudeTransform(self.maxlat)

{'fraction_non_alphanumeric': 0.08390963577685569, 'fraction_numerical': 0.030889810972798526, 'mean_word_length': 2.754325259515571, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1308401', 'n_tokens_mistral': 642, 'n_tokens_neox': 570, 'n_words': 194}