simple-dwd-weatherforecast 2.1.15__tar.gz → 2.1.17__tar.gz

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.
Files changed (47) hide show
  1. {simple_dwd_weatherforecast-2.1.15/simple_dwd_weatherforecast.egg-info → simple_dwd_weatherforecast-2.1.17}/PKG-INFO +3 -2
  2. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/setup.py +1 -1
  3. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast/dwdforecast.py +22 -13
  4. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast/dwdmap.py +6 -2
  5. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17/simple_dwd_weatherforecast.egg-info}/PKG-INFO +3 -2
  6. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_daily_min.py +1 -1
  7. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/LICENCE +0 -0
  8. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/README.md +0 -0
  9. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/setup.cfg +0 -0
  10. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast/__init__.py +0 -0
  11. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast/stations.json +0 -0
  12. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast/uv_stations.json +0 -0
  13. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast.egg-info/SOURCES.txt +0 -0
  14. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast.egg-info/dependency_links.txt +0 -0
  15. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast.egg-info/requires.txt +0 -0
  16. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/simple_dwd_weatherforecast.egg-info/top_level.txt +0 -0
  17. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/__init__.py +0 -0
  18. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/dummy_data.py +0 -0
  19. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/dummy_data_full.py +0 -0
  20. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/dummy_uv.py +0 -0
  21. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_daily_avg.py +0 -0
  22. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_daily_condition.py +0 -0
  23. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_daily_max.py +0 -0
  24. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_daily_sum.py +0 -0
  25. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_day_values.py +0 -0
  26. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_forecast_condition.py +0 -0
  27. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_forecast_data.py +0 -0
  28. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_station_name.py +0 -0
  29. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_timeframe_avg.py +0 -0
  30. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_timeframe_condition.py +0 -0
  31. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_timeframe_max.py +0 -0
  32. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_timeframe_min.py +0 -0
  33. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_timeframe_sum.py +0 -0
  34. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_get_timeframe_values.py +0 -0
  35. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_is_in_timerange.py +0 -0
  36. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_is_valid_timeframe.py +0 -0
  37. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_location_tools.py +0 -0
  38. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_map.py +0 -0
  39. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_parsekml.py +0 -0
  40. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_region.py +0 -0
  41. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_reported_weather.py +0 -0
  42. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_station.py +0 -0
  43. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_stationsfile.py +0 -0
  44. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_update.py +0 -0
  45. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_update_hourly.py +0 -0
  46. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_uv_index.py +0 -0
  47. {simple_dwd_weatherforecast-2.1.15 → simple_dwd_weatherforecast-2.1.17}/tests/test_weather.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: simple_dwd_weatherforecast
3
- Version: 2.1.15
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
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="simple_dwd_weatherforecast",
8
- version="v2.1.15",
8
+ version="v2.1.17",
9
9
  author="Max Fermor",
10
10
  description="A simple tool to retrieve a weather forecast from DWD OpenData",
11
11
  long_description=long_description,
@@ -14,14 +14,22 @@ import arrow
14
14
  import requests
15
15
  from lxml import etree
16
16
 
17
- with importlib.resources.files("simple_dwd_weatherforecast").joinpath( # type: ignore
18
- "stations.json"
19
- ).open("r", encoding="utf-8") as file:
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 importlib.resources.files("simple_dwd_weatherforecast").joinpath( # type: ignore
23
- "uv_stations.json"
24
- ).open("r", encoding="utf-8") as file:
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 not value:
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
- if value:
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 not value:
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((0, 0, 0))
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((0, 0, 0))
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
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: simple_dwd_weatherforecast
3
- Version: 2.1.15
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
@@ -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.01,
37
+ 0.0,
38
38
  )
39
39
 
40
40
  @patch("simple_dwd_weatherforecast.dwdforecast.Weather.update", return_value=None)