From 74e38f62a97db76d41a9f512cfdc816b5108d8a6 Mon Sep 17 00:00:00 2001 From: Srinath Kailasa Date: Tue, 27 Jul 2021 16:48:10 +0100 Subject: [PATCH] REL: 6.0.0 (#104) - Configuring precision causes breaking API changes - The threading layer optimisation radically improves throughput --- fmm/__version__.py | 2 +- utils/time.py | 44 ++++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/fmm/__version__.py b/fmm/__version__.py index b49fd5c..8f2fd41 100644 --- a/fmm/__version__.py +++ b/fmm/__version__.py @@ -3,5 +3,5 @@ """ __title__ = 'fmm' -__version__ = '5.0.1' +__version__ = '6.0.0' __description__ = 'An adaptive, kernel-independent, particle FMM implementation Python' diff --git a/utils/time.py b/utils/time.py index afd9208..718323b 100644 --- a/utils/time.py +++ b/utils/time.py @@ -5,31 +5,31 @@ import time def timeit(verbose=False): - """ - Time functions via decoration. Optionally output time to stdout. + """ + Time functions via decoration. Optionally output time to stdout. - Parameters: - ----------- - verbose : bool + Parameters: + ----------- + verbose : bool - Example Usage: - >>> @timeit(verbose=True) - >>> def foo(*args, **kwargs): pass - """ - def _timeit(f): - @wraps(f) - def wrapper(*args, **kwargs): - if verbose: - start = time.time() - res = f(*args, **kwargs) - runtime = time.time() - start - print(f'{f.__name__!r} in {runtime:.4f} s') - else: - res = f(*args, **kwargs) - return res + Example Usage: + >>> @timeit(verbose=True) + >>> def foo(*args, **kwargs): pass + """ + def _timeit(f): + @wraps(f) + def wrapper(*args, **kwargs): + if verbose: + start = time.time() + res = f(*args, **kwargs) + runtime = time.time() - start + print(f'{f.__name__!r} in {runtime:.4f} s') + else: + res = f(*args, **kwargs) + return res - return wrapper - return _timeit + return wrapper + return _timeit def seconds_to_minutes(seconds):