Skip to content

Commit

Permalink
caching bug
Browse files Browse the repository at this point in the history
  • Loading branch information
b8raoult committed Apr 5, 2024
1 parent 6cbb8d2 commit a6e70a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions climetlab/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ def save(self, name, value, f):
@contextmanager
def new_settings(s):
SETTINGS._stack.append(s)
SETTINGS._notify()

try:
yield None
finally:
Expand Down
6 changes: 2 additions & 4 deletions climetlab/sources/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,9 @@ def __init__(
self._metadata = dict(
valid_datetime=date if isinstance(date, str) else date.isoformat(),
param=param,
level=None,
levelist=None,
number=number,
levtype=None,
)

self._grid_points = grid_points

@property
Expand Down Expand Up @@ -267,7 +265,7 @@ def __repr__(self):
)

def metadata(self, name):
return self._metadata[name]
return self._metadata.get(name)


def make_datetime(date, time):
Expand Down

0 comments on commit a6e70a0

Please sign in to comment.