anntzer / mplcursors

Compare ccf76c2 ... +0 ... b02f3d9

Coverage Reach
_pick_info.py _mplcursors.py __init__.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

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)

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
Project Totals (3 files) 94.56%
Loading