From 09e9f1857bf60fe1e69648cb9de53f88d3682f65 Mon Sep 17 00:00:00 2001 From: Joshua Clark Date: Tue, 21 Jul 2015 20:46:51 -0600 Subject: [PATCH 1/3] changed lonlat_box param order fixed issue #48 --- siphon/http_util.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/siphon/http_util.py b/siphon/http_util.py index d0cef9c4b..10b14970a 100644 --- a/siphon/http_util.py +++ b/siphon/http_util.py @@ -163,7 +163,7 @@ def add_query_parameter(self, **kwargs): self.extra_params.update(kwargs) return self - def lonlat_box(self, north, south, east, west): + def lonlat_box(self, west, east, south, north): r'''Add a latitude/longitude bounding box to the query. This adds a request for a spatial bounding box, bounded by (`south`, `north`) @@ -175,14 +175,14 @@ def lonlat_box(self, north, south, east, west): Parameters ---------- - north : float - The bounding latitude to the north, in degrees north of the equator - south : float - The bounding latitude to the south, in degrees north of the equator - east : float - The bounding longitude to the east, in degrees east of the prime meridian west: float The bounding longitude to the west, in degrees east of the prime meridian + east : float + The bounding longitude to the east, in degrees east of the prime meridian + south : float + The bounding latitude to the south, in degrees north of the equator + north : float + The bounding latitude to the north, in degrees north of the equator Returns ------- @@ -190,8 +190,7 @@ def lonlat_box(self, north, south, east, west): Returns self for chaining calls ''' - self._set_query(self.spatial_query, north=north, south=south, - east=east, west=west) + self._set_query(self.spatial_query, west=west, east=east, south=south, north=north) return self def lonlat_point(self, lon, lat): From f0fb7ee2013edabd397e3284d27a247ac4e248a4 Mon Sep 17 00:00:00 2001 From: Joshua Clark Date: Wed, 22 Jul 2015 15:03:01 -0600 Subject: [PATCH 2/3] fixed test and pep issues --- siphon/http_util.py | 3 ++- siphon/tests/test_http_util.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/siphon/http_util.py b/siphon/http_util.py index 10b14970a..d5c4816a8 100644 --- a/siphon/http_util.py +++ b/siphon/http_util.py @@ -190,7 +190,8 @@ def lonlat_box(self, west, east, south, north): Returns self for chaining calls ''' - self._set_query(self.spatial_query, west=west, east=east, south=south, north=north) + self._set_query(self.spatial_query, west=west, east=east, south=south, + north=north) return self def lonlat_point(self, lon, lat): diff --git a/siphon/tests/test_http_util.py b/siphon/tests/test_http_util.py index 3008d650b..9da0d1135 100644 --- a/siphon/tests/test_http_util.py +++ b/siphon/tests/test_http_util.py @@ -81,10 +81,10 @@ def test_spatial_reset(self): def test_spatial_reset2(self): dr = DataQuery().lonlat_point(-1, -2).lonlat_box(1, 2, 3, 4) query = str(dr) - assert 'east=3' in query - assert 'west=4' in query - assert 'north=1' in query - assert 'south=2' in query + assert 'south=3' in query + assert 'north=4' in query + assert 'west=1' in query + assert 'east=2' in query eq_(query.count('='), 4) def test_iter(self): From a47c05243a812bbb76cba3c317d209f3a5e91fe2 Mon Sep 17 00:00:00 2001 From: Joshua Clark Date: Wed, 22 Jul 2015 22:03:38 -0600 Subject: [PATCH 3/3] changed doc string to trigger travis/coverage test please based gods travis and coverage --- siphon/http_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/siphon/http_util.py b/siphon/http_util.py index d5c4816a8..46c38096e 100644 --- a/siphon/http_util.py +++ b/siphon/http_util.py @@ -166,8 +166,8 @@ def add_query_parameter(self, **kwargs): def lonlat_box(self, west, east, south, north): r'''Add a latitude/longitude bounding box to the query. - This adds a request for a spatial bounding box, bounded by (`south`, `north`) - for latitude and (`west`, `east`) for the longitude. This modifies the query + This adds a request for a spatial bounding box, bounded by ('north', 'south') + for latitude and ('east', 'west') for the longitude. This modifies the query in-place, but returns ``self`` so that multiple queries can be chained together on one line.