CSU-Radarmet / CSU_RadarTools

A module of independent functions to do precipitation retrievals from polarimetric radar data
GNU General Public License v2.0
88 stars 43 forks source link

No support for newest cython? #52

Closed rcjackson closed 6 years ago

rcjackson commented 6 years ago

When I try to install with the default settings under Python 3.6/cython 0.28.1 I get:

Compiling csu_radartools/calc_kdp_ray_fir.pyx because it depends on /home/rjackson/anaconda3/envs/cmac_en v/lib/python3.6/site-packages/Cython/Includes/numpy/init.pxd. [1/1] Cythonizing csu_radartools/calc_kdp_ray_fir.pyx

Error compiling Cython file:

...

cython: boundscheck=False

^

csu_radartools/calc_kdp_ray_fir.pyx:1:0: 'csu_radartools/calc_kdp_ray_fir' is not a valid module name Traceback (most recent call last): File "setup.py", line 37, in extensions = cythonize(extensions) File "/home/rjackson/anaconda3/envs/cmac_env/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1026, in cythonize cythonize_one(*args) File "/home/rjackson/anaconda3/envs/cmac_env/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1146, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: csu_radartools/calc_kdp_ray_fir.pyx

I fixed this by setting the use_cython flag to False but I think it would be great to get this working with newer versions of cython/python. Downgrading to cython 0.27.3 gets this to work.

tjlang commented 6 years ago

Does eliminating the #cython: boundscheck=False line from calc_kdp_ray_fir.pyx enable compilation under 0.28? And if so, can you then run the KDP program on a sample file successfully?

vlouf commented 6 years ago

I have the same issue. My cython version is 0.28.1.

vlouf commented 6 years ago

eliminating the #cython: boundscheck=False line does not solve the problem

tjlang commented 6 years ago

Thanks for this info. I confess that I do not have time to address this issue in the near term, so if someone else wants to take a crack, please feel free. This web page may be relevant to the problem: https://stackoverflow.com/questions/42102656/cython-compile-error-is-not-a-valid-module-name

Otherwise, I recommend downgrading to 0.27.3 or lower for the next month or so, until I can get some time to pay attention to this.

tjlang commented 6 years ago

I cannot reproduce this error under either cython 0.28.1 or cython 0.28.2. Below is what I get after nuking the build subdirectory, thus making sure everything recompiles, and running python setup.py install in the main directory. The module compiles and is importable, and the KDP routines run as normal.

running install running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.6 creating build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/init.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/beta_functions.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/common.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/csu_blended_rain.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/csu_blended_rain_tropical.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/csu_dsd.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/csu_fhc.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/csu_kdp.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/csu_liquid_ice_mass.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/csu_misc.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools copying csu_radartools/fundamentals.py -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools creating build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/C-band_Correlation_Coefficient.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/C-band_Differential_Reflectivity.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/C-band_Linear_Depolarization_Ratio.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/C-band_Reflectivity.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/C-band_Specific_Differential_Phase.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/C-band_Temperature.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/S-band_Correlation_Coefficient.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/S-band_Differential_Reflectivity.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/S-band_Linear_Depolarization_Ratio.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/S-band_Reflectivity.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/S-band_Specific_Differential_Phase.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/S-band_Temperature.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/X-band_Correlation_Coefficient.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/X-band_Differential_Reflectivity.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/X-band_Linear_Depolarization_Ratio.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/X-band_Reflectivity.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/X-band_Specific_Differential_Phase.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters copying csu_radartools/beta_function_parameters/X-band_Temperature.csv -> build/lib.macosx-10.7-x86_64-3.6/csu_radartools/beta_function_parameters running build_ext building 'csu_radartools/calc_kdp_ray_fir' extension creating build/temp.macosx-10.7-x86_64-3.6 creating build/temp.macosx-10.7-x86_64-3.6/csu_radartools gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/tjlang/anaconda/envs/py3/include -arch x86_64 -I/Users/tjlang/anaconda/envs/py3/include -arch x86_64 -I/Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/numpy/core/include -I/Users/tjlang/anaconda/envs/py3/include/python3.6m -c csu_radartools/calc_kdp_ray_fir.c -o build/temp.macosx-10.7-x86_64-3.6/csu_radartools/calc_kdp_ray_fir.o In file included from csu_radartools/calc_kdp_ray_fir.c:539: In file included from /Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4: In file included from /Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:18: In file included from /Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1816: /Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]

warning "Using deprecated NumPy API, disable it by " \

^ 1 warning generated. gcc -bundle -undefined dynamic_lookup -L/Users/tjlang/anaconda/envs/py3/lib -arch x86_64 -L/Users/tjlang/anaconda/envs/py3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/csu_radartools/calc_kdp_ray_fir.o -o build/lib.macosx-10.7-x86_64-3.6/csu_radartools/calc_kdp_ray_fir.cpython-36m-darwin.so running install_lib copying build/lib.macosx-10.7-x86_64-3.6/csu_radartools/calc_kdp_ray_fir.cpython-36m-darwin.so -> /Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/csu_radartools running install_egg_info Removing /Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/csu_radartools-1.2-py3.6.egg-info Writing /Users/tjlang/anaconda/envs/py3/lib/python3.6/site-packages/csu_radartools-1.2-py3.6.egg-info

josephhardinee commented 6 years ago

Can either @rcjackson or @vlouf try out pull request #53 and see if that fixes your issue?

tjlang commented 6 years ago

Yes, that would be helpful as I was never able to reproduce that error.

josephhardinee commented 6 years ago

This should be addressed by #53. I would suggest closing the issue unless @vlouf or @rcjackson find that it did not actually fix their error.

tjlang commented 6 years ago

Closing for now, per Joe's suggestion.