Commit 0913c88e authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by GitHub
Browse files

Merge pull request #234 from jlaura/master

Updates to NetworkX2
parents da3cfdb8 d019eec0
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -13,7 +13,11 @@ os:
  - linux
  - osx

install:
env:
  - PYTHON_VERSION=3.5
  - PYTHON_VERSION=3.6

before_install:
  # We do this conditionally because it saves us some downloading if the
  # version is the same.
  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then
@@ -28,39 +32,35 @@ install:
  - conda update -q conda
  # Useful for debugging any issues with conda
  - conda info -a
  # Create the env
  - conda create -q -n test python=$PYTHON_VERSION
  - source activate test

  # Install dependencies
  - conda config --add channels conda-forge
  - conda config --add channels menpo
  - conda config --add channels jlaura
  - conda config --add channels usgs-astrogeology
  - conda config --set ssl_verify false
  - conda install -c conda-forge numpy opencv
  - conda install -c jlaura plio
  - 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 geopandas
  - conda install -c conda-forge scipy networkx numexpr dill cython pyyaml matplotlib runipy geopandas opencv numpy gdal
  - conda install -c usgs-astrogeology plio

  # Development installation
  - conda install pytest pytest-cov coverage sh anaconda-client
  - pip install coveralls

    # Straight from the menpo team
  - if [["$TRAVIS_OS_NAME" == "osx"]]; then
      curl -o condaci.py https://raw.githubusercontent.com/menpo/condaci/v0.4.8/condaci.py;
    else
      wget https://raw.githubusercontent.com/menpo/condaci/v0.4.8/condaci.py -O condaci.py;
    fi
    # Build autocnet and push to anaconda cloud
  - python condaci.py setup

script:
  - pytest autocnet tests

after_success:
  # Upload to anaconda and push to coveralls
  - ~/miniconda/bin/python condaci.py build ./conda
  - coveralls
  # Need to do the build in the root
  - source deactivate
  - conda install conda-build anaconda-client
  - conda config --set anaconda_upload yes
  - conda build --token $CONDA_UPLOAD_TOKEN --python $PYTHON_VERSION recipe

notifications:
  webhooks:
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ def identify_potential_overlaps(cg, cn, overlap=True):
        # Determine whether a 'real' lat/lon are to be used and reproject
        if overlap:
            row = p.iloc[0]
            lat, lon = cg.node[row.image_index].geodata.pixel_to_latlon(row.x, row.y)
            lat, lon = cg.node[row.image_index]['data'].geodata.pixel_to_latlon(row.x, row.y)
        else:
            lat, lon = 0,0

+2 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ from autocnet.transformation import homography as hm
from autocnet.vis.graph_view import plot_edge, plot_node, plot_edge_decomposition
from autocnet.cg import cg

from plio.io.io_gdal import GeoDataset


class Edge(dict, MutableMapping):
@@ -117,11 +118,9 @@ class Edge(dict, MutableMapping):
                "Cannot use overlap constraint, minimum bounding rectangles"
                " have not been computed for one or more Nodes")
            return

        # Get overlapping keypts
        s_idx = self.get_keypoints(self.source, overlap=True).index
        d_idx = self.get_keypoints(self.destination, overlap=True).index

        # Create a mask from matches whose rows have both source idx &
        # dest idx in the overlapping keypts
        mask = pd.Series(False, index=self.matches.index)
@@ -193,7 +192,6 @@ class Edge(dict, MutableMapping):
            else:
                mbr = self['destin_mbr']
            # Can't use overlap if we haven't computed MBRs
            print(mbr)
            if mbr is None:
                return keypts
            return keypts.query('x >= {} and x <= {} and y >= {} and y <= {}'.format(*mbr))
@@ -515,7 +513,7 @@ class Edge(dict, MutableMapping):
        Estimate a source and destination minimum bounding rectangle, in
        pixel space.
        """
        if isinstance(self.source.geodata, (int, float)):
        if not isinstance(self.source.geodata, GeoDataset):
            smbr = None
            dmbr = None
        else:
+123 −179

File changed.

Preview size limit exceeded, changes collapsed.

+12 −3
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ class Node(dict, MutableMapping):
                   self.nkeypoints, self.masks, self.__class__)

    def __hash__(self): #pragma: no cover
        return hash(repr(self))
        return hash(self['node_id'])

    def __gt__(self, other):
        myid = self['node_id']
@@ -107,9 +107,18 @@ class Node(dict, MutableMapping):
        return str(self['node_id'])

    def __eq__(self, other):
        return utils.compare_dicts(self.__dict__, other.__dict__) *\
               utils.compare_dicts(self, other)
        return self['node_id'] == other

    @classmethod
    def create(cls, image_name, node_id, basepath=None):
        try:
            image_name = os.path.basename(image_name)
        except: pass  # Use the input name even if not a valid PATH
        if basepath is not None:
            image_path = os.path.join(basepath, image_name)
        else:
            image_path = image_name
        return cls(image_name, image_path, node_id)

    @property
    def geodata(self):
Loading