From a662c885d58e99f3621fe2acd94328d6069b8829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 10 May 2017 15:40:43 +0300 Subject: [PATCH] Fix verbose messages Former-commit-id: 4c8d6e95e55854925fe3b7c4fd35e9875d7a49ac --- misc/dispersion_chunks.py | 4 ++++ qpms/hexpoints.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/misc/dispersion_chunks.py b/misc/dispersion_chunks.py index f654eca..8f71a75 100755 --- a/misc/dispersion_chunks.py +++ b/misc/dispersion_chunks.py @@ -195,6 +195,10 @@ TMatrices_om = TMatrices_interp(freq) chunkn = math.ceil(klist_full.shape[0] / chunklen) +if verbose: + print('Evaluating %d k-points in %d chunks' % (klist_full.shape[0], chunkn), file = sys.stderr) + sys.stderr.flush() + metadata = np.array({ 'maxlayer' : maxlayer, 'gaussianSigma' : gaussianSigma, diff --git a/qpms/hexpoints.py b/qpms/hexpoints.py index 03aba3a..0252b77 100644 --- a/qpms/hexpoints.py +++ b/qpms/hexpoints.py @@ -479,7 +479,7 @@ def hexlattice_zsym_getSVD(lMax, TMatrices_om, epsilon_b, hexside, maxlayer, ome leftmatrixlist = np.full((klist.shape[0],2,2,nelem,2,2,nelem),np.nan,dtype=complex) isNaNlist = np.zeros((klist.shape[0]), dtype=bool) - sbtime = _time_b(verbose, step='Initializing matrices for SVD for a given list of k\'s.') + sbtime = _time_b(verbose, step='Initialization of matrices for SVD for a given list of k\'s') # sem nějaká rozumná smyčka for ki in range(klist.shape[0]): k = klist[ki] @@ -527,16 +527,18 @@ def hexlattice_zsym_getSVD(lMax, TMatrices_om, epsilon_b, hexside, maxlayer, ome TEč, TMč = symz_indexarrays(lMax, 2) leftmatrixlist_TE = leftmatrixlist_s[np.ix_(np.arange(leftmatrixlist_s.shape[0]),TEč,TEč)] leftmatrixlist_TM = leftmatrixlist_s[np.ix_(np.arange(leftmatrixlist_s.shape[0]),TMč,TMč)] + _time_e(sbtime, verbose, step='Initializing matrices for SVD for a given list of k\'s') - _time_e(sbtime, verbose, step='Initializing matrices for SVD for a given list of k\'s.') sbtime = _time_b(verbose, step='Calculating SVDs for a given list of k\'s.') if(not onlyNmin): svUfullTElist[nnlist], svSfullTElist[nnlist], svVfullTElist[nnlist] = np.linalg.svd(leftmatrixlist_TE, compute_uv=True) svUfullTMlist[nnlist], svSfullTMlist[nnlist], svVfullTMlist[nnlist] = np.linalg.svd(leftmatrixlist_TM, compute_uv=True) _time_e(sbtime, verbose, step='Calculating SVDs for a given list of k\'s.') + _time_e(btime, verbose) return ((svUfullTElist, svSfullTElist, svVfullTElist), (svUfullTMlist, svSfullTMlist, svVfullTMlist)) else: minsvTElist[nnlist] = np.linalg.svd(leftmatrixlist_TE, compute_uv=False)[...,-onlyNmin:] minsvTMlist[nnlist] = np.linalg.svd(leftmatrixlist_TM, compute_uv=False)[...,-onlyNmin:] _time_e(sbtime, verbose, step='Calculating SVDs for a given list of k\'s.') + _time_e(btime, verbose) return (minsvTElist, minsvTMlist)