From d625405b3eca5b9c12a1b7f09f5946b9d869dbad Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Tue, 25 Sep 2018 21:55:58 -0700 Subject: [PATCH] add brief docstrings for kernels --- .gitignore | 3 ++- mgwr/kernels.py | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bdfa089..7b9821f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,5 @@ sdist develop-eggs .installed.cfg lib -lib64 \ No newline at end of file +lib64 +_build \ No newline at end of file diff --git a/mgwr/kernels.py b/mgwr/kernels.py index 65946c3..071f459 100644 --- a/mgwr/kernels.py +++ b/mgwr/kernels.py @@ -13,31 +13,46 @@ def fix_gauss(coords, bw, points=None, dmat=None,sorted_dmat=None,spherical=False): """ - Fixed Gaussian + Fixed Gaussian kernel. """ w = _Kernel(coords, function='gwr_gaussian', bandwidth=bw, truncate=False, points=points, dmat=dmat,sorted_dmat=sorted_dmat,spherical=spherical) return w.kernel def adapt_gauss(coords, nn, points=None, dmat=None,sorted_dmat=None,spherical=False): + """ + Spatially adaptive Gaussian kernel. + """ w = _Kernel(coords, fixed=False, k=nn-1, function='gwr_gaussian', truncate=False, points=points, dmat=dmat,sorted_dmat=sorted_dmat,spherical=spherical) return w.kernel def fix_bisquare(coords, bw, points=None, dmat=None,sorted_dmat=None,spherical=False): + """ + Fixed bisquare kernel. + """ w = _Kernel(coords, function='bisquare', bandwidth=bw, points=points, dmat=dmat,sorted_dmat=sorted_dmat,spherical=spherical) return w.kernel def adapt_bisquare(coords, nn, points=None, dmat=None,sorted_dmat=None,spherical=False): + """ + Spatially adaptive bisquare kernel. + """ w = _Kernel(coords, fixed=False, k=nn-1, function='bisquare', points=points, dmat=dmat,sorted_dmat=sorted_dmat,spherical=spherical) return w.kernel def fix_exp(coords, bw, points=None, dmat=None,sorted_dmat=None,spherical=False): + """ + Fixed exponential kernel. + """ w = _Kernel(coords, function='exponential', bandwidth=bw, truncate=False, points=points, dmat=dmat,sorted_dmat=sorted_dmat,spherical=spherical) return w.kernel def adapt_exp(coords, nn, points=None, dmat=None,sorted_dmat=None,spherical=False): + """ + Spatially adaptive exponential kernel. + """ w = _Kernel(coords, fixed=False, k=nn-1, function='exponential', truncate=False, points=points, dmat=dmat,sorted_dmat=sorted_dmat,spherical=spherical) return w.kernel