# Path: contact_map/plot_utils.py
# class _ContactPlotRange(object):
#     """Object that deals with functions that are needed for plot ranges
# 
#     Parameters
#     ----------
#     n : int, tuple(start, end)
#         range of objects in the given direction (used in plotting)
#     """
#     def __init__(self, n):
#         self.n = n
#         self.min, self.max = _int_or_range_to_tuple(n)
# 
#     @property
#     def range_length(self):
#         return self.max - self.min
# 
#     def __eq__(self, other):
#         if isinstance(other, (int, tuple)):
#             return self.n == other
#         elif isinstance(other, self.__class__):
#             return self.__dict__ == other.__dict__
#         else:
#             return False
# 
#     def __ne__(self, other):
#         return not self.__eq__(other)


from .utils import *
from contact_map.plot_utils import *
from contact_map.plot_utils import _ContactPlotRange
    from matplotlib.colors import LinearSegmentedColormap
                'green': [[0.0,  0.0, 0.0],
                          [0.25, 0.0, 0.0],
                          [0.75, 1.0, 1.0],
                          [1.0,  1.0, 1.0]],
                'blue':  [[0.0,  0.0, 0.0],
                          [0.5,  0.0, 0.0],
                          [1.0,  1.0, 1.0]]},
            N=256
        )
    elif cmap == 'custom':
        # no matplotlib; can't do custom
        pytest.skip()

    color_map, expected = {
        'seismic': ('seismic', True),
        'Blues': ('Blues', False),
        'custom': (custom, False),
    }[cmap]
    if cmap == 'custom':
        with pytest.warns(UserWarning, match="Unknown colormap"):
            assert is_cmap_diverging(color_map) == expected
    else:
        assert is_cmap_diverging(color_map) == expected


class TestContactRange(object):
    def setup(self):
        self.cr = _ContactPlotRange(5)

    @pytest.mark.parametrize("case", [(_ContactPlotRange(5), True),

# Path: contact_map/plot_utils.py
# class _ContactPlotRange(object):
#     """Object that deals with functions that are needed for plot ranges
# 
#     Parameters
#     ----------
#     n : int, tuple(start, end)
#         range of objects in the given direction (used in plotting)
#     """
#     def __init__(self, n):
#         self.n = n
#         self.min, self.max = _int_or_range_to_tuple(n)
# 
#     @property
#     def range_length(self):
#         return self.max - self.min
# 
#     def __eq__(self, other):
#         if isinstance(other, (int, tuple)):
#             return self.n == other
#         elif isinstance(other, self.__class__):
#             return self.__dict__ == other.__dict__
#         else:
#             return False
# 
#     def __ne__(self, other):
#         return not self.__eq__(other)


# Path: contact_map/tests/test_plot_utils.py
from .utils import *
from contact_map.plot_utils import *
from contact_map.plot_utils import _ContactPlotRange
    from matplotlib.colors import LinearSegmentedColormap

                'green': [[0.0,  0.0, 0.0],
                          [0.25, 0.0, 0.0],
                          [0.75, 1.0, 1.0],
                          [1.0,  1.0, 1.0]],
                'blue':  [[0.0,  0.0, 0.0],
                          [0.5,  0.0, 0.0],
                          [1.0,  1.0, 1.0]]},
            N=256
        )
    elif cmap == 'custom':
        # no matplotlib; can't do custom
        pytest.skip()

    color_map, expected = {
        'seismic': ('seismic', True),
        'Blues': ('Blues', False),
        'custom': (custom, False),
    }[cmap]
    if cmap == 'custom':
        with pytest.warns(UserWarning, match="Unknown colormap"):
            assert is_cmap_diverging(color_map) == expected
    else:
        assert is_cmap_diverging(color_map) == expected


class TestContactRange(object):
    def setup(self):
        self.cr = _ContactPlotRange(5)

    @pytest.mark.parametrize("case", [(_ContactPlotRange(5), True),

                                      (_ContactPlotRange(3), False),