Skip to content

Commit

Permalink
restrict to numpy version 1.26.4 maximum. Numpy > v2 does not result …
Browse files Browse the repository at this point in the history
…in correct output
  • Loading branch information
erdogant committed Aug 28, 2024
1 parent a09c7a2 commit f45ef1b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion findpeaks/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
from findpeaks import findpeaks
rng = np.random.default_rng(42)
x = rng.normal(size=(50, 50))
x = gaussian_filter(x, sigma=10.)
x = gaussian_filter(x, sigma=10)
# peak and valley
fp = findpeaks(method="topology", whitelist=['peak', 'valley'], denoise=None, verbose=3)
results = fp.fit(x)
Expand Down
1 change: 1 addition & 0 deletions findpeaks/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ def topology(X, limit=None, reverse=True, verbose=3):
# It is important to ensure unique values because the method sorts the values and only unique values are processed.
# Without adjusting duplicated values, peaks with exactly the same height will be skipped.
X = _make_unique(X)
# X = np.maximum(X + ((X>0).astype(int) * np.random.rand(X.shape[0], X.shape[1])/10), 0)

# Get indices orderd by value from high to low
indices = [(i, j) for i in range(h) for j in range(w) if _get_indices(X, (i, j)) is not None and _get_indices(X, (i, j)) >= limit]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
scipy
matplotlib
numpy
numpy==1.26.4
pandas
tqdm
requests
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
setuptools.setup(
install_requires=['scipy',
'matplotlib',
'numpy',
'numpy==1.26.4',
'pandas',
'tqdm',
'requests',
Expand Down

0 comments on commit f45ef1b

Please sign in to comment.