Commit 3b50f9bf authored by Jay's avatar Jay Committed by Jason R Laura
Browse files

Minor cleanup.

parent c86ec291
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -183,7 +183,6 @@ class Edge(dict, MutableMapping):
        # Set the initial state of the fundamental mask in the masks
        self.masks = ('fundamental', mask)


    def add_putative_matches(self):
        if not hasattr(self, 'fundamental_matrix'):
            raise(ValueError, 'Fundamental matric has not been computed')
@@ -452,14 +451,11 @@ class Edge(dict, MutableMapping):
               A boolean series to inflate back to the full match set
        """
        if clean_keys:
            panel = self.masks
            mask = panel[clean_keys].all(axis=1)
            matches = self.matches[mask]
            mask = self.masks[clean_keys].all(axis=1)
        else:
            matches = self.matches
            mask = pd.Series(True, self.matches.index)

        return matches, mask
        return self.matches[mask], mask

    def overlap(self):
        """
+10 −1
Original line number Diff line number Diff line
import itertools
import os
from time import gmtime, strftime
import warnings

import dill as pickle
import networkx as nx

from autocnet.control.control import CorrespondenceNetwork
from autocnet.fileio import io_hdf
from autocnet.fileio import io_json
from autocnet.fileio import io_utils
@@ -67,6 +67,9 @@ class CandidateGraph(nx.Graph):
            e.source = self.node[s]
            e.destination = self.node[d]

        self.creationdate = strftime("%Y-%m-%d %H:%M:%S", gmtime())
        self.modifieddate = strftime("%Y-%m-%d %H:%M:%S", gmtime())

    @classmethod
    def from_graph(cls, graph):
        """
@@ -168,6 +171,12 @@ class CandidateGraph(nx.Graph):
                input_adjacency[os.path.join(basepath, k)] = input_adjacency.pop(k)
        return cls(input_adjacency)

    def _update_date(self):
        """
        Update the last modified date attribute.
        """
        self.modifieddate = strftime("%Y-%m-%d %H:%M:%S", gmtime())

    def get_name(self, node_index):
        """
        Get the image name for the given node.
+2 −2
Original line number Diff line number Diff line
@@ -68,8 +68,8 @@ class Node(dict, MutableMapping):

    @property
    def nkeypoints(self):
        if hasattr(self, '_nkeypoints'):
            return self._nkeypoints
        if hasattr(self, '_keypoints'):
            return len(self._keypoints)
        else:
            return 0