Commit 82472c4
committed
feat(geo): enhance GeoFilter with validation and documentation
- Add comprehensive docstrings to GeoFilter class with usage examples
- Add coordinate validation (longitude: -180 to 180, latitude: -90 to 90)
- Add radius validation (must be positive)
- Add from_coordinates() convenience class method
- Improve error messages with actual invalid values
- Add return type hints for better type safety
- Add clarifying comments in tests about distance calculations
These improvements address GitHub Copilot suggestions and enhance
the robustness and usability of the geographic filtering feature.1 parent 67a4098 commit 82472c4
File tree
3 files changed
+71
-7
lines changed- aredis_om/model
- tests
3 files changed
+71
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
11 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
12 | 45 | | |
13 | 46 | | |
14 | 47 | | |
15 | 48 | | |
16 | 49 | | |
17 | | - | |
| 50 | + | |
18 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
19 | 67 | | |
20 | 68 | | |
21 | 69 | | |
22 | 70 | | |
23 | 71 | | |
24 | | - | |
| 72 | + | |
25 | 73 | | |
| 74 | + | |
| 75 | + | |
26 | 76 | | |
27 | | - | |
28 | | - | |
| 77 | + | |
| 78 | + | |
29 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
30 | 90 | | |
31 | 91 | | |
32 | 92 | | |
33 | 93 | | |
34 | 94 | | |
35 | | - | |
| 95 | + | |
36 | 96 | | |
37 | | - | |
| 97 | + | |
38 | 98 | | |
39 | 99 | | |
40 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
1152 | 1154 | | |
1153 | 1155 | | |
1154 | 1156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1459 | 1459 | | |
1460 | 1460 | | |
1461 | 1461 | | |
| 1462 | + | |
| 1463 | + | |
1462 | 1464 | | |
1463 | 1465 | | |
1464 | 1466 | | |
| |||
0 commit comments