anntzer / mplcursors
Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -98,7 +98,7 @@
Loading
98 98
99 99
100 100
Selection = namedtuple(
101 -
    "Selection", "artist target index dist annotation extras")
101 +
    "Selection", "artist target_ index dist annotation extras")
102 102
Selection.__doc__ = """
103 103
    A selection.
104 104
@@ -115,8 +115,11 @@
Loading
115 115
Selection.__ne__ = lambda self, other: self is not other
116 116
Selection.artist.__doc__ = (
117 117
    "The selected artist.")
118 -
Selection.target.__doc__ = (
119 -
    "The point picked within the artist, in data coordinates.")
118 +
Selection.target_.__doc__ = """
119 +
The point picked within the artist, in data coordinates.
120 +
121 +
:meta private:
122 +
"""
120 123
Selection.index.__doc__ = (
121 124
    "The index of the selected point, within the artist data.")
122 125
Selection.dist.__doc__ = (
@@ -128,6 +131,31 @@
Loading
128 131
    "at the same time as the annotation.")
129 132
130 133
134 +
class _Target(np.ndarray):
135 +
    def __new__(cls, sel):
136 +
        obj = np.asarray(sel.target_).view(cls)
137 +
        obj._sel = sel
138 +
        return obj
139 +
140 +
    @property
141 +
    def index(self):
142 +
        warnings.warn(
143 +
            "Selection.target.index is deprecated and will be removed in the "
144 +
            "future; use Selection.index instead.")
145 +
        return self._sel.index
146 +
147 +
148 +
Selection.target = property(
149 +
    _Target, doc="The point picked within the artist, in data coordinates.")
150 +
151 +
152 +
def _with_attrs(array, **kwargs):
153 +
    array = AttrArray(array)
154 +
    for k, v in kwargs.items():
155 +
        setattr(array, k, v)
156 +
    return array
157 +
158 +
131 159
@functools.singledispatch
132 160
def compute_pick(artist, event):
133 161
    """
@@ -669,7 +697,7 @@
Loading
669 697
            new_idx = int(np.floor(sel.index) + 1) % len(xys)
670 698
        else:
671 699
            return sel
672 -
        sel = sel._replace(target=xys[new_idx], index=new_idx, dist=0)
700 +
        sel = sel._replace(target_=xys[new_idx], index=new_idx, dist=0)
673 701
        if np.isfinite(sel.target).all():
674 702
            return sel
675 703
@@ -715,7 +743,7 @@
Loading
715 743
        ymin, ymax = ymax, ymin
716 744
    low, high = np.array([[xmin, ymin], [xmax, ymax]])
717 745
    target = ((idxs + .5) / ns)[::-1] * (high - low) + low
718 -
    return sel._replace(target=target, index=tuple(idxs))
746 +
    return sel._replace(target_=target, index=tuple(idxs))
719 747
720 748
721 749
@move.register(ContainerArtist)
Files Coverage
lib/mplcursors 94.56%
Project Totals (3 files) 94.56%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading