From aea529251fffe37f9515e836e4e626c58d9f7d34 Mon Sep 17 00:00:00 2001 From: erdogant Date: Fri, 20 May 2022 20:04:55 +0200 Subject: [PATCH] 2.4.1 --- findpeaks/__init__.py | 2 +- findpeaks/examples.py | 21 ++++++++++++++++++--- findpeaks/findpeaks.py | 9 ++++----- findpeaks/stats.py | 7 +++++++ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/findpeaks/__init__.py b/findpeaks/__init__.py index 73957c5..ad78dbb 100644 --- a/findpeaks/__init__.py +++ b/findpeaks/__init__.py @@ -18,7 +18,7 @@ __author__ = 'Erdogan Tasksen' __email__ = 'erdogant@gmail.com' -__version__ = '2.4.0' +__version__ = '2.4.1' # module level doc-string __doc__ = """ diff --git a/findpeaks/examples.py b/findpeaks/examples.py index 77cfc1f..492fca9 100644 --- a/findpeaks/examples.py +++ b/findpeaks/examples.py @@ -6,10 +6,25 @@ # print(findpeaks.__version__) # pip install opencv-python -import matplotlib.pyplot as plt +# import matplotlib.pyplot as plt +# from findpeaks import findpeaks + +# %% issue #12 +# https://github.com/erdogant/findpeaks/issues/12 +import numpy as np + +X = np.sin(np.linspace(0, 1, 100)) from findpeaks import findpeaks +fp = findpeaks(method='caerus', params_caerus={'window': 50, 'minperc': 3, 'nlargest': 10, 'threshold': 0.25}) +results = fp.fit(X) -# %% +from caerus import caerus +cs = caerus(window=50, threshold=0.25, minperc=10, nlargest=10) +cs.fit(X, verbose=3) +cs.plot() + + +# %% Issue from findpeaks import findpeaks fp = findpeaks(method="mask", denoise=None, window=3, limit=None, verbose=0) X = fp.import_example("2dpeaks_image") @@ -60,7 +75,7 @@ # results['df'] fp.plot() fp.plot_persistence() -fp.plot_mesh(view=(90,0)) +fp.plot_mesh(view=(90, 0)) # %% diff --git a/findpeaks/findpeaks.py b/findpeaks/findpeaks.py index f4d4925..784a39c 100644 --- a/findpeaks/findpeaks.py +++ b/findpeaks/findpeaks.py @@ -18,11 +18,10 @@ import requests from urllib.parse import urlparse -# import sys -# fpath = os.path.join(os.path.dirname(__file__), 'utils') -# print(fpath) -# if not np.isin(fpath, sys.path): sys.path.append(fpath) -# sys.path.append(fpath) +# import stats as stats +# from stats import disable_tqdm +# import interpolate as interpolate + import findpeaks.stats as stats from findpeaks.stats import disable_tqdm import findpeaks.interpolate as interpolate diff --git a/findpeaks/stats.py b/findpeaks/stats.py index fd17fd4..c0632b5 100644 --- a/findpeaks/stats.py +++ b/findpeaks/stats.py @@ -13,6 +13,13 @@ from findpeaks.filters.frost import frost_filter from findpeaks.filters.median import median_filter from findpeaks.filters.mean import mean_filter +# import union_find as union_find +# from filters.lee import lee_filter +# from filters.lee_enhanced import lee_enhanced_filter +# from filters.kuan import kuan_filter +# from filters.frost import frost_filter +# from filters.median import median_filter +# from filters.mean import mean_filter from scipy.ndimage.morphology import generate_binary_structure, binary_erosion from scipy.ndimage.filters import maximum_filter