Skip to content

Commit

Permalink
Remove range reduction now that finufft 2.3 does this natively.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarrison committed Sep 10, 2024
1 parent a67d3f6 commit b18b420
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
5 changes: 4 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog

## Upcoming
## v1.0.1 (upcoming)
Minor optimizations that make use of finufft v2.3.

## v1.0.0 (2024-05-28)
Initial release, with support for CPU, GPU, and batched periodograms
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = [{ name = "Lehman Garrison" },
requires-python = ">=3.8"
license = { file = "LICENSE" }
urls = { Homepage = "https://github.com/flatironinstitute.org/nifty-ls" }
dependencies = ["numpy", "finufft >= 2.2"]
dependencies = ["numpy", "finufft >= 2.3"]
dynamic = ["version"]

[project.optional-dependencies]
Expand Down
6 changes: 0 additions & 6 deletions src/nifty_ls/cpu_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@ void process_finufft_inputs(
}
w2(i, j) *= std::exp(phase_shift * t2(j));
}

// TODO: if fmin/df is an integer, we may be able to do
// t = ((df * t) % 1) * 2 * np.pi
// Could help a lot with range-reduction performance.
t1(j) = std::fmod(t1(j), TWO_PI);
t2(j) = std::fmod(t2(j), TWO_PI);
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/nifty_ls/cufinufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ def lombscargle(
phase_shift1 = cp.exp(1j * (Nshift + fmin / df) * t1)
phase_shift2 = cp.exp(1j * (Nshift + fmin / df) * t2)

t1 %= 2 * cp.pi
t2 %= 2 * cp.pi

yw[:] = y * w2.real
if fit_mean:
# Up to now, w and w2 are identical
Expand Down
3 changes: 0 additions & 3 deletions src/nifty_ls/finufft.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ def lombscargle(
phase_shift1 = np.exp(1j * (Nshift + fmin / df) * t1)
phase_shift2 = np.exp(1j * (Nshift + fmin / df) * t2)

t1 %= 2 * np.pi
t2 %= 2 * np.pi

yw[:] = y * w2.real
if fit_mean:
# Up to now, w and w2 are identical
Expand Down

0 comments on commit b18b420

Please sign in to comment.