meteostat 1.7.3__py3-none-any.whl → 1.7.5__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.
meteostat/__init__.py CHANGED
@@ -12,7 +12,7 @@ The code is licensed under the MIT license.
12
12
  """
13
13
 
14
14
  __appname__ = "meteostat"
15
- __version__ = "1.7.3"
15
+ __version__ = "1.7.5"
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[
@@ -78,6 +78,8 @@ def calculate_dwpt(df: pd.DataFrame, col: str) -> pd.DataFrame:
78
78
  ) + np.log(relative_humidity / 100.0)
79
79
  df[col] = (magnus_const_b * alpha) / (magnus_const_a - alpha)
80
80
 
81
+ df[col] = df[col].round(1)
82
+
81
83
  df[f"{col}_flag"] = df[["temp_flag", "rhum_flag"]].max(axis=1, skipna=True)
82
84
 
83
85
  return df
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: meteostat
3
- Version: 1.7.3
3
+ Version: 1.7.5
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
@@ -1,4 +1,4 @@
1
- meteostat/__init__.py,sha256=2riJrhXJsRvCvqnpqPtK1qLJlA72GNfpqPQX4JREZEQ,989
1
+ meteostat/__init__.py,sha256=RosolnVQfb4coBj6YdhTjsuE4MFX1TFfCPkRda92CDM,989
2
2
  meteostat/units.py,sha256=G0vh2tYsp0ESGUpg3ZAE0U-b9Ih_oMtPNDZ71Bbq3iE,2566
3
3
  meteostat/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  meteostat/core/cache.py,sha256=MEC6Hcf2rwg3__zv_Y1nSk16mfdTsrLH9CTraMX7NYw,1764
@@ -11,12 +11,12 @@ meteostat/interface/base.py,sha256=8ksGkdgyRDw2AA5ZwuES9XuBjseBPoNBBQiNspVp2JA,9
11
11
  meteostat/interface/daily.py,sha256=Rx-_U_t2iX-4wtBdieihioeo99mKEplrZaM23YRkwnM,2949
12
12
  meteostat/interface/hourly.py,sha256=nP4hIjxYbcZk0ua6m6fclAXfuhrxzB3jHPyiz3dLNs4,3965
13
13
  meteostat/interface/interpolate.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- meteostat/interface/meteodata.py,sha256=fAIwW7rdAAX6WDl9pUq8p-xOR-GoNtsYdNlTJI0Xl0E,6511
14
+ meteostat/interface/meteodata.py,sha256=Om7570m0LQ0BYyuEirr7zzFZ4r1f28rL1CTk9k_PPTs,6520
15
15
  meteostat/interface/monthly.py,sha256=LbeXgodQcVX0h987bv2lEJvewIcQkgt5Co_dyJ14F_A,2577
16
- meteostat/interface/normals.py,sha256=d6H5IDWdAfIYZpuWNsqsiL4Kgc6PDLe4zkTUgaYjD8g,7006
16
+ meteostat/interface/normals.py,sha256=xBUBCjle8awhHgDWi6FOTfIMN4MdOrYFXuoLceCQVxE,7108
17
17
  meteostat/interface/point.py,sha256=lnKyvaclcsOXaErpPpaH0_3T1j2X7kgCKlIhk4s-EGQ,3801
18
18
  meteostat/interface/stations.py,sha256=hC2DmtE24u--lb3jbkFVMkFDKCR-LP5h8uXSOIb4_hg,6683
19
- meteostat/interface/timeseries.py,sha256=tE1ShXADPNnhirL5puZb2KyDq18cWU1HX8XU6J8qp4U,7909
19
+ meteostat/interface/timeseries.py,sha256=Dm8s59X3S9GcSOZ1mSrUv_xxjVOU6XJr06hQjbo73z8,7960
20
20
  meteostat/series/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  meteostat/series/aggregate.py,sha256=dhYx1c2OzOgEcdUNCrmT4zdYY1UuT4PhkWYRirmx7v0,1200
22
22
  meteostat/series/convert.py,sha256=Uu76hw-M1QzwYuliA2hp0Dl9f1YyNaLE3AQTyaask60,641
@@ -30,10 +30,10 @@ meteostat/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
30
30
  meteostat/utilities/aggregations.py,sha256=-t4ZBNM8cnwnuiR7Bzt7OlUQxNJMZkqS3E4AIMrJg3M,915
31
31
  meteostat/utilities/endpoint.py,sha256=ndHSMGi5LhB1yrjA3f6pDbe-0glnnDAX7IInp0Gscik,806
32
32
  meteostat/utilities/helpers.py,sha256=wt11OXHzIDw3DY98XGIfcrh1bPCC9dClVnNdGtqvz4U,1691
33
- meteostat/utilities/mutations.py,sha256=XfFPy4RmnRQmkkIBKgpwHAf-kZwqbkBfFLPyUtpxOiU,2124
33
+ meteostat/utilities/mutations.py,sha256=MG7UKPOjr5-nA5ZnUPaFItVviP2G5yg_67mL91hpie8,2156
34
34
  meteostat/utilities/validations.py,sha256=MlKY1gkeqmovFr4lR_iM6Bk7yuGdSgy0NGceiqYI7Vs,646
35
- meteostat-1.7.3.dist-info/LICENSE,sha256=kqpl7FVzWOCe11BZqJBZ1aRQi-aK87j3ljtG7P3VxLc,1066
36
- meteostat-1.7.3.dist-info/METADATA,sha256=LBsyobsVv_sB23IwKzK2EvNZknY-bv7E_fi339Hzez4,4633
37
- meteostat-1.7.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
38
- meteostat-1.7.3.dist-info/top_level.txt,sha256=s8LP1xi5iF2zhVv5ULkHwW-tPeMrljxnA8VqZibQqro,10
39
- meteostat-1.7.3.dist-info/RECORD,,
35
+ meteostat-1.7.5.dist-info/LICENSE,sha256=kqpl7FVzWOCe11BZqJBZ1aRQi-aK87j3ljtG7P3VxLc,1066
36
+ meteostat-1.7.5.dist-info/METADATA,sha256=YZLsrukI8WmvjrY3SLA2uSicMgsHANg_7DYk3RrST1M,4633
37
+ meteostat-1.7.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
38
+ meteostat-1.7.5.dist-info/top_level.txt,sha256=s8LP1xi5iF2zhVv5ULkHwW-tPeMrljxnA8VqZibQqro,10
39
+ meteostat-1.7.5.dist-info/RECORD,,