Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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 *~
2 changes: 1 addition & 1 deletion csu_radartools/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

"""Version File."""

VERSION_INFO = (1, 4, 0, 'dev0')
VERSION_INFO = (1, 4, 0)
__version__ = '.'.join(map(str, VERSION_INFO))
2 changes: 2 additions & 0 deletions csu_radartools/calc_kdp_ray_fir.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
33 changes: 22 additions & 11 deletions notebooks/CSU_RadarTools_Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -140,7 +140,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -159,7 +159,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -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')"
]
},
{
Expand All @@ -297,7 +308,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -326,7 +337,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -342,7 +353,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -375,7 +386,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -2237,7 +2248,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.10"
}
},
"nbformat": 4,
Expand Down
Binary file modified notebooks/KAMX20130925_171241_V06.gz
Binary file not shown.
Binary file modified notebooks/NPOL1_2015_1117_001839.uf.gz
Binary file not shown.
Binary file modified notebooks/NPOL1_2015_1117_181215_rhi.uf.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified notebooks/oly_npol_cart20151205_152002.nc.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
29 changes: 23 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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',
Expand All @@ -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',
)