Commit e14f65e9 authored by Adam Paquette's avatar Adam Paquette
Browse files

Exposed the _clean method in edge to the non-private method clean.

parent 587292b5
Loading
Loading
Loading
Loading
+6 −6
Changes for autocnet/graph/edge.py: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ class Edge(dict, MutableMapping):
    def ratio_check(self, clean_keys=[], **kwargs):
        if hasattr(self, 'matches'):

            matches, mask = self._clean(clean_keys)
            matches, mask = self.clean(clean_keys)

            self.distance_ratio = od.DistanceRatio(matches)
            self.distance_ratio.compute(mask=mask, **kwargs)
@@ -178,7 +178,7 @@ class Edge(dict, MutableMapping):
        if not hasattr(self, 'matches'):
            raise AttributeError('Matches have not been computed for this edge')
            return
        matches, mask = self._clean(clean_keys)
        matches, mask = self.clean(clean_keys)

        # TODO: Homogeneous is horribly inefficient here, use Numpy array notation
        s_keypoints = self.source.get_keypoint_coordinates(index=matches['source_idx'],
@@ -229,7 +229,7 @@ class Edge(dict, MutableMapping):
        else:
            raise AttributeError('Matches have not been computed for this edge')

        matches, mask = self._clean(clean_keys)
        matches, mask = self.clean(clean_keys)

        s_keypoints = self.source.get_keypoint_coordinates(index=matches['source_idx'])
        d_keypoints = self.destination.get_keypoint_coordinates(index=matches['destination_idx'])
@@ -287,7 +287,7 @@ class Edge(dict, MutableMapping):
                self.matches[column] = default

        # Build up a composite mask from all of the user specified masks
        matches, mask = self._clean(clean_keys)
        matches, mask = self.clean(clean_keys)

        # Grab the full images, or handles
        if tiled is True:
@@ -357,7 +357,7 @@ class Edge(dict, MutableMapping):
        if not hasattr(self, 'matches'):
            raise AttributeError('This edge does not yet have any matches computed.')

        matches, mask = self._clean(clean_keys)
        matches, mask = self.clean(clean_keys)
        domain = self.source.geodata.raster_size

        # Massage the dataframe into the correct structure
@@ -381,7 +381,7 @@ class Edge(dict, MutableMapping):
    def plot(self, ax=None, clean_keys=[], **kwargs):
        return plot_edge(self, ax=ax, clean_keys=clean_keys, **kwargs)

    def _clean(self, clean_keys, pid=None):
    def clean(self, clean_keys, pid=None):
        """
        Given a list of clean keys and a provenance id compute the
        mask of valid matches
+1 −1
Changes for autocnet/graph/node.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ class Node(dict, MutableMapping):
        edge_matches = []
        for e in incident_edges:
            edge = cg[e[0]][e[1]]
            matches, mask = edge._clean(clean_keys=clean_keys)
            matches, mask = edge.clean(clean_keys=clean_keys)
            # Add a depth mask that initially mirrors the fundamental mask
            edge_matches.append(matches)
        d = pd.concat(edge_matches)