diff --git a/MANIFEST.in b/MANIFEST.in index 36c6cbc..2c36bd1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,11 @@ include README.md include LICENSE.txt include CHANGELOG.md +include pyproject.toml +recursive-include csu_radartools *.py *.pyx *.c *.pxd +recursive-include csu_radartools/beta_function_parameters *.csv recursive-include notebooks *.ipynb recursive-include tests *.py +global-exclude __pycache__ +global-exclude *.py[co] +global-exclude *~ diff --git a/csu_radartools/_version.py b/csu_radartools/_version.py index 2020a26..d6612ed 100644 --- a/csu_radartools/_version.py +++ b/csu_radartools/_version.py @@ -2,5 +2,5 @@ """Version File.""" -VERSION_INFO = (1, 4, 0, 'dev0') +VERSION_INFO = (1, 4, 0) __version__ = '.'.join(map(str, VERSION_INFO)) diff --git a/csu_radartools/calc_kdp_ray_fir.pyx b/csu_radartools/calc_kdp_ray_fir.pyx index 5311b52..db6eb17 100644 --- a/csu_radartools/calc_kdp_ray_fir.pyx +++ b/csu_radartools/calc_kdp_ray_fir.pyx @@ -1,6 +1,7 @@ # cython: boundscheck=False # cython: language_level=2 +import cython from libc.math cimport sqrt cimport numpy as np import numpy as np @@ -190,5 +191,6 @@ def hid_beta_f(int ngates, float[:] x_arr, float a, float b, float m): for i in range(ngates): beta[i] = 1.0 / (1.0 + (((x_arr[i] - m) / a)**2.0)**b) + # beta[i] = 1.0 / (1.0 + np.power(np.power((x_arr[i] - m) / a, 2.0), b)) return beta diff --git a/notebooks/CSU_RadarTools_Demo.ipynb b/notebooks/CSU_RadarTools_Demo.ipynb index cd88af3..19cff1f 100644 --- a/notebooks/CSU_RadarTools_Demo.ipynb +++ b/notebooks/CSU_RadarTools_Demo.ipynb @@ -109,7 +109,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -140,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -266,12 +266,23 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.8747849464416504 seconds\n" + ] + } + ], "source": [ + "import time\n", + "begin_time = time.time()\n", "fh = csu_fhc.csu_fhc_summer(dz=dz, zdr=dr, rho=rh, kdp=kd, use_temp=True, band='C',\n", - " T=radar_T)" + " T=radar_T)\n", + "print(time.time() - begin_time, 'seconds')" ] }, { @@ -297,7 +308,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -326,7 +337,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -342,7 +353,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -375,7 +386,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -2237,7 +2248,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.3" + "version": "3.12.10" } }, "nbformat": 4, diff --git a/notebooks/KAMX20130925_171241_V06.gz b/notebooks/KAMX20130925_171241_V06.gz index 003f9bb..20df07a 100644 Binary files a/notebooks/KAMX20130925_171241_V06.gz and b/notebooks/KAMX20130925_171241_V06.gz differ diff --git a/notebooks/NPOL1_2015_1117_001839.uf.gz b/notebooks/NPOL1_2015_1117_001839.uf.gz index eb8f580..1e70b87 100644 Binary files a/notebooks/NPOL1_2015_1117_001839.uf.gz and b/notebooks/NPOL1_2015_1117_001839.uf.gz differ diff --git a/notebooks/NPOL1_2015_1117_181215_rhi.uf.gz b/notebooks/NPOL1_2015_1117_181215_rhi.uf.gz index e810983..9f31d63 100644 Binary files a/notebooks/NPOL1_2015_1117_181215_rhi.uf.gz and b/notebooks/NPOL1_2015_1117_181215_rhi.uf.gz differ diff --git a/notebooks/cfrad.20040805_213003.000_to_20040805_214323.000_SPOL_v1_SUR.nc.gz b/notebooks/cfrad.20040805_213003.000_to_20040805_214323.000_SPOL_v1_SUR.nc.gz index 67bc87d..252c06c 100644 Binary files a/notebooks/cfrad.20040805_213003.000_to_20040805_214323.000_SPOL_v1_SUR.nc.gz and b/notebooks/cfrad.20040805_213003.000_to_20040805_214323.000_SPOL_v1_SUR.nc.gz differ diff --git a/notebooks/cfrad.20060119_170029.000_to_20060121_020810.000_CPOL_v1_PPI.nc.gz b/notebooks/cfrad.20060119_170029.000_to_20060121_020810.000_CPOL_v1_PPI.nc.gz index beeebf1..87195c1 100644 Binary files a/notebooks/cfrad.20060119_170029.000_to_20060121_020810.000_CPOL_v1_PPI.nc.gz and b/notebooks/cfrad.20060119_170029.000_to_20060121_020810.000_CPOL_v1_PPI.nc.gz differ diff --git a/notebooks/oly_npol_cart20151205_152002.nc.gz b/notebooks/oly_npol_cart20151205_152002.nc.gz index 1082d90..9e71482 100644 Binary files a/notebooks/oly_npol_cart20151205_152002.nc.gz and b/notebooks/oly_npol_cart20151205_152002.nc.gz differ diff --git a/pyproject.toml b/pyproject.toml index d128eec..60970a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -# Minimum requirements for the build system to execute. -requires = ["setuptools", "wheel", "cython", "numpy"] +requires = ["setuptools>=45", "wheel", "cython", "numpy"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index ac9c8f5..9623199 100644 --- a/setup.py +++ b/setup.py @@ -71,14 +71,18 @@ def get_version(module=None): else: EXT = '.f' -EXTENSIONS = [Extension(PACKAGES[0] + '.calc_kdp_ray_fir', - [PACKAGES[0] + '/calc_kdp_ray_fir' + EXT])] INCLUDE_DIRS = [numpy.get_include(), '.'] +# FIX: include_dirs needs to be passed to Extension, not setup() +EXTENSIONS = [Extension(PACKAGES[0] + '.calc_kdp_ray_fir', + [PACKAGES[0] + '/calc_kdp_ray_fir' + EXT], + include_dirs=INCLUDE_DIRS)] # <-- MOVED HERE + if USE_CYTHON: EXTENSIONS = cythonize(EXTENSIONS, compiler_directives={'cpow': True}) +# Run setup # Run setup setup(name='csu_radartools', version=get_version(), @@ -88,7 +92,9 @@ def get_version(module=None): author_email='bdolan@colostate.edu', description=DOCLINES[1], long_description=__doc__, + long_description_content_type='text/plain', # Changed from markdown since __doc__ is plain keywords='radar precipitation meteorology weather', + license='GPLv2', # Add explicit license classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Education', @@ -99,12 +105,23 @@ def get_version(module=None): 'Operating System :: Unix', 'Programming Language :: Cython', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering :: Atmospheric Science', ], packages=PACKAGES, package_data={'csu_radartools': ['beta_function_parameters/*.csv']}, ext_modules=EXTENSIONS, - include_dirs=INCLUDE_DIRS, - install_requires=['numpy', 'pandas', 'matplotlib', 'scipy', 'cython', 'netCDF4'], - python_requires='<4', - ) + install_requires=[ + 'numpy>=1.18', + 'scipy', + 'matplotlib', + 'pandas', + 'cython', + 'netCDF4', + ], + python_requires='>=3.8', +)