Commit 7f5649d
authored
Remove timezonefinder dependency (#168)
This PR removes the `timezonefinder` dependency that was automatically
looking up timezones based on latitude/longitude coordinates in the
`Location` class.
## Problem
The `timezonefinder` dependency alone is 50M+ in size and depends on
`numpy` (another 16M+), resulting in a total bloat of 66M+ for a feature
with no known users. This large dependency size also prevents pre-built
binaries from being available for ARM platforms.
## Solution
- **Removed dependency**: Removed `timezonefinder >= 6.2.0, < 7` from
`pyproject.toml`
- **Simplified behavior**: `Location.timezone` now remains `None` unless
explicitly provided during construction
- **Removed automatic lookup**: Eliminated the `__post_init__` method
that performed timezone lookup from coordinates
- **Updated tests**: Removed timezone finder mocking and updated tests
to verify the new behavior
- **Added documentation**: Comprehensive RELEASE_NOTES.md with migration
guide
## Breaking Change
This is a **breaking change** shipped in a patch release because this
feature has no known users. The timezone lookup is no longer performed
automatically.
## Migration for Users Who Need Timezone Lookup
If timezone lookup from coordinates is needed, install `timezonefinder`
separately and implement manual lookup:
```python
# Install: pip install timezonefinder
from timezonefinder import TimezoneFinder
from zoneinfo import ZoneInfo
from frequenz.client.microgrid import Location
tf = TimezoneFinder()
tz_name = tf.timezone_at(lat=52.52, lng=13.405)
timezone = ZoneInfo(tz_name) if tz_name else None
location = Location(latitude=52.52, longitude=13.405, timezone=timezone)
```
## Before/After
**Before:**
```python
# Automatic timezone lookup
location = Location(latitude=52.52, longitude=13.405)
print(location.timezone) # ZoneInfo('Europe/Berlin') - looked up automatically
```
**After:**
```python
# Explicit timezone only
location = Location(latitude=52.52, longitude=13.405)
print(location.timezone) # None - no automatic lookup
# Or provide explicitly
location = Location(latitude=52.52, longitude=13.405, timezone=ZoneInfo('Europe/Berlin'))
print(location.timezone) # ZoneInfo('Europe/Berlin')
```
Fixes #75.File tree
4 files changed
+29
-74
lines changed- src/frequenz/client/microgrid
- tests
4 files changed
+29
-74
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
9 | | - | |
| 12 | + | |
10 | 13 | | |
11 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
12 | 19 | | |
13 | | - | |
| 20 | + | |
14 | 21 | | |
15 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
16 | 27 | | |
17 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
| |||
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 23 | + | |
43 | 24 | | |
44 | 25 | | |
45 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
40 | 18 | | |
41 | 19 | | |
42 | 20 | | |
43 | 21 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 22 | + | |
47 | 23 | | |
48 | 24 | | |
49 | 25 | | |
50 | 26 | | |
51 | 27 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 28 | | |
70 | 29 | | |
71 | 30 | | |
| |||
81 | 40 | | |
82 | 41 | | |
83 | 42 | | |
84 | | - | |
| 43 | + | |
85 | 44 | | |
86 | 45 | | |
87 | 46 | | |
88 | 47 | | |
| 48 | + | |
89 | 49 | | |
90 | 50 | | |
91 | 51 | | |
| |||
0 commit comments