meteostat 1.6.7__py3-none-any.whl → 1.6.8__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 +1 -1
- meteostat/interface/normals.py +2 -2
- meteostat/interface/timeseries.py +2 -2
- meteostat/series/normalize.py +4 -4
- meteostat/units.py +3 -3
- meteostat/utilities/aggregations.py +2 -2
- meteostat/utilities/mutations.py +1 -1
- {meteostat-1.6.7.dist-info → meteostat-1.6.8.dist-info}/METADATA +1 -1
- {meteostat-1.6.7.dist-info → meteostat-1.6.8.dist-info}/RECORD +12 -12
- {meteostat-1.6.7.dist-info → meteostat-1.6.8.dist-info}/WHEEL +1 -1
- {meteostat-1.6.7.dist-info → meteostat-1.6.8.dist-info}/LICENSE +0 -0
- {meteostat-1.6.7.dist-info → meteostat-1.6.8.dist-info}/top_level.txt +0 -0
meteostat/__init__.py
CHANGED
meteostat/interface/normals.py
CHANGED
|
@@ -123,7 +123,7 @@ class TimeSeries(MeteoData):
|
|
|
123
123
|
(pd.isna(self._data[f"{col_name}_flag"]))
|
|
124
124
|
| (self._data[f"{col_name}_flag"].str.contains(self._model_flag)),
|
|
125
125
|
col_name,
|
|
126
|
-
] = np.
|
|
126
|
+
] = np.nan
|
|
127
127
|
|
|
128
128
|
# Conditionally, remove flags from DataFrame
|
|
129
129
|
if not self._flags:
|
|
@@ -131,7 +131,7 @@ class TimeSeries(MeteoData):
|
|
|
131
131
|
map(lambda col_name: f"{col_name}_flag", columns), axis=1, inplace=True
|
|
132
132
|
)
|
|
133
133
|
|
|
134
|
-
# Drop
|
|
134
|
+
# Drop nan-only rows
|
|
135
135
|
self._data.dropna(how="all", subset=columns, inplace=True)
|
|
136
136
|
|
|
137
137
|
def _init_time_series(
|
meteostat/series/normalize.py
CHANGED
|
@@ -9,7 +9,7 @@ The code is licensed under the MIT license.
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
from copy import copy
|
|
12
|
-
from numpy import
|
|
12
|
+
from numpy import nan
|
|
13
13
|
import pandas as pd
|
|
14
14
|
import pytz
|
|
15
15
|
from meteostat.core.warn import warn
|
|
@@ -56,7 +56,7 @@ def normalize(self):
|
|
|
56
56
|
# Add columns
|
|
57
57
|
for column in temp._columns[temp._first_met_col :]:
|
|
58
58
|
# Add column to DataFrame
|
|
59
|
-
df[column] =
|
|
59
|
+
df[column] = nan
|
|
60
60
|
|
|
61
61
|
result = pd.concat([result, df], axis=0)
|
|
62
62
|
|
|
@@ -70,8 +70,8 @@ def normalize(self):
|
|
|
70
70
|
.first()
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
-
# None ->
|
|
74
|
-
temp._data = temp._data.fillna(
|
|
73
|
+
# None -> nan
|
|
74
|
+
temp._data = temp._data.fillna(nan)
|
|
75
75
|
|
|
76
76
|
# Return class instance
|
|
77
77
|
return temp
|
meteostat/units.py
CHANGED
|
@@ -6,7 +6,7 @@ Convert a Pandas Series to any meteorological data unit
|
|
|
6
6
|
The code is licensed under the MIT license.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from numpy import
|
|
9
|
+
from numpy import nan, isnan
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def fahrenheit(value):
|
|
@@ -62,7 +62,7 @@ def direction(value):
|
|
|
62
62
|
Convert degrees to wind direction
|
|
63
63
|
"""
|
|
64
64
|
|
|
65
|
-
wdir =
|
|
65
|
+
wdir = nan
|
|
66
66
|
|
|
67
67
|
if (337 <= value <= 360) or value <= 23:
|
|
68
68
|
wdir = "N"
|
|
@@ -90,7 +90,7 @@ def condition(value):
|
|
|
90
90
|
"""
|
|
91
91
|
|
|
92
92
|
if isnan(value) or value < 1 or value > 27:
|
|
93
|
-
return
|
|
93
|
+
return nan
|
|
94
94
|
|
|
95
95
|
return [
|
|
96
96
|
"Clear",
|
|
@@ -19,7 +19,7 @@ def weighted_average(step: pd.DataFrame) -> pd.DataFrame:
|
|
|
19
19
|
|
|
20
20
|
data = np.ma.masked_array(step, np.isnan(step))
|
|
21
21
|
data = np.ma.average(data, axis=0, weights=data[:, -2])
|
|
22
|
-
data = data.filled(np.
|
|
22
|
+
data = data.filled(np.nan)
|
|
23
23
|
|
|
24
24
|
return pd.DataFrame(data=[data], columns=step.columns)
|
|
25
25
|
|
|
@@ -30,7 +30,7 @@ def degree_mean(data: pd.Series) -> float:
|
|
|
30
30
|
"""
|
|
31
31
|
|
|
32
32
|
if data.isnull().all():
|
|
33
|
-
return np.
|
|
33
|
+
return np.nan
|
|
34
34
|
|
|
35
35
|
rads = np.deg2rad(data)
|
|
36
36
|
sums = np.arctan2(np.sum(np.sin(rads)), np.sum(np.cos(rads)))
|
meteostat/utilities/mutations.py
CHANGED
|
@@ -52,7 +52,7 @@ def adjust_temp(df: pd.DataFrame, alt: int):
|
|
|
52
52
|
# Adjust values for all temperature-like data
|
|
53
53
|
for col_name in temp_like:
|
|
54
54
|
if col_name in df.columns:
|
|
55
|
-
df.loc[df[col_name] != np.
|
|
55
|
+
df.loc[df[col_name] != np.nan, col_name] = df[col_name] + (
|
|
56
56
|
temp_diff * ((df["elevation"] - alt) / 100)
|
|
57
57
|
)
|
|
58
58
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
meteostat/__init__.py,sha256=
|
|
2
|
-
meteostat/units.py,sha256=
|
|
1
|
+
meteostat/__init__.py,sha256=i7FBljbAnuPixVcLK75nyRF8A8Ki8GpUURWzeniURx4,858
|
|
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=ZCBijVA-Zk2FSizLTnkV5hzcL8ecGhOpKURQsWpY0Es,1766
|
|
5
5
|
meteostat/core/loader.py,sha256=VVIzfYDhvD4JvNpUkEuB_IvQ6-fWddokLP4Qp1DEveQ,2496
|
|
@@ -13,10 +13,10 @@ meteostat/interface/hourly.py,sha256=EpPOdld6FJ_OkHd6opiBiO70cPs_mP8oST_Q3Zl36Vo
|
|
|
13
13
|
meteostat/interface/interpolate.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
meteostat/interface/meteodata.py,sha256=Ec0MTgfAB6E5cohvrcDZoFwelTj3V4nc0MlQPjSo4uY,7066
|
|
15
15
|
meteostat/interface/monthly.py,sha256=1P6IdnJ_sooc_-4pfkOPCeMjupd-8UMH4xB1KfMW0RE,2416
|
|
16
|
-
meteostat/interface/normals.py,sha256=
|
|
16
|
+
meteostat/interface/normals.py,sha256=UVl24IGakuu7Sk-d3DBOtXme4HrMm7aJeJQQzaLlzwM,5518
|
|
17
17
|
meteostat/interface/point.py,sha256=N755kWXIeLpaNvG4H7Khv0YmDKA86rviybe2C1UK_QA,3804
|
|
18
18
|
meteostat/interface/stations.py,sha256=xwrtaLFvXWNwDfTGLLIbu4EjCkE54wS4TZZS8K8RdTU,6626
|
|
19
|
-
meteostat/interface/timeseries.py,sha256=
|
|
19
|
+
meteostat/interface/timeseries.py,sha256=3Cys1UJUJvsSwIHK0l-ajYGeUq4SS3H6eUu5unSoeJ4,6381
|
|
20
20
|
meteostat/series/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
meteostat/series/aggregate.py,sha256=xyDwTjFxuX7NRNcaCc31VnYChZ2xP7DnyHDYsvn8nCI,1201
|
|
22
22
|
meteostat/series/convert.py,sha256=BjVmyDQ_G5ccgOD4vk_2hnX6ShDt6vHEzrWXRnjsUKQ,631
|
|
@@ -24,16 +24,16 @@ meteostat/series/count.py,sha256=kV0Oztmy1K0E3Z1h8Na9twxUhujRepRMtGzM_CNInJc,358
|
|
|
24
24
|
meteostat/series/coverage.py,sha256=76PlEoVPM_-4Oys-6THggV-7gESbPM6Cx0m1n0-1YcM,534
|
|
25
25
|
meteostat/series/fetch.py,sha256=MIrkhhtAucThO06Bcc92c6rrc3v5G31VBI0TkQd0oZ0,620
|
|
26
26
|
meteostat/series/interpolate.py,sha256=EhoOmmAAiv8FcBIZ83hLr1Vu0iJd8BfhYGS4p1b5FOo,925
|
|
27
|
-
meteostat/series/normalize.py,sha256=
|
|
27
|
+
meteostat/series/normalize.py,sha256=RZsfFYosKXLI2eTBzrkoSiiSTxqHTbGJOYZo2tBiorc,2155
|
|
28
28
|
meteostat/series/stations.py,sha256=pHDQR1t7Z7jN5Vaj8wdNnSsZI8s6SiH5bNeTbys3TjA,447
|
|
29
29
|
meteostat/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
-
meteostat/utilities/aggregations.py,sha256
|
|
30
|
+
meteostat/utilities/aggregations.py,sha256=-t4ZBNM8cnwnuiR7Bzt7OlUQxNJMZkqS3E4AIMrJg3M,915
|
|
31
31
|
meteostat/utilities/endpoint.py,sha256=tH2he-lGEBLRDkoLzktQ37aV3QTcmUM69oeHGUUJo0w,785
|
|
32
32
|
meteostat/utilities/helpers.py,sha256=PFMYQIhXv29Boe_uZpelOZKzK4SzKgWXJbnzacfZreU,787
|
|
33
|
-
meteostat/utilities/mutations.py,sha256=
|
|
33
|
+
meteostat/utilities/mutations.py,sha256=wjFQE2JdZ22WwVD-7vKT6aculZ9Z8vAWi9ypz1B9X88,1485
|
|
34
34
|
meteostat/utilities/validations.py,sha256=MlKY1gkeqmovFr4lR_iM6Bk7yuGdSgy0NGceiqYI7Vs,646
|
|
35
|
-
meteostat-1.6.
|
|
36
|
-
meteostat-1.6.
|
|
37
|
-
meteostat-1.6.
|
|
38
|
-
meteostat-1.6.
|
|
39
|
-
meteostat-1.6.
|
|
35
|
+
meteostat-1.6.8.dist-info/LICENSE,sha256=kqpl7FVzWOCe11BZqJBZ1aRQi-aK87j3ljtG7P3VxLc,1066
|
|
36
|
+
meteostat-1.6.8.dist-info/METADATA,sha256=BGX8P_0l4prmUgAPYYxQ57jtUAHCUNP7Z_Yxovr2FZU,4643
|
|
37
|
+
meteostat-1.6.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
38
|
+
meteostat-1.6.8.dist-info/top_level.txt,sha256=s8LP1xi5iF2zhVv5ULkHwW-tPeMrljxnA8VqZibQqro,10
|
|
39
|
+
meteostat-1.6.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|