From 470714f3dc2a58ecbc4d5aa4cf9bc1bec3560da0 Mon Sep 17 00:00:00 2001 From: Georg Raiser Date: Tue, 7 Jan 2025 11:40:23 +0000 Subject: [PATCH 1/5] ruff fixes --- src/iblphotometry/qc.py | 1 - src/iblphotometry_tests/test_processing.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/iblphotometry/qc.py b/src/iblphotometry/qc.py index 64114fc..2f43684 100644 --- a/src/iblphotometry/qc.py +++ b/src/iblphotometry/qc.py @@ -10,7 +10,6 @@ from iblphotometry.processing import make_sliding_window from iblphotometry.pipelines import run_pipeline -from brainbox.io.one import SessionLoader logger = logging.getLogger() diff --git a/src/iblphotometry_tests/test_processing.py b/src/iblphotometry_tests/test_processing.py index 7045776..84718ff 100644 --- a/src/iblphotometry_tests/test_processing.py +++ b/src/iblphotometry_tests/test_processing.py @@ -15,7 +15,7 @@ def test_processing(self): self.paths['photometry_signal_pqt'], self.paths['photometryROI_locations_pqt'], ) - trials = pd.read_parquet(self.paths['trials_table_pqt']) + # trials = pd.read_parquet(self.paths['trials_table_pqt']) raw_df = raw_dfs['GCaMP']['DMS'] # bleach corrections From 6ced0c234788a64a4ac1d2eee2aba04933e9954f Mon Sep 17 00:00:00 2001 From: Georg Raiser Date: Tue, 7 Jan 2025 11:42:20 +0000 Subject: [PATCH 2/5] ... --- src/iblphotometry_tests/test_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iblphotometry_tests/test_processing.py b/src/iblphotometry_tests/test_processing.py index 84718ff..29abc96 100644 --- a/src/iblphotometry_tests/test_processing.py +++ b/src/iblphotometry_tests/test_processing.py @@ -1,6 +1,6 @@ import iblphotometry.io as fio import iblphotometry.processing as processing -import pandas as pd +# import pandas as pd from iblphotometry_tests.base_tests import PhotometryDataTestCase From a81a0646c1a7bd42a260a6e11ab3606440619f4b Mon Sep 17 00:00:00 2001 From: Georg Raiser Date: Tue, 7 Jan 2025 12:10:16 +0000 Subject: [PATCH 3/5] removing ricker and replacing it with pywavelets --- src/iblphotometry/synthetic.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/iblphotometry/synthetic.py b/src/iblphotometry/synthetic.py index 9a7f1bc..1cb9e1f 100644 --- a/src/iblphotometry/synthetic.py +++ b/src/iblphotometry/synthetic.py @@ -4,7 +4,8 @@ import numpy as np import pandas as pd -import scipy.signal +# import scipy.signal +import pywt def synthetic101(fs=30, rl=1000, event_rate=0.2): @@ -17,7 +18,10 @@ def synthetic101(fs=30, rl=1000, event_rate=0.2): ns = fs * rl tscale = np.arange(ns) / fs photobleach = np.exp(-(tscale + 1) / 200) - ric = scipy.signal.ricker(int(fs * 4), 8) + # ric = scipy.signal.ricker(int(fs * 4), 8) # previous code + wavelet = pywt.ContinuousWavelet(name='mexh') + ric = wavelet.wavefun(length = int(fs*4))[0] / 2.5 # approximately + event_times = np.cumsum(-np.log(np.random.rand(int(rl * event_rate))) / event_rate) event_times = event_times[: np.searchsorted(event_times, rl - 10)] From fe19268053eec8a00083ea330ec20532c57db56b Mon Sep 17 00:00:00 2001 From: Georg Raiser Date: Tue, 7 Jan 2025 12:12:10 +0000 Subject: [PATCH 4/5] ruff --- src/iblphotometry/synthetic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iblphotometry/synthetic.py b/src/iblphotometry/synthetic.py index 1cb9e1f..687d897 100644 --- a/src/iblphotometry/synthetic.py +++ b/src/iblphotometry/synthetic.py @@ -4,6 +4,7 @@ import numpy as np import pandas as pd + # import scipy.signal import pywt @@ -20,8 +21,7 @@ def synthetic101(fs=30, rl=1000, event_rate=0.2): photobleach = np.exp(-(tscale + 1) / 200) # ric = scipy.signal.ricker(int(fs * 4), 8) # previous code wavelet = pywt.ContinuousWavelet(name='mexh') - ric = wavelet.wavefun(length = int(fs*4))[0] / 2.5 # approximately - + ric = wavelet.wavefun(length=int(fs * 4))[0] / 2.5 # approximately event_times = np.cumsum(-np.log(np.random.rand(int(rl * event_rate))) / event_rate) event_times = event_times[: np.searchsorted(event_times, rl - 10)] From 24cfcb4079752bfe5bdfd506c770d651ff1215d0 Mon Sep 17 00:00:00 2001 From: Georg Raiser Date: Tue, 7 Jan 2025 12:21:21 +0000 Subject: [PATCH 5/5] updated requirements to include pywavelets --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 30149db..52eb974 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ matplotlib pytest scipy pandera +pywavelets