From: Scott Gasch Date: Sun, 29 May 2022 02:32:39 +0000 (-0700) Subject: Fix geocode's doctest. X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=62b4b777a68a99c8e446294f7e7e35ebd9668989;p=python_utils.git Fix geocode's doctest. --- diff --git a/geocode.py b/geocode.py index 3e83d02..3959360 100644 --- a/geocode.py +++ b/geocode.py @@ -36,7 +36,7 @@ def geocode_address(address: str) -> Optional[Dict[str, Any]]: '4600 SILVER HILL RD, WASHINGTON, DC, 20233' >>> json['result']['addressMatches'][0]['coordinates'] - {'x': -76.92743, 'y': 38.84599} + {'x': -76.9274328556918, 'y': 38.845989080537514} """ url = 'https://geocoding.geo.census.gov/geocoder/geographies/onelineaddress' @@ -76,7 +76,7 @@ def batch_geocode_addresses(addresses: List[str]): ... '700 Pennsylvania Avenue NW, Washington, DC, 20408', ... ] ... ) - ['"1"," 4600 Silver Hill Rd, Washington, DC, 20233","Match","Exact","4600 SILVER HILL RD, WASHINGTON, DC, 20233","-76.92743,38.84599","76355984","L","24","033","802405","2004"', '"2"," 935 Pennsylvania Avenue, NW, Washington, DC","No_Match"', '"3"," 1600 Pennsylvania Avenue NW, Washington, DC, 20500","Match","Exact","1600 PENNSYLVANIA AVE NW, WASHINGTON, DC, 20500","-77.03534,38.898754","76225813","L","11","001","980000","1034"', '"4"," 700 Pennsylvania Avenue NW, Washington, DC, 20408","Match","Exact","700 PENNSYLVANIA AVE NW, WASHINGTON, DC, 20408","-77.02304,38.89362","76226346","L","11","001","980000","1025"'] + ['"1"," 4600 Silver Hill Rd, Washington, DC, 20233","Match","Exact","4600 SILVER HILL RD, WASHINGTON, DC, 20233","-76.92743285599994,38.84598908100003","76355984","L","24","033","802405","2004"', '"2"," 935 Pennsylvania Avenue, NW, Washington, DC","No_Match"', '"3"," 1600 Pennsylvania Avenue NW, Washington, DC, 20500","Match","Exact","1600 PENNSYLVANIA AVE NW, WASHINGTON, DC, 20500","-77.03534009999998,38.89875363300007","76225813","L","11","001","980000","1034"', '"4"," 700 Pennsylvania Avenue NW, Washington, DC, 20408","Match","Exact","700 PENNSYLVANIA AVE NW, WASHINGTON, DC, 20408","-77.02304089899997,38.89361872300003","76226346","L","11","001","980000","1025"'] """ n = 1