Skip to content

Commit

Permalink
Update code for version 3.4.1 onwards of pyproj dependency
Browse files Browse the repository at this point in the history
Version 3.4.1 of pyproj changed the ESPG codes to be upper case, which
means that our tests now fail (pyproj4/pyproj#1162).

This change updates our code to also use upper case codes, and bumps the
minimum version of pyproj to ensure that we're always using a version
which also uses the upper case codes.
  • Loading branch information
klssmith committed Dec 15, 2022
1 parent 33906c2 commit 703229c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions notifications_utils/polygons.py
Expand Up @@ -24,11 +24,11 @@
# earth because the earth is not a perfect sphere.
# —
# The UK, west to east
"epsg:32629", # Zone 29N: Between 12°W and 6°W, equator and 84°N
"epsg:32630", # Zone 30N: Between 6°W and 0°W, equator and 84°N
"epsg:32631", # Zone 31N: Between 0°E and 6°E, equator and 84°N
"EPSG:32629", # Zone 29N: Between 12°W and 6°W, equator and 84°N
"EPSG:32630", # Zone 30N: Between 6°W and 0°W, equator and 84°N
"EPSG:32631", # Zone 31N: Between 0°E and 6°E, equator and 84°N
# Santa Claus village (Finland)
"epsg:32635", # Zone 35N: Between 24°E and 30°E, equator and 84°N
"EPSG:32635", # Zone 35N: Between 24°E and 30°E, equator and 84°N
}
}

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -33,7 +33,7 @@
"Flask-Redis>=0.4.0",
"pyyaml>=5.3.1",
"phonenumbers>=8.12.13",
"pyproj>=3.2.1",
"pyproj>=3.4.1",
"pytz>=2020.4",
"smartypants>=2.0.1",
"pypdf2>=2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_polygons.py
Expand Up @@ -407,7 +407,7 @@ def test_precision():

def test_passes_through_coordinates_without_converting_to_crs():
without_crs = Polygons([HACKNEY_MARSHES])
with_crs = Polygons([HACKNEY_MARSHES], utm_crs="epsg:32630")
with_crs = Polygons([HACKNEY_MARSHES], utm_crs="EPSG:32630")

assert without_crs.as_coordinate_pairs_lat_long == with_crs.as_coordinate_pairs_lat_long

Expand Down

0 comments on commit 703229c

Please sign in to comment.