Commit e758b484 authored by Jay's avatar Jay
Browse files

swaps to pytest and fixes issues where edge['weight'] is a known type in nx

parent 0a288fa0
Loading
Loading
Loading
Loading
+4 −4
Changes for .travis.yml: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -49,11 +49,11 @@ install:
  - conda install -c conda-forge vlfeat
  - conda install -c menpo cyvlfeat
  - pip install pillow pysal
  - conda install scipy networkx numexpr dill cython pyyaml matplotlib runipy pytest
  - conda install scipy networkx numexpr dill cython pyyaml matplotlib runipy

  # Development installation
  - conda install nose coverage sh anaconda-client
  - pip install coveralls
  - conda install pytest sh anaconda-client
  - pip install pytest-cov
  # - python runipynbs.py


@@ -67,7 +67,7 @@ install:
  - python condaci.py setup

script:
  - nosetests --with-coverage --cover-package=autocnet
  - py.test --cov-report term-missing --cov=autocnet .

after_success:
  # Upload to anaconda and push to coveralls
+5 −5
Changes for autocnet/graph/edge.py: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ class Edge(dict, MutableMapping):
    masks : set
            A list of the available masking arrays

    weight : dict
    weights : dict
             Dictionary with two keys overlap_area, and overlap_percn
             overlap_area returns the area overlaped by both images
             overlap_percn retuns the total percentage of overlap
@@ -42,7 +42,7 @@ class Edge(dict, MutableMapping):
        self['homography'] = None
        self['fundamental_matrix'] = None
        self.matches = None
        self['weight'] = {}
        self['weights'] = {}

    def __repr__(self):
        return """
@@ -420,15 +420,15 @@ class Edge(dict, MutableMapping):
        """
        Acts on an edge and returns the overlap area and percentage of overlap
        between the two images on the edge. Data is returned to the
        weight dictionary
        weights dictionary
        """
        poly1 = self.source.geodata.footprint
        poly2 = self.destination.geodata.footprint

        overlapinfo = cg.two_poly_overlap(poly1, poly2)

        self['weight']['overlap_area'] = overlapinfo[1]
        self['weight']['overlap_percn'] = overlapinfo[0]
        self['weights']['overlap_area'] = overlapinfo[1]
        self['weights']['overlap_percn'] = overlapinfo[0]

    def coverage(self, clean_keys = []):
        """