Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
After last push, now that I know it works, removing some unnecessary things and reinstating the testing schedule.
  • Loading branch information
nataliejschultz committed Oct 9, 2023
1 parent 09e240f commit 80519bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/nominatim-docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ name: nominatim-docker-test
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
# pull_request:
# branches:
# - master

push:
branches:
- nominatim
# paths:
# - 'net/ext_service/geocoder'
# - 'analysis/intake/cleaning/clean_and_resample.py'
paths:
- 'net/ext_service/geocoder'
- 'analysis/intake/cleaning/clean_and_resample.py'

# schedule:
schedule:

# # Run every Sunday at 4:05 am
# - cron: '5 4 * * 0'
# Run every Sunday at 4:05 am
- cron: '5 4 * * 0'
jobs:
# This workflow contains a single job called "build"
build:
Expand Down
14 changes: 0 additions & 14 deletions emission/individual_tests/TestNominatim.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
GEOFABRIK_QUERY_URL = os.environ.get("GEOFABRIK_QUERY_URL")
NOMINATIM_CONTAINER_URL = os.environ.get("NOMINATIM_CONTAINER_URL")

# GFBK = os.environ.get("GFBK_KEY")

# GEOFABRIK_QUERY_URL = (
# "https://geocoding.geofabrik.de/{}".format(GFBK) if GFBK is not None
# else print("No key available")
# )
class NominatimTest(unittest.TestCase):
maxDiff = None

Expand Down Expand Up @@ -56,14 +50,6 @@ def test_geofabrik_and_nominatim(self):
for k in key_list:
self.assertEqual(osm_result[k], geofabrik_result[k])
self.assertEqual(container_result[k], geofabrik_result[k])

# #Compares the result of a call to OSM with a call to the container.
# def test_nominatim_api(self):
# nominatim_url = "http://nominatim.openstreetmap.org/reverse?lat=41.832942092439694&lon=-71.41558148857203&format=json"
# nominatim_result_raw = requests.get(nominatim_url)
# nominatim_result = nominatim_result_raw.json()['display_name'][0:70]
# container_result = eco.Geocoder.reverse_geocode(41.832942092439694, -71.41558148857203)[0:70]
# self.assertEqual(nominatim_result, container_result)

#Checks the display name generated by get_filtered_place in clean_and_resample.py, which creates a cleaned place from the fake place
# and reverse geocodes with the coordinates.
Expand Down
3 changes: 1 addition & 2 deletions emission/net/ext_service/geocoder/nominatim.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
try:
NOMINATIM_QUERY_URL = os.environ.get("NOMINATIM_QUERY_URL")
# logging.info(f"NOMINATIM_QUERY_URL: {NOMINATIM_QUERY_URL}")
print("URL Configured:", NOMINATIM_QUERY_URL)
print("Nominatim Query URL Configured!")

if NOMINATIM_QUERY_URL is None:
raise Exception("Nominatim query url not configured")
Expand Down Expand Up @@ -61,7 +61,6 @@ def make_url_reverse(cls, lat, lon):
"lon" : lon,
"format" : "json"
}

query_url = NOMINATIM_QUERY_URL + "/reverse?"
encoded_params = urllib.parse.urlencode(params)
url = query_url + encoded_params
Expand Down

0 comments on commit 80519bb

Please sign in to comment.