Skip to content

Commit

Permalink
renamed fastkde to polyexpkde
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinmccarter committed Sep 12, 2023
1 parent 990ab70 commit 9122bc5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 29 deletions.
20 changes: 6 additions & 14 deletions examples/basic-example.ipynb

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions fastkde/__init__.py

This file was deleted.

4 changes: 4 additions & 0 deletions polyexpkde/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from polyexpkde.ksum import h_Gauss_to_K
from polyexpkde.ksum import kernel_density
from polyexpkde.ksum import kernel_eval
from polyexpkde.polyexp_kde import PolyExpKernelDensity
4 changes: 2 additions & 2 deletions fastkde/ksum.py → polyexpkde/ksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def ksum_numba(x, y, x_eval, h, betas, output, counts, coefs, Ly, Ry):
for i in range(n_eval):
ix = np.round(counts[i])
if ix == 0:
exp_mult = np.exp((x_eval[i] - x[0]) / h)
exp_mult = max(np.exp((x_eval[i] - x[0]) / h), K_EPS)
output[i] += (
betas[orddo] * np.power(x[0] - x_eval[i], orddo)
/ denom * exp_mult * y[0]
Expand All @@ -172,7 +172,7 @@ def ksum_numba(x, y, x_eval, h, betas, output, counts, coefs, Ly, Ry):
for j in range(orddo + 1):
output[i] += betas[orddo] * coefs[j] * (
np.power(x_eval[i], orddo - j) * Ly[j, ix - 1] * exp_mult
+ np.power(-x_eval[i], orddo - j) * Ry[j, ix - 1] / max(exp_mult, 1e-300)
+ np.power(-x_eval[i], orddo - j) * Ry[j, ix - 1] / exp_mult
) / denom


Expand Down
2 changes: 1 addition & 1 deletion fastkde/polyexp_kde.py → polyexpkde/polyexp_kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
check_random_state,
)

from fastkde.ksum import (
from polyexpkde.ksum import (
kernel_eval,
kernel_density,
)
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def readme():


configuration = {
"name": "fastkde",
"version": "0.1.1",
"name": "polyexpkde",
"version": "0.1.2",
"description": "Fast KDE with polynomial-exponential kernel",
"long_description": readme(),
"classifiers": [
Expand All @@ -29,12 +29,12 @@ def readme():
"Programming Language :: Python :: 3.8",
],
"keywords": "KDE, kernel density estimation",
"url": "http://github.com/calvinmccarter/fastkde",
"url": "http://github.com/calvinmccarter/polyexpkde",
"author": "Calvin McCarter",
"author_email": "[email protected]",
"maintainer": "Calvin McCarter",
"maintainer_email": "[email protected]",
"packages": ["fastkde"],
"packages": ["polyexpkde"],
"install_requires": [
"numba >= 0.48",
"numpy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
import scipy.stats as spst

from fastkde import PolyExpKernelDensity
from polyexpkde import PolyExpKernelDensity


def test_gaussian_approx():
Expand Down
6 changes: 3 additions & 3 deletions tests/test_imports.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def test_import_packages():
"""Test that importing our package works."""
import fastkde
from fastkde import PolyExpKernelDensity
from fastkde import kernel_density
import polyexpkde
from polyexpkde import PolyExpKernelDensity
from polyexpkde import kernel_density

0 comments on commit 9122bc5

Please sign in to comment.