Skip to content

Commit

Permalink
0.9.0
Browse files Browse the repository at this point in the history
Use the logging module and add remove quiet option
  • Loading branch information
JamieTaylor-TUOS committed Apr 11, 2022
1 parent 8db8c7b commit 33d95f9
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 82 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Geocode various geographical entities including postcodes and LLSOAs. Reverse-geocode to LLSOA or GSP/GNode.

*Latest Version: 0.8.10*
*Latest Version: 0.9.0*

## What is this repository for?

Expand Down
10 changes: 5 additions & 5 deletions Tests/test_geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class geocodeTestCase(unittest.TestCase):
"""Tests for `geocode.py`."""
def setUp(self):
with Geocoder(quiet=True) as geo:
with Geocoder(progress_bar=False) as geo:
geo.clear_cache(delete_gmaps_cache=True)

def test_geocode_llsoa(self):
Expand All @@ -32,7 +32,7 @@ def test_geocode_llsoa(self):
(55.94492620443608, -4.333451009831742),
(55.91836588770352, -4.21934323024909)
]
with Geocoder(quiet=True) as geo:
with Geocoder(progress_bar=False) as geo:
self.assertAlmostEqual(geo.geocode_llsoa(llsoas), centroids)

def test_reverse_geocode_llsoa(self):
Expand All @@ -49,7 +49,7 @@ def test_reverse_geocode_llsoa(self):
(55.94492620443608, -4.333451009831742)
]
datazone_latlons = [(55.91836588770352, -4.21934323024909)]
with Geocoder(quiet=True) as geo:
with Geocoder(progress_bar=False) as geo:
self.assertEqual(geo.reverse_geocode_llsoa(latlons), llsoas)
self.assertEqual(geo.reverse_geocode_llsoa(datazone_latlons, datazones=True), datazones)

Expand All @@ -64,15 +64,15 @@ def test_geocode_constituency(self):
(51.5047741, -3.163350737),
(55.90118449, -4.743636917),
]
with Geocoder(quiet=True) as geo:
with Geocoder(progress_bar=False) as geo:
self.assertAlmostEqual(geo.geocode_constituency(constituencies), latlons)

# def test_reverse_geocode_gsp(self):
# """
# Test the `reverse_geocode_gsp` function with several test cases.
# """

# with Geocoder(quiet=True) as geo:
# with Geocoder(progress_bar=False) as geo:
# assertAlmostEqual(geo.geocode_constituency(constituencies), latlons)

if __name__ == "__main__":
Expand Down
Loading

0 comments on commit 33d95f9

Please sign in to comment.