Skip to content

Commit

Permalink
Meteostat 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
clampr committed Jun 30, 2021
1 parent bc9fc0d commit d7bdc60
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 10 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.2'
__version__ = '1.5.3'

from .interface.base import Base
from .interface.timeseries import Timeseries
Expand Down
3 changes: 3 additions & 0 deletions meteostat/interface/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Base:
cache_dir: str = os.path.expanduser(
'~') + os.sep + '.meteostat' + os.sep + 'cache'

# Auto clean cache directories?
autoclean: bool = True

# Maximum age of a cached file in seconds
max_age: int = 24 * 60 * 60

Expand Down
2 changes: 1 addition & 1 deletion meteostat/interface/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def __init__(
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)

# Clear cache
if self.max_age > 0:
if self.max_age > 0 and self.autoclean:
self.clear_cache()

def expected_rows(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion meteostat/interface/hourly.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def __init__(
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)

# Clear cache
if self.max_age > 0:
if self.max_age > 0 and self.autoclean:
self.clear_cache()

def expected_rows(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion meteostat/interface/monthly.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def __init__(
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)

# Clear cache
if self.max_age > 0:
if self.max_age > 0 and self.autoclean:
self.clear_cache()

def expected_rows(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion meteostat/interface/normals.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def __init__(
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)

# Clear cache
if self.max_age > 0:
if self.max_age > 0 and self.autoclean:
self.clear_cache()

def normalize(self):
Expand Down
4 changes: 0 additions & 4 deletions meteostat/interface/stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ def __init__(self) -> None:
# Get all weather stations
self._load()

# Clear cache
if self.max_age > 0:
self.clear_cache()

def nearby(
self,
lat: float,
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.2',
version='1.5.3',
author='Meteostat',
author_email='[email protected]',
description='Access and analyze historical weather and climate data with Python.',
Expand Down

0 comments on commit d7bdc60

Please sign in to comment.