From f41caf6203521036a3b521874999e09db98d8e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Mon, 8 May 2017 20:20:57 +0300 Subject: [PATCH] Fix of the previous Former-commit-id: 74a68bb17f61a875c9f8c852820ac1252a5095cc --- qpms/lattices.py | 2 +- qpms/legacy.py | 13 ------------- qpms/qpms_p.py | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/qpms/lattices.py b/qpms/lattices.py index c955cc1..5cdba38 100644 --- a/qpms/lattices.py +++ b/qpms/lattices.py @@ -7,7 +7,7 @@ import time import scipy import sys from qpms_c import get_mn_y, trans_calculator # TODO be explicit about what is imported -from .qpms_p import cart2sph, nelem2lMax, Ã, B̃ # TODO be explicit about what is imported +from .qpms_p import cart2sph, nelem2lMax # TODO be explicit about what is imported def _time_b(active = True, name = None, step = None): ''' diff --git a/qpms/legacy.py b/qpms/legacy.py index ec58fb1..3fb2d71 100644 --- a/qpms/legacy.py +++ b/qpms/legacy.py @@ -159,19 +159,6 @@ def B̃(m,n,μ,ν,kdlj,θlj,φlj,r_ge_d,J): -#@jit -def nelem2lMax(nelem): - """ - Auxiliary inverse function to nelem(lMax) = (lMax + 2) * lMax. Returns 0 if - it nelem does not come from positive integer lMax. - """ - lMax = round(math.sqrt(1+nelem) - 1) - if ((lMax < 1) or ((lMax + 2) * lMax != nelem)): - return 0 - else: - return lMax - - #@ujit diff --git a/qpms/qpms_p.py b/qpms/qpms_p.py index 5f73601..714c8de 100644 --- a/qpms/qpms_p.py +++ b/qpms/qpms_p.py @@ -157,6 +157,21 @@ def sph_loccart_basis(sph, sphaxis=-1, cartaxis=None): out = np.concatenate((x,y,z),axis=cartaxis) return out + +#@jit +def nelem2lMax(nelem): + """ + Auxiliary inverse function to nelem(lMax) = (lMax + 2) * lMax. Returns 0 if + it nelem does not come from positive integer lMax. + """ + lMax = round(math.sqrt(1+nelem) - 1) + if ((lMax < 1) or ((lMax + 2) * lMax != nelem)): + return 0 + else: + return lMax + + + #@jit def lpy(nmax, z): """