simple-dwd-weatherforecast 2.1.15__py3-none-any.whl → 2.1.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simple_dwd_weatherforecast/dwdforecast.py +22 -13
- simple_dwd_weatherforecast/dwdmap.py +6 -2
- {simple_dwd_weatherforecast-2.1.15.dist-info → simple_dwd_weatherforecast-2.1.17.dist-info}/METADATA +3 -2
- {simple_dwd_weatherforecast-2.1.15.dist-info → simple_dwd_weatherforecast-2.1.17.dist-info}/RECORD +8 -8
- {simple_dwd_weatherforecast-2.1.15.dist-info → simple_dwd_weatherforecast-2.1.17.dist-info}/WHEEL +1 -1
- tests/test_get_daily_min.py +1 -1
- {simple_dwd_weatherforecast-2.1.15.dist-info → simple_dwd_weatherforecast-2.1.17.dist-info/licenses}/LICENCE +0 -0
- {simple_dwd_weatherforecast-2.1.15.dist-info → simple_dwd_weatherforecast-2.1.17.dist-info}/top_level.txt +0 -0
@@ -14,14 +14,22 @@ import arrow
|
|
14
14
|
import requests
|
15
15
|
from lxml import etree
|
16
16
|
|
17
|
-
with
|
18
|
-
|
19
|
-
|
17
|
+
with (
|
18
|
+
importlib.resources.files("simple_dwd_weatherforecast")
|
19
|
+
.joinpath( # type: ignore
|
20
|
+
"stations.json"
|
21
|
+
)
|
22
|
+
.open("r", encoding="utf-8") as file
|
23
|
+
):
|
20
24
|
stations = json.load(file)
|
21
25
|
|
22
|
-
with
|
23
|
-
|
24
|
-
|
26
|
+
with (
|
27
|
+
importlib.resources.files("simple_dwd_weatherforecast")
|
28
|
+
.joinpath( # type: ignore
|
29
|
+
"uv_stations.json"
|
30
|
+
)
|
31
|
+
.open("r", encoding="utf-8") as file
|
32
|
+
):
|
25
33
|
uv_stations = json.load(file)
|
26
34
|
|
27
35
|
|
@@ -483,12 +491,13 @@ class Weather:
|
|
483
491
|
value = None
|
484
492
|
for item in weather_data:
|
485
493
|
value_new = item[weatherDataType.value[0]]
|
486
|
-
if value_new:
|
487
|
-
if
|
494
|
+
if value_new is not None:
|
495
|
+
if value is None:
|
488
496
|
value = -9999999
|
489
497
|
if value_new > value:
|
490
498
|
value = value_new
|
491
|
-
|
499
|
+
|
500
|
+
if value is not None:
|
492
501
|
return round(value, 2)
|
493
502
|
return None
|
494
503
|
|
@@ -520,13 +529,13 @@ class Weather:
|
|
520
529
|
value = None
|
521
530
|
for item in weather_data:
|
522
531
|
value_new = item[weatherDataType.value[0]]
|
523
|
-
if value_new:
|
524
|
-
if
|
532
|
+
if value_new is not None:
|
533
|
+
if value is None:
|
525
534
|
value = 9999999
|
526
535
|
if value_new < value:
|
527
536
|
value = value_new
|
528
537
|
|
529
|
-
if value:
|
538
|
+
if value is not None:
|
530
539
|
return round(value, 2)
|
531
540
|
return None
|
532
541
|
|
@@ -558,7 +567,7 @@ class Weather:
|
|
558
567
|
value_sum = 0.0
|
559
568
|
for item in weather_data:
|
560
569
|
value = item[weatherDataType.value[0]]
|
561
|
-
if value:
|
570
|
+
if value is not None:
|
562
571
|
value_sum += float(value)
|
563
572
|
return round(value_sum, 2)
|
564
573
|
|
@@ -167,7 +167,9 @@ def get_map(
|
|
167
167
|
new_image_data = []
|
168
168
|
for item in image.getdata(): # type: ignore
|
169
169
|
if item[0] == 255 and item[1] == 255 and item[2] == 255:
|
170
|
-
new_image_data.append((
|
170
|
+
new_image_data.append((28, 28, 28))
|
171
|
+
elif item[0] == 85 and item[1] == 85 and item[2] == 85:
|
172
|
+
new_image_data.append((155, 155, 155))
|
171
173
|
else:
|
172
174
|
new_image_data.append(item)
|
173
175
|
|
@@ -287,7 +289,9 @@ class ImageLoop:
|
|
287
289
|
new_image_data = []
|
288
290
|
for item in image.getdata(): # type: ignore
|
289
291
|
if item[0] == 255 and item[1] == 255 and item[2] == 255:
|
290
|
-
new_image_data.append((
|
292
|
+
new_image_data.append((28, 28, 28))
|
293
|
+
elif item[0] == 85 and item[1] == 85 and item[2] == 85:
|
294
|
+
new_image_data.append((155, 155, 155))
|
291
295
|
else:
|
292
296
|
new_image_data.append(item)
|
293
297
|
|
{simple_dwd_weatherforecast-2.1.15.dist-info → simple_dwd_weatherforecast-2.1.17.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: simple_dwd_weatherforecast
|
3
|
-
Version: 2.1.
|
3
|
+
Version: 2.1.17
|
4
4
|
Summary: A simple tool to retrieve a weather forecast from DWD OpenData
|
5
5
|
Home-page: https://github.com/FL550/simple_dwd_weatherforecast.git
|
6
6
|
Author: Max Fermor
|
@@ -22,6 +22,7 @@ Dynamic: classifier
|
|
22
22
|
Dynamic: description
|
23
23
|
Dynamic: description-content-type
|
24
24
|
Dynamic: home-page
|
25
|
+
Dynamic: license-file
|
25
26
|
Dynamic: requires-dist
|
26
27
|
Dynamic: requires-python
|
27
28
|
Dynamic: summary
|
{simple_dwd_weatherforecast-2.1.15.dist-info → simple_dwd_weatherforecast-2.1.17.dist-info}/RECORD
RENAMED
@@ -1,8 +1,9 @@
|
|
1
1
|
simple_dwd_weatherforecast/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
simple_dwd_weatherforecast/dwdforecast.py,sha256=
|
3
|
-
simple_dwd_weatherforecast/dwdmap.py,sha256=
|
2
|
+
simple_dwd_weatherforecast/dwdforecast.py,sha256=uZRWMN9RIPvC9r47JAdw_AiP9V9M2rQxh_pOsVF15Sw,39094
|
3
|
+
simple_dwd_weatherforecast/dwdmap.py,sha256=H7W5_J91IbFbx9s8OZxvoNsJxc3mKITBZVU8EldMjjI,12720
|
4
4
|
simple_dwd_weatherforecast/stations.json,sha256=1u8qc2CT_rVy49SAlOicGixzHln6Y0FXevuFAz2maBw,838948
|
5
5
|
simple_dwd_weatherforecast/uv_stations.json,sha256=ADenYo-aR6qbf0UFkfYr72kkFzL9HyUKe4VQ23POGF8,2292
|
6
|
+
simple_dwd_weatherforecast-2.1.17.dist-info/licenses/LICENCE,sha256=27UG7gteqvSWuZlsbIq2_OAbh7VyifGGl-1zpuUoBcw,1072
|
6
7
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
8
|
tests/dummy_data.py,sha256=qapeQxjh8kURf5b-9h4gUdJaqQJQDVdqfMtS2g5JReY,103406
|
8
9
|
tests/dummy_data_full.py,sha256=3HRGAQBq4xPYs4jLzoLV_UAe1CXFzOsVBOouDL_5RHw,104062
|
@@ -10,7 +11,7 @@ tests/dummy_uv.py,sha256=TM1TwvNq_ea4WgIJyYsNAEXZJTx1dXH1ZVrW_LfLBLg,4548
|
|
10
11
|
tests/test_get_daily_avg.py,sha256=MNd7u9Y7_E6SIyxg59EKfdKx4QJ7R_WT5wvRgm7Gzks,2315
|
11
12
|
tests/test_get_daily_condition.py,sha256=9Qrhv14-vLnLz0N0FWG7Mv6_iEbNPqrHDDWWNQNydU0,2298
|
12
13
|
tests/test_get_daily_max.py,sha256=schjGJDflg1YEQSdfRndw2NT4AvrVheSDveyVZrFySM,2220
|
13
|
-
tests/test_get_daily_min.py,sha256=
|
14
|
+
tests/test_get_daily_min.py,sha256=3q-l6EpyIDwX7zzOZGJ9OFyD7ZM1JYMAhXfbil-yoJA,2223
|
14
15
|
tests/test_get_daily_sum.py,sha256=UEntbPwGSleHocu0587WnuC5ijptQtzVNreR1d6yoM0,2221
|
15
16
|
tests/test_get_day_values.py,sha256=hDphH7fekfcWX7slJUF1QiH3B7te23nHiS5-Fro3HY4,31013
|
16
17
|
tests/test_get_forecast_condition.py,sha256=YVapxXH5Svq5P7XvWn48n19hriQ1-7CSezuGc6DswJQ,2866
|
@@ -35,8 +36,7 @@ tests/test_update.py,sha256=AIzzHMxcjwQjeTB0l3YFgB7HkGDbuqiHofwy41mS0m4,7440
|
|
35
36
|
tests/test_update_hourly.py,sha256=7Zl8ml3FTdqw3_Qwr_Tz-sWTzypvrBWmxeig2Vwp_ZQ,1781
|
36
37
|
tests/test_uv_index.py,sha256=tr6wnOyHlXT1S3yp1oeHc4-Brmc-EMEdM4mtyrdpcHg,579
|
37
38
|
tests/test_weather.py,sha256=ZyX4ldUoJpJp7YpiNQwU6Od-nYRay-3qcaDJdNq8fhY,780
|
38
|
-
simple_dwd_weatherforecast-2.1.
|
39
|
-
simple_dwd_weatherforecast-2.1.
|
40
|
-
simple_dwd_weatherforecast-2.1.
|
41
|
-
simple_dwd_weatherforecast-2.1.
|
42
|
-
simple_dwd_weatherforecast-2.1.15.dist-info/RECORD,,
|
39
|
+
simple_dwd_weatherforecast-2.1.17.dist-info/METADATA,sha256=aMMWbvdYlkKr0QNj5gsD_mRNufHZrjXOizxF20TtiHU,12850
|
40
|
+
simple_dwd_weatherforecast-2.1.17.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
41
|
+
simple_dwd_weatherforecast-2.1.17.dist-info/top_level.txt,sha256=iyEobUh14Tzitx39Oi8qm0NhBrnZovl_dNKtvLUkLEM,33
|
42
|
+
simple_dwd_weatherforecast-2.1.17.dist-info/RECORD,,
|
tests/test_get_daily_min.py
CHANGED
@@ -34,7 +34,7 @@ class Weather_get_daily_min(unittest.TestCase):
|
|
34
34
|
test_time = datetime(2020, 11, 6, 10, 0)
|
35
35
|
self.assertEqual(
|
36
36
|
self.dwd_weather.get_daily_min(WeatherDataType.PRECIPITATION, test_time),
|
37
|
-
0.
|
37
|
+
0.0,
|
38
38
|
)
|
39
39
|
|
40
40
|
@patch("simple_dwd_weatherforecast.dwdforecast.Weather.update", return_value=None)
|
File without changes
|
File without changes
|