Commit 1421f2e1 authored by Jay's avatar Jay Committed by jay
Browse files

RTD change and additional tests

parent df49ac8d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ for d in dirs:
        file_2_dir[f] = tmp
print(file_2_dir)

def get_path(example_name):
def get_path(example_name): # pragma: no cover
    """
    Get the path of the example file

@@ -43,7 +43,7 @@ def get_path(example_name):
        raise KeyError(example_name + ' not found in built-in examples')


def available(directory='', verbose=False):
def available(directory='', verbose=False): # pragma: no cover
    """
    List available datasets in autocnet.examples

+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ class GeoDataSet(object):
            try:
                self._srs.MorphToESRI()
                self._srs.MorphFromESRI()
            except: pass
            except: pass #pragma: no cover

            #Setup the GCS
            self._gcs = self._srs.CloneGeogCS()
+14 −2
Original line number Diff line number Diff line
@@ -61,6 +61,18 @@ class TestMercator(unittest.TestCase):
    def test_xpixelsize(self):
        self.assertAlmostEqual(self.ds.xpixelsize, 4630.0, 6)

    def test_xrotation(self):
        self.assertAlmostEqual(self.ds.xrotation, 0.0, 6)

    def test_yrotation(self):
        self.assertAlmostEqual(self.ds.yrotation, 0.0, 6)

    def test_centralmeridian(self):
        self.assertAlmostEqual(self.ds.central_meridian, 0.0, 6)

    def test_latlon_to_pixel(self):
        self.assertEqual(self.ds.latlon_to_pixel(0.0, 0.0), [4, 6])

    def test_readarray(self):
        arr = self.ds.readarray()
        self.assertEqual(arr.shape, (1694, 2304))
+9 −9
Original line number Diff line number Diff line
@@ -15,6 +15,15 @@

import sys
import os
from unittest.mock import MagicMock

class Mock(MagicMock):
    @classmethod
    def __getattr__(cls, name):
            return Mock()

MOCK_MODULES = ['proj4', 'gdal', 'numpy', 'pandas', 'scipy']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
@@ -285,16 +294,7 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

#For ReadTheDocs, using Mocking to get the builds working.
from unittest.mock import MagicMock

class Mock(MagicMock):
    @classmethod
    def __getattr__(cls, name):
            return Mock()

MOCK_MODULES = ['proj4', 'gdal', 'numpy', 'pandas', 'scipy']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

#NumpyDoc Options
numpydoc_show_class_members = True