From ed0ce65c614c4c91d5d9ead8c102166e31503282 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Mon, 19 Aug 2024 19:04:47 +0200 Subject: [PATCH 1/2] Use relative import rather than absolute --- physioqc/interfaces/interfaces.py | 3 +-- physioqc/metrics/multimodal.py | 1 - physioqc/workflow.py | 8 ++++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/physioqc/interfaces/interfaces.py b/physioqc/interfaces/interfaces.py index 4c5d587..d2b3496 100644 --- a/physioqc/interfaces/interfaces.py +++ b/physioqc/interfaces/interfaces.py @@ -1,9 +1,8 @@ import os -import matplotlib.pyplot as plt import pandas as pd -from physioqc.metrics.multimodal import peak_amplitude, peak_detection, peak_distance +from .metrics.multimodal import peak_amplitude, peak_detection, peak_distance def generate_figures(figures, data, outdir): diff --git a/physioqc/metrics/multimodal.py b/physioqc/metrics/multimodal.py index 110f8de..0518589 100644 --- a/physioqc/metrics/multimodal.py +++ b/physioqc/metrics/multimodal.py @@ -5,7 +5,6 @@ import numpy as np import peakdet as pk from scipy import signal -from scipy.misc import derivative from .utils import has_peakfind_physio, physio_or_numpy diff --git a/physioqc/workflow.py b/physioqc/workflow.py index d2d8b66..c377105 100644 --- a/physioqc/workflow.py +++ b/physioqc/workflow.py @@ -5,15 +5,15 @@ import numpy as np import peakdet as pk -from physioqc.cli.run import _get_parser -from physioqc.interfaces.interfaces import generate_figures, run_metrics, save_metrics -from physioqc.interfaces.visualizations import ( +from .cli.run import _get_parser +from .interfaces.interfaces import generate_figures, run_metrics, save_metrics +from .interfaces.visualizations import ( plot_average_peak, plot_histogram, plot_power_spectrum, plot_raw_data, ) -from physioqc.metrics.multimodal import ( +from .metrics.multimodal import ( fALFF, freq_energy, max, From 1482c9f3040fa102a2640f1f27fb821c3e2f9b88 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Wed, 21 Aug 2024 18:19:37 +0200 Subject: [PATCH 2/2] Fix imports --- physioqc/interfaces/interfaces.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physioqc/interfaces/interfaces.py b/physioqc/interfaces/interfaces.py index d2b3496..7181d4e 100644 --- a/physioqc/interfaces/interfaces.py +++ b/physioqc/interfaces/interfaces.py @@ -2,7 +2,7 @@ import pandas as pd -from .metrics.multimodal import peak_amplitude, peak_detection, peak_distance +from ..metrics.multimodal import peak_amplitude, peak_detection, peak_distance def generate_figures(figures, data, outdir):