meteostat 1.7.4__tar.gz → 1.7.6__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 (44) hide show
  1. {meteostat-1.7.4 → meteostat-1.7.6}/PKG-INFO +1 -1
  2. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/__init__.py +1 -1
  3. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/meteodata.py +1 -1
  4. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/normals.py +6 -1
  5. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/timeseries.py +3 -2
  6. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/utilities/mutations.py +4 -0
  7. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat.egg-info/PKG-INFO +1 -1
  8. {meteostat-1.7.4 → meteostat-1.7.6}/setup.py +1 -1
  9. {meteostat-1.7.4 → meteostat-1.7.6}/LICENSE +0 -0
  10. {meteostat-1.7.4 → meteostat-1.7.6}/README.md +0 -0
  11. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/core/__init__.py +0 -0
  12. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/core/cache.py +0 -0
  13. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/core/loader.py +0 -0
  14. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/core/warn.py +0 -0
  15. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/enumerations/__init__.py +0 -0
  16. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/enumerations/granularity.py +0 -0
  17. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/__init__.py +0 -0
  18. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/base.py +0 -0
  19. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/daily.py +0 -0
  20. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/hourly.py +0 -0
  21. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/interpolate.py +0 -0
  22. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/monthly.py +0 -0
  23. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/point.py +0 -0
  24. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/interface/stations.py +0 -0
  25. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/__init__.py +0 -0
  26. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/aggregate.py +0 -0
  27. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/convert.py +0 -0
  28. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/count.py +0 -0
  29. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/coverage.py +0 -0
  30. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/fetch.py +0 -0
  31. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/interpolate.py +0 -0
  32. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/normalize.py +0 -0
  33. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/series/stations.py +0 -0
  34. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/units.py +0 -0
  35. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/utilities/__init__.py +0 -0
  36. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/utilities/aggregations.py +0 -0
  37. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/utilities/endpoint.py +0 -0
  38. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/utilities/helpers.py +0 -0
  39. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat/utilities/validations.py +0 -0
  40. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat.egg-info/SOURCES.txt +0 -0
  41. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat.egg-info/dependency_links.txt +0 -0
  42. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat.egg-info/requires.txt +0 -0
  43. {meteostat-1.7.4 → meteostat-1.7.6}/meteostat.egg-info/top_level.txt +0 -0
  44. {meteostat-1.7.4 → meteostat-1.7.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: meteostat
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: Access and analyze historical weather and climate data with Python.
5
5
  Home-page: https://github.com/meteostat/meteostat-python
6
6
  Author: Meteostat
@@ -12,7 +12,7 @@ The code is licensed under the MIT license.
12
12
  """
13
13
 
14
14
  __appname__ = "meteostat"
15
- __version__ = "1.7.4"
15
+ __version__ = "1.7.6"
16
16
 
17
17
  from .interface.base import Base
18
18
  from .interface.timeseries import TimeSeries
@@ -118,7 +118,7 @@ class MeteoData(Base):
118
118
  )
119
119
 
120
120
  # Empty DataFrame
121
- return pd.DataFrame(columns=[*self._types])
121
+ return pd.DataFrame(columns=self._processed_columns)
122
122
 
123
123
  # pylint: disable=too-many-branches
124
124
  def _resolve_point(
@@ -219,7 +219,12 @@ class Normals(MeteoData):
219
219
 
220
220
  # Add avg. temperature column
221
221
  temp.insert(
222
- 0, "tavg", temp[["tmin", "tmax"]].dropna(how="any").mean(axis=1).round(1)
222
+ 0,
223
+ "tavg",
224
+ pd.to_numeric(
225
+ temp[["tmin", "tmax"]].dropna(how="any").mean(axis=1),
226
+ errors="coerce"
227
+ ).round(1)
223
228
  )
224
229
 
225
230
  # Remove station index if it's a single station
@@ -194,8 +194,9 @@ class TimeSeries(MeteoData):
194
194
  if col not in self._data.columns:
195
195
  self._data[col] = pd.NA
196
196
  self._data[col] = self._data[col].astype("Float64")
197
- self._data[f"{col}_flag"] = pd.NA
198
- self._data[f"{col}_flag"] = self._data[f"{col}_flag"].astype("string")
197
+ if (flagcol := f"{col}_flag") not in self._data.columns:
198
+ self._data[flagcol] = pd.NA
199
+ self._data[flagcol] = self._data[flagcol].astype("string")
199
200
 
200
201
  # Reorder the DataFrame
201
202
  self._data = self._data[
@@ -67,6 +67,10 @@ def calculate_dwpt(df: pd.DataFrame, col: str) -> pd.DataFrame:
67
67
  """
68
68
  Calculate dew point temperature
69
69
  """
70
+ # Check if required columns exist
71
+ if "temp" not in df.columns or "rhum" not in df.columns:
72
+ return df
73
+
70
74
  magnus_const_a = 17.27
71
75
  magnus_const_b = 237.7 # degrees Celsius
72
76
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: meteostat
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: Access and analyze historical weather and climate data with Python.
5
5
  Home-page: https://github.com/meteostat/meteostat-python
6
6
  Author: Meteostat
@@ -15,7 +15,7 @@ with open(path.join(here, "README.md")) as f:
15
15
  # Setup
16
16
  setup(
17
17
  name="meteostat",
18
- version="1.7.4",
18
+ version="1.7.6",
19
19
  author="Meteostat",
20
20
  author_email="info@meteostat.net",
21
21
  description="Access and analyze historical weather and climate data with Python.",
File without changes
File without changes
File without changes
File without changes