From 1cc1793f570d98ab4274aabd997b026f01d3e966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Tue, 15 May 2018 14:37:05 +0300 Subject: [PATCH] Fix memory corruption, python package installability Former-commit-id: d9d89ff20b67132e8d88d55b206a8856a395f1f2 --- qpms/__init__.py | 2 +- qpms/hexpoints.py | 2 +- qpms/hexpoints_c.pyx | 2 +- qpms/scattering.py | 1 + qpms/translations.c | 4 +++- setup.py | 4 ++-- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/qpms/__init__.py b/qpms/__init__.py index c2d880c..fc034d4 100644 --- a/qpms/__init__.py +++ b/qpms/__init__.py @@ -3,5 +3,5 @@ __version__ = get_distribution('qpms').version from qpms_c import * from .qpms_p import * -from .lattices import * +from .lattices2d import * from .hexpoints import * diff --git a/qpms/hexpoints.py b/qpms/hexpoints.py index 405a82a..063c113 100644 --- a/qpms/hexpoints.py +++ b/qpms/hexpoints.py @@ -437,7 +437,7 @@ def hexlattice_get_AB(lMax, k_hexside, maxlayer, circular=True, return_points = from scipy.constants import c from .timetrack import _time_b, _time_e -from .qpms_p import symz_indexarrays +from .tmatrices import symz_indexarrays def hexlattice_zsym_getSVD(lMax, TMatrices_om, epsilon_b, hexside, maxlayer, omega, klist, gaussianSigma=False, onlyNmin=0, verbose=False): btime = _time_b(verbose) diff --git a/qpms/hexpoints_c.pyx b/qpms/hexpoints_c.pyx index da5912f..ebcf0fb 100644 --- a/qpms/hexpoints_c.pyx +++ b/qpms/hexpoints_c.pyx @@ -7,7 +7,7 @@ cdef double _s3 = math.sqrt(3) from scipy.constants import c from .timetrack import _time_b, _time_e -from .qpms_p import symz_indexarrays +from .tmatrices import symz_indexarrays from .hexpoints import hexlattice_get_AB cpdef hexlattice_zsym_getSVD(int lMax, TMatrices_om, double epsilon_b, double hexside, size_t maxlayer, double omega, klist, gaussianSigma=False, int onlyNmin=0, verbose=False): diff --git a/qpms/scattering.py b/qpms/scattering.py index 3cb317b..2344253 100644 --- a/qpms/scattering.py +++ b/qpms/scattering.py @@ -185,6 +185,7 @@ class Scattering(object): class LatticeScattering(Scattering): def __init__(self, lattice_spec, k_0, zSym = False): + pass """ diff --git a/qpms/translations.c b/qpms/translations.c index 56e5d5c..ae29c19 100644 --- a/qpms/translations.c +++ b/qpms/translations.c @@ -1574,7 +1574,9 @@ int qpms_cython_trans_calculator_get_AB_arrays_loop( while(local_indices[ax] == innerloop_shape[ax] && ax >= 0) { // overflow to the next digit but stop when reached below the last one local_indices[ax] = 0; - local_indices[--ax]++; + //local_indices[--ax]++; // dekrementace indexu pod nulu a následná inkrementace poruší paměť FIXME + ax--; + if (ax >= 0) local_indices[ax]++; } if (ax >= 0) // did not overflow, get back to the lowest index ax = resnd - 1; diff --git a/setup.py b/setup.py index 1208c69..4ebef4d 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ qpms_c = Extension('qpms_c', 'qpms/gaunt.c',#'qpms/gaunt.h','qpms/vectors.h','qpms/translations.h', # FIXME http://stackoverflow.com/questions/4259170/python-setup-script-extensions-how-do-you-include-a-h-file 'qpms/translations.c'], - extra_compile_args=['-std=c99','-ggdb','-O3', + extra_compile_args=['-std=c99','-ggdb', '-O0', '-DQPMS_COMPILE_PYTHON_EXTENSIONS', # this is required #'-DQPMS_USE_OMP', '-DDISABLE_NDEBUG', # uncomment to enable assertions in the modules @@ -35,7 +35,7 @@ qpms_c = Extension('qpms_c', ) setup(name='qpms', - version = "0.2.15", + version = "0.2.99", packages=['qpms'], # setup_requires=['setuptools_cython'], install_requires=['cython>=0.21','quaternion','spherical_functions','py_gmm'],