From dca44c4a9601bbd2ea4126d210f12cd6e231ef67 Mon Sep 17 00:00:00 2001 From: Sven Kreiss Date: Wed, 15 Nov 2017 16:35:30 -0500 Subject: [PATCH 1/7] fix min area --- s2sphere/sphere.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s2sphere/sphere.py b/s2sphere/sphere.py index 9cebee5..1ebdb5d 100644 --- a/s2sphere/sphere.py +++ b/s2sphere/sphere.py @@ -1668,7 +1668,7 @@ def __init__(self, deriv): AVG_AREA = AreaMetric(4 * math.pi / 6) # true for all projections -MIN_AREA = AreaMetric(8 * math.sqrt(2)) # quadratic projection +MIN_AREA = AreaMetric(8 * math.sqrt(2) / 9) # quadratic projection MAX_AREA = AreaMetric(2.635799256963161491) # quadratic projection From 3982b91537bacc56a71e7a65d26a8b57414cff3c Mon Sep 17 00:00:00 2001 From: Sven Kreiss Date: Wed, 15 Nov 2017 16:59:12 -0500 Subject: [PATCH 2/7] improve documentation and remove coveralls from ci --- circle.yml | 5 +---- docs/sphinx/api.rst | 6 ++++++ docs/sphinx/requirements.txt | 2 +- s2sphere/sphere.py | 19 +++++++++++-------- setup.py | 3 +-- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/circle.yml b/circle.yml index ea5d573..6d00d75 100644 --- a/circle.yml +++ b/circle.yml @@ -1,12 +1,9 @@ machine: environment: - TESTCMD: 'python -V && pip install .[tests] && flake8 && nosetests --with-coverage -vv' + TESTCMD: 'python -V && pip install .[tests] && flake8 && nosetests -vv' test: override: - deactivate && pyenv shell 2.7.11 && bash -c "$TESTCMD" - deactivate && pyenv shell 3.4.4 && bash -c "$TESTCMD" - deactivate && pyenv shell 3.5.1 && bash -c "$TESTCMD" - - post: - - coveralls diff --git a/docs/sphinx/api.rst b/docs/sphinx/api.rst index 8cac01d..bab4e19 100644 --- a/docs/sphinx/api.rst +++ b/docs/sphinx/api.rst @@ -12,6 +12,12 @@ API :members: :undoc-members: +.. autodata:: s2sphere.MIN_AREA + +.. autodata:: s2sphere.AVG_AREA + +.. autodata:: s2sphere.MAX_AREA + .. autoclass:: s2sphere.Cap :members: :undoc-members: diff --git a/docs/sphinx/requirements.txt b/docs/sphinx/requirements.txt index b4ccbb7..72a4428 100644 --- a/docs/sphinx/requirements.txt +++ b/docs/sphinx/requirements.txt @@ -1 +1 @@ -Sphinx>=1.4.1 +Sphinx>=1.6.5 diff --git a/s2sphere/sphere.py b/s2sphere/sphere.py index 1ebdb5d..ba3ed13 100644 --- a/s2sphere/sphere.py +++ b/s2sphere/sphere.py @@ -1655,21 +1655,24 @@ def __init__(self, deriv): class AreaMetric(Metric): - """Area metric. A 2D specialization of :class:`s2sphere.Metric`. + """Area metric. A 2D specialization of `s2sphere.Metric` (check for API). - Preconfigured instances of this class are - :const:`s2sphere.AVG_AREA`, :const:`s2sphere.MIN_AREA`, - :const:`s2sphere.MAX_AREA`. + Preconfigured instances of this class are `s2sphere.AVG_AREA`, + `s2sphere.MIN_AREA`, `s2sphere.MAX_AREA`. - see :cpp:class:`S2::AreaMetric` + See C++ docs at :cpp:class:`S2::AreaMetric`. """ def __init__(self, deriv): super(AreaMetric, self).__init__(deriv, 2) +#: Average cell area for all projections. +AVG_AREA = AreaMetric(4 * math.pi / 6) + +#: Minimum cell area for quadratic projections. +MIN_AREA = AreaMetric(8 * math.sqrt(2) / 9) -AVG_AREA = AreaMetric(4 * math.pi / 6) # true for all projections -MIN_AREA = AreaMetric(8 * math.sqrt(2) / 9) # quadratic projection -MAX_AREA = AreaMetric(2.635799256963161491) # quadratic projection +#: Maximum cell area for quadratic projections. +MAX_AREA = AreaMetric(2.635799256963161491) def drem(x, y): diff --git a/setup.py b/setup.py index 029b0bb..ca94fd9 100644 --- a/setup.py +++ b/setup.py @@ -27,10 +27,9 @@ 'hacking>=0.11.0', 'nose>=1.3.4', 'numpy>=1.11.0', - 'coveralls>=1.1', ], 'docs': [ - 'Sphinx>=1.4.1', + 'Sphinx>=1.6.5', 'sphinx-rtd-theme>=0.1.9', ] }, From 98cfcf5b1ab559216f88fd1b1e6ee0420c49579a Mon Sep 17 00:00:00 2001 From: Sven Kreiss Date: Wed, 15 Nov 2017 17:06:59 -0500 Subject: [PATCH 3/7] lint --- s2sphere/sphere.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/s2sphere/sphere.py b/s2sphere/sphere.py index ba3ed13..eb80971 100644 --- a/s2sphere/sphere.py +++ b/s2sphere/sphere.py @@ -1665,12 +1665,15 @@ class AreaMetric(Metric): def __init__(self, deriv): super(AreaMetric, self).__init__(deriv, 2) + #: Average cell area for all projections. AVG_AREA = AreaMetric(4 * math.pi / 6) + #: Minimum cell area for quadratic projections. MIN_AREA = AreaMetric(8 * math.sqrt(2) / 9) + #: Maximum cell area for quadratic projections. MAX_AREA = AreaMetric(2.635799256963161491) From 69728c8296302f3bbfb7c8d938b95e6c405514ef Mon Sep 17 00:00:00 2001 From: Sven Kreiss Date: Wed, 15 Nov 2017 17:12:11 -0500 Subject: [PATCH 4/7] upgrade pip --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 6d00d75..2e64970 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: environment: - TESTCMD: 'python -V && pip install .[tests] && flake8 && nosetests -vv' + TESTCMD: 'python -V && pip install --upgrade pip && pip install .[tests] && flake8 && nosetests -vv' test: override: From 9885c6178341071695a4e74e4831a2dd35d5f5dd Mon Sep 17 00:00:00 2001 From: Sven Kreiss Date: Wed, 15 Nov 2017 17:24:06 -0500 Subject: [PATCH 5/7] fix Travis installs --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35472c7..3bd2f62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,9 +27,9 @@ matrix: script: - git submodule update --init --recursive -- pip install --upgrade pip -- pip install numpy nose flake8 hacking -- pip install . +- pip install --user --upgrade pip +- pip install --user numpy nose flake8 hacking +- pip install --user . - flake8 - nosetests-2.7 -vv - | From f27e7d0f4ec8fa416e5e90d7fda1ba9888cb48a9 Mon Sep 17 00:00:00 2001 From: Sven Kreiss Date: Thu, 16 Nov 2017 11:07:48 -0500 Subject: [PATCH 6/7] try to fix Travis OSX build --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3bd2f62..baa7690 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,9 @@ matrix: compiler: clang script: +- ls ~/Library/Python/2.7/bin/ +- ls ~/Library/Python/3.4/bin/ +- export PATH=$PATH:~/Library/Python/2.7/bin/ - git submodule update --init --recursive - pip install --user --upgrade pip - pip install --user numpy nose flake8 hacking From 114d1f8b6cb5fabffd84a35bed883c0de3c16799 Mon Sep 17 00:00:00 2001 From: Sven Kreiss Date: Thu, 16 Nov 2017 12:10:56 -0500 Subject: [PATCH 7/7] remove debug --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index baa7690..17218ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,8 +26,6 @@ matrix: compiler: clang script: -- ls ~/Library/Python/2.7/bin/ -- ls ~/Library/Python/3.4/bin/ - export PATH=$PATH:~/Library/Python/2.7/bin/ - git submodule update --init --recursive - pip install --user --upgrade pip