Commit d680b424 authored by BorjaEst's avatar BorjaEst
Browse files

Gerund form for log messages

parent 4ec70c4d
...@@ -40,9 +40,9 @@ class Source: ...@@ -40,9 +40,9 @@ class Source:
def __init__(self, name, collections): def __init__(self, name, collections):
self.name = name self.name = name
self._models = {} self._models = {}
logging.info("Load source '%s'", self.name) logging.info("Loading source '%s'", self.name)
for name, specifications in collections.items(): for name, specifications in collections.items():
logging.info("Load model '%s'", name) logging.info("Loading model '%s'", name)
model = _load_model(**specifications) model = _load_model(**specifications)
if model: if model:
self._models[name] = model self._models[name] = model
...@@ -63,7 +63,7 @@ class Source: ...@@ -63,7 +63,7 @@ class Source:
for model in self._models: for model in self._models:
dirname = "{source}_{model}".format(source=self.name, model=model) dirname = "{source}_{model}".format(source=self.name, model=model)
os.makedirs(dirname, exist_ok=True) os.makedirs(dirname, exist_ok=True)
logger.info("Skim data from '%s'", dirname) logger.info("Skimming data from '%s'", dirname)
with utils.cd(dirname): with utils.cd(dirname):
_skim(self[model], delta=groupby) _skim(self[model], delta=groupby)
......
...@@ -25,7 +25,7 @@ def standardize_tco3(dataset, variable, coordinates): ...@@ -25,7 +25,7 @@ def standardize_tco3(dataset, variable, coordinates):
def rename_coords_vmro3(array, time, plev, lat, lon): def rename_coords_vmro3(array, time, plev, lat, lon):
"""Renames a vmro3 array variable and coordinates""" """Renames a vmro3 array variable and coordinates"""
logger.debug("Rename '{0}' coordinates".format('vmro3_zm')) logger.debug("Renaming '{0}' coordinates".format('vmro3_zm'))
return array.rename({'time': time, 'plev': plev, 'lat': lat, 'lon': lon}) return array.rename({'time': time, 'plev': plev, 'lat': lat, 'lon': lon})
...@@ -43,7 +43,7 @@ def standardize_vmro3(dataset, variable, coordinates): ...@@ -43,7 +43,7 @@ def standardize_vmro3(dataset, variable, coordinates):
def rename_coords_tco3(array, time, lat, lon): def rename_coords_tco3(array, time, lat, lon):
"""Renames a tco3 array variable and coordinates""" """Renames a tco3 array variable and coordinates"""
logger.debug("Rename '{0}' coordinates".format('tco3_zm')) logger.debug("Renaming '{0}' coordinates".format('tco3_zm'))
return array.rename({'time': time, 'lat': lat, 'lon': lon}) return array.rename({'time': time, 'lat': lat, 'lon': lon})
......
...@@ -28,11 +28,11 @@ def cd(newdir): ...@@ -28,11 +28,11 @@ def cd(newdir):
prevdir = os.getcwd() prevdir = os.getcwd()
os.chdir(os.path.expanduser(newdir)) os.chdir(os.path.expanduser(newdir))
try: try:
logger.debug("Temp dir change to: '%s'", newdir) logger.debug("Changing directory: '%s'", newdir)
yield yield
finally: finally:
os.chdir(prevdir) os.chdir(prevdir)
logger.debug("Restore directory: '%s'", prevdir) logger.debug("Restoring directory: '%s'", prevdir)
def return_on_failure(message, default=None): def return_on_failure(message, default=None):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment