meteostat 1.7.1__py3-none-any.whl → 1.7.3__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/utilities/mutations.py +15 -1
- {meteostat-1.7.1.dist-info → meteostat-1.7.3.dist-info}/METADATA +1 -1
- {meteostat-1.7.1.dist-info → meteostat-1.7.3.dist-info}/RECORD +7 -7
- {meteostat-1.7.1.dist-info → meteostat-1.7.3.dist-info}/LICENSE +0 -0
- {meteostat-1.7.1.dist-info → meteostat-1.7.3.dist-info}/WHEEL +0 -0
- {meteostat-1.7.1.dist-info → meteostat-1.7.3.dist-info}/top_level.txt +0 -0
meteostat/__init__.py
CHANGED
meteostat/utilities/mutations.py
CHANGED
|
@@ -34,6 +34,10 @@ def filter_time(
|
|
|
34
34
|
# Get time index
|
|
35
35
|
time = df.index.get_level_values("time")
|
|
36
36
|
|
|
37
|
+
# If no time index, return original DataFrame
|
|
38
|
+
if len(time) == 0:
|
|
39
|
+
return df
|
|
40
|
+
|
|
37
41
|
# Filter & return
|
|
38
42
|
return df.loc[(time >= start) & (time <= end)] if start and end else df
|
|
39
43
|
|
|
@@ -63,7 +67,17 @@ def calculate_dwpt(df: pd.DataFrame, col: str) -> pd.DataFrame:
|
|
|
63
67
|
"""
|
|
64
68
|
Calculate dew point temperature
|
|
65
69
|
"""
|
|
66
|
-
|
|
70
|
+
magnus_const_a = 17.27
|
|
71
|
+
magnus_const_b = 237.7 # degrees Celsius
|
|
72
|
+
|
|
73
|
+
temperature = df["temp"]
|
|
74
|
+
relative_humidity = df["rhum"]
|
|
75
|
+
|
|
76
|
+
alpha = (
|
|
77
|
+
(magnus_const_a * temperature) / (magnus_const_b + temperature)
|
|
78
|
+
) + np.log(relative_humidity / 100.0)
|
|
79
|
+
df[col] = (magnus_const_b * alpha) / (magnus_const_a - alpha)
|
|
80
|
+
|
|
67
81
|
df[f"{col}_flag"] = df[["temp_flag", "rhum_flag"]].max(axis=1, skipna=True)
|
|
68
82
|
|
|
69
83
|
return df
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
meteostat/__init__.py,sha256=
|
|
1
|
+
meteostat/__init__.py,sha256=2riJrhXJsRvCvqnpqPtK1qLJlA72GNfpqPQX4JREZEQ,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
|
|
@@ -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=
|
|
33
|
+
meteostat/utilities/mutations.py,sha256=XfFPy4RmnRQmkkIBKgpwHAf-kZwqbkBfFLPyUtpxOiU,2124
|
|
34
34
|
meteostat/utilities/validations.py,sha256=MlKY1gkeqmovFr4lR_iM6Bk7yuGdSgy0NGceiqYI7Vs,646
|
|
35
|
-
meteostat-1.7.
|
|
36
|
-
meteostat-1.7.
|
|
37
|
-
meteostat-1.7.
|
|
38
|
-
meteostat-1.7.
|
|
39
|
-
meteostat-1.7.
|
|
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,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|