Skip to content
Snippets Groups Projects

correct typing and fix a bug

Merged Mohammad Torkashvand requested to merge refactor/improve-lat-lon-validation into develop
All threads resolved!
Files
13
+ 4
6
@@ -8,9 +8,8 @@ class LatitudeCoordinate(ConstrainedStr):
"""A latitude coordinate, modeled as a constrained string.
The coordinate must match the format conforming to the latitude
range of -90 to 90 degrees. It can be a floating-point number or an integer.
Valid examples: "40.7128", "-74.0060", "90", "-90", "0".
range of `-`90 to +90 degrees. It can be a floating-point number or an integer.
Valid examples: 40.7128, -74.0060, 90, -90, 0
"""
regex = re.compile(r"^-?([1-8]?\d(\.\d+)?|90(\.0+)?)$")
@@ -27,9 +26,8 @@ class LongitudeCoordinate(ConstrainedStr):
"""A longitude coordinate, modeled as a constrained string.
The coordinate must match the format conforming to the longitude
range of -180 to 180 degrees. It can be a floating-point number or an integer.
Valid examples: "40.7128", "-74.0060", "180", "-180", "0".
range of `-`180 to 180 degrees. It can be a floating point number or an integer.
Valid examples: 40.7128, -74.0060, 180, -180, 0
"""
regex = re.compile(r"^-?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$")
Loading