From 57ea4b5207d4e51606e0c48096c1051a6fae8ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 10 May 2017 13:17:40 +0300 Subject: [PATCH] Verbosity level parser tweak Former-commit-id: 0932cb0caf4517891f40c38cbd7c2cb3c0cb144f --- misc/dispersion_chunks.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/misc/dispersion_chunks.py b/misc/dispersion_chunks.py index 594fcc8..5a085c3 100755 --- a/misc/dispersion_chunks.py +++ b/misc/dispersion_chunks.py @@ -31,7 +31,7 @@ parser.add_argument('--chunklen', action='store', type=int, default=1000, help=' parser.add_argument('--lMax', action='store', type=int, help='Override lMax from the TMatrix file') #TODO some more sophisticated x axis definitions parser.add_argument('--gaussian', action='store', type=float, metavar='σ', help='Use a gaussian envelope for weighting the interaction matrix contributions (depending on the distance), measured in unit cell lengths (?) FIxME).') -parser.add_argument('--verbose', '-v', action='count') +parser.add_argument('--verbose', '-v', action='count', help='Be verbose (about computation times, mostly)') popgrp=parser.add_argument_group(title='Operations') popgrp.add_argument('--tr', dest='ops', action=make_action_sharedlist('tr', 'ops'), default=list()) # the default value for dest can be set once popgrp.add_argument('--tr0', dest='ops', action=make_action_sharedlist('tr0', 'ops')) @@ -77,8 +77,8 @@ print(ops) # -----------------finished basic CLI parsing (except for op arguments) ------------------ -import time -begtime=time.time() +from .timetrack import _time_b, _time_e +btime=_time_b(verbose) import qpms import numpy as np @@ -230,4 +230,5 @@ for chunki in range(chunkn): if svdout: subprocess.run(['scp', svdout, scp_dest]) -print(time.strftime("%H.%M:%S",time.gmtime(time.time()-begtime))) +_time_e(btime, verbose) +#print(time.strftime("%H.%M:%S",time.gmtime(time.time()-begtime)))