Skip to content

Commit

Permalink
add brief docstrings for kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
weikang9009 committed Sep 26, 2018
1 parent a923b90 commit d625405
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ sdist
develop-eggs
.installed.cfg
lib
lib64
lib64
_build
17 changes: 16 additions & 1 deletion mgwr/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d625405

Please sign in to comment.