Skip to content

Commit

Permalink
Meteostat 1.5.9 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
clampr committed Aug 26, 2021
1 parent 40a80ad commit 6b2baf7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion meteostat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""

__appname__ = 'meteostat'
__version__ = '1.5.8'
__version__ = '1.5.9'

from .interface.base import Base
from .interface.timeseries import Timeseries
Expand Down
5 changes: 4 additions & 1 deletion meteostat/core/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def processing_handler(
for dataset in datasets:
output.append(load(*dataset))

return pd.concat(output)
# Remove empty DataFrames
filtered = list(filter(lambda df: df.index.size > 0, output))

return pd.concat(filtered) if len(filtered) > 0 else output[0]


def load_handler(
Expand Down
7 changes: 6 additions & 1 deletion meteostat/interface/normals.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,12 @@ def normalize(self):
['station', 'start', 'end', 'month'], inplace=True)
# Merge data
temp._data = pd.concat([temp._data, df], axis=0).groupby(
['station', 'start', 'end', 'month'], as_index=True).first()
[
'station',
'start',
'end',
'month'
], as_index=True).first() if temp._data.index.size > 0 else df

# None -> NaN
temp._data = temp._data.fillna(np.NaN)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Setup
setup(
name='meteostat',
version='1.5.8',
version='1.5.9',
author='Meteostat',
author_email='[email protected]',
description='Access and analyze historical weather and climate data with Python.',
Expand Down

0 comments on commit 6b2baf7

Please sign in to comment.