Commit 43e343a6 authored by jlaura's avatar jlaura Committed by GitHub
Browse files

Fixes failing tests (#113)

* Fixes failing tests

* removes python 3.5 support

* Skips conda upload if a PR
parent 3a2219eb
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -10,11 +10,10 @@ os:
  - osx

env:
  - PYTHON_VERSION=3.5 HAS_GDAL=true
  - PYTHON_VERSION=3.6 HAS_GDAL=true
  - PYTHON_VERSION=3.5 HAS_GDAL=false
  - PYTHON_VERSION=3.6 HAS_GDAL=false

  - PYTHON_VERSION=3.7 HAS_GDAL=true
  - PYTHON_VERSION=3.7 HAS_GDAL=false
before_install:
  # We do this conditionally because it saves us some downloading if the
  # version is the same.
@@ -56,7 +55,10 @@ after_success:
  - conda config --set anaconda_upload no
  - conda build recipe -q
  - builddir=(`conda build recipe --output`)
  - anaconda -t="$CONDA_UPLOAD_TOKEN" upload $builddir --label dev --force;
  - |
    if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
      anaconda -t="$CONDA_UPLOAD_TOKEN" upload $builddir --force;
    fi

  # Docs to gh-pages
  - source activate test  # Reactivate the env to have all deps installed.
+3 −3
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@ channels:
  - conda-forge
  - usgs-astrogeology
dependencies:
  - libgdal 
  - gdal 
  - libgdal < 3 
  - gdal < 3 
  - numpy 
  - pyproj 
  - h5py 
+2 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ class GeoDataset(object):

    @property
    def forward_affine(self):
        print(self.geotransform)
        self._fa = affine.Affine.from_gdal(*self.geotransform)
        return self._fa

@@ -460,6 +461,7 @@ class GeoDataset(object):
                   (Latitude, Longitude) corresponding to the given (x,y).

        """

        lon, lat = self.forward_affine * (x,y)
        lon, lat, _ = self.coordinate_transformation.TransformPoint(lon, lat)
        return lat, lon
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ def read_yaml(inputfile):
    """
    try:
        with open(inputfile, 'r') as f:
            ydict = yaml.load(f)
            ydict = yaml.safe_load(f)
    except:  # pragma: no cover
        raise IOError('Unable to load YAML file.')
    return ydict
+14 −12
Original line number Diff line number Diff line
@@ -62,7 +62,9 @@ class TestMercator(unittest.TestCase):
    def test_spheroid(self):
        sphere = self.dataset.spheroid
        self.assertAlmostEqual(sphere[0], 3396190.0, 6)
        self.assertEqual(self.dataset.spheroid, (3396190.0, 3376200.0, 169.8944472236118))
        self.assertAlmostEqual(self.dataset.spheroid[0], 3396190.0)
        self.assertAlmostEqual(self.dataset.spheroid[1], 3376200.0)
        self.assertAlmostEqual(self.dataset.spheroid[2], 169.8944472236118)
        self.assertAlmostEqual(sphere[1], 3376200.0, 6)
        self.assertAlmostEqual(sphere[2], 169.8944472236118, 6)

Loading