t1 = time.time() res = f(*args, **kwargs) tottime = time.time() - t1 msg = "%02d:%02d:%02d " % \ reduce(lambda ll, b : divmod(ll[0], b) + ll[1:], [(tottime,), 60, 60]) log.info("Time for {0}: {1}".format(f.__name__, msg) ) return res return wrap # Set global version string (for output metadata purposes): __version__ = version() # pylint: disable-msg=C0103 @disableOnWorkers def doDataDownload(configFile): """ Check and download the data files listed in the configuration file. Datasets are listed in the `Input` section of the configuration file, with the option `Datasets`. There must also be a corresponding section in the configuration file that inlcudes the url, path where the dataset will be stored and the filename that will be stored, e.g.:: [Input] Datasets=IBTRACS
import time import argparse import traceback from functools import wraps from os.path import join as pjoin, realpath, isdir, dirname from Utilities import pathLocator from Utilities.config import ConfigParser from Utilities.files import flStartLog from Utilities.version import version from Utilities.progressbar import SimpleProgressBar as ProgressBar from Evaluate import interpolateTracks from PlotInterface.maps import saveWindfieldMap __version__ = version() def timer(f): """ Basic timing functions for entire process """ @wraps(f) def wrap(*args, **kwargs): t1 = time.time() res = f(*args, **kwargs) tottime = time.time() - t1 msg = "%02d:%02d:%02d " % \ reduce(lambda ll, b : divmod(ll[0], b) + ll[1:], [(tottime,), 60, 60])
t1 = time.time() res = f(*args, **kwargs) tottime = time.time() - t1 msg = "%02d:%02d:%02d " % \ reduce(lambda ll, b : divmod(ll[0], b) + ll[1:], [(tottime,), 60, 60]) log.info("Time for {0}: {1}".format(f.func_name, msg) ) return res return wrap # Set global version string (for output metadata purposes): __version__ = version() # pylint: disable-msg=C0103 @disableOnWorkers def doDataDownload(configFile): """ Check and download the data files listed in the configuration file. Datasets are listed in the `Input` section of the configuration file, with the option `Datasets`. There must also be a corresponding section in the configuration file that inlcudes the url, path where the dataset will be stored and the filename that will be stored, e.g.:: [Input] Datasets=IBTRACS