Skip to content

Commit d7bdc60

Browse files
committed
Meteostat 1.5.3
1 parent bc9fc0d commit d7bdc60

File tree

8 files changed

+9
-10
lines changed

8 files changed

+9
-10
lines changed

meteostat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313

1414
__appname__ = 'meteostat'
15-
__version__ = '1.5.2'
15+
__version__ = '1.5.3'
1616

1717
from .interface.base import Base
1818
from .interface.timeseries import Timeseries

meteostat/interface/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class Base:
2424
cache_dir: str = os.path.expanduser(
2525
'~') + os.sep + '.meteostat' + os.sep + 'cache'
2626

27+
# Auto clean cache directories?
28+
autoclean: bool = True
29+
2730
# Maximum age of a cached file in seconds
2831
max_age: int = 24 * 60 * 60
2932

meteostat/interface/daily.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def __init__(
276276
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)
277277

278278
# Clear cache
279-
if self.max_age > 0:
279+
if self.max_age > 0 and self.autoclean:
280280
self.clear_cache()
281281

282282
def expected_rows(self) -> int:

meteostat/interface/hourly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def __init__(
340340
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)
341341

342342
# Clear cache
343-
if self.max_age > 0:
343+
if self.max_age > 0 and self.autoclean:
344344
self.clear_cache()
345345

346346
def expected_rows(self) -> int:

meteostat/interface/monthly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def __init__(
277277
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)
278278

279279
# Clear cache
280-
if self.max_age > 0:
280+
if self.max_age > 0 and self.autoclean:
281281
self.clear_cache()
282282

283283
def expected_rows(self) -> int:

meteostat/interface/normals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def __init__(
246246
self._resolve_point(loc.method, stations, loc.alt, loc.adapt_temp)
247247

248248
# Clear cache
249-
if self.max_age > 0:
249+
if self.max_age > 0 and self.autoclean:
250250
self.clear_cache()
251251

252252
def normalize(self):

meteostat/interface/stations.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ def __init__(self) -> None:
110110
# Get all weather stations
111111
self._load()
112112

113-
# Clear cache
114-
if self.max_age > 0:
115-
self.clear_cache()
116-
117113
def nearby(
118114
self,
119115
lat: float,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Setup
1616
setup(
1717
name='meteostat',
18-
version='1.5.2',
18+
version='1.5.3',
1919
author='Meteostat',
2020
author_email='[email protected]',
2121
description='Access and analyze historical weather and climate data with Python.',

0 commit comments

Comments
 (0)