diff --git a/src/gui/rawdata_visualizer.py b/src/gui/rawdata_visualizer.py index ae8bc20..e84ef5a 100644 --- a/src/gui/rawdata_visualizer.py +++ b/src/gui/rawdata_visualizer.py @@ -300,15 +300,17 @@ def open_behavior_gui(self): assert self.behavior_gui is not None if signal is None: - print("Apply a filter before opening the Behavior GUI") + print('Apply a filter before opening the Behavior GUI') else: - print("Opening Behavior GUI") + print('Opening Behavior GUI') self.behavior_gui.set_data(signal, self.times) self.behavior_gui.show() class BehaviorVisualizerGUI(QWidget): - def __init__(self, ): + def __init__( + self, + ): super().__init__() self.trials = None self.init_ui() @@ -355,10 +357,7 @@ def load_trials(self, trials): def load_file(self, file_path): # load a trial file try: - if ( - file_path.endswith('.pqt') - or file_path.endswith('.parquet') - ): + if file_path.endswith('.pqt') or file_path.endswith('.parquet'): self.load_trials(pd.read_parquet(file_path)) else: raise ValueError('Unsupported file format') @@ -376,7 +375,9 @@ def update_plots(self): self.figure.clear() self.plotobj.set_data( - self.trials, self.processed_signal, self.times, + self.trials, + self.processed_signal, + self.times, ) # NOTE: we need to update the layout as it depends on the data self.figure, self.axes = self.plotobj.set_fig_layout(figure=self.figure) diff --git a/src/iblphotometry/plots.py b/src/iblphotometry/plots.py index 5c5b27a..8f2a1c7 100644 --- a/src/iblphotometry/plots.py +++ b/src/iblphotometry/plots.py @@ -199,7 +199,7 @@ def set_fig_layout(self, figure=None): def plot_trialsort_psth(self, axs): signal_keys = [k for k in self.psth_dict.keys() if k != 'times'] if axs.shape[1] < len(signal_keys): - raise ValueError("Error, skipping PSTH plotting") + raise ValueError('Error, skipping PSTH plotting') for iaxs, event in enumerate(signal_keys): axs_plt = [axs[0, iaxs], axs[1, iaxs]] diff --git a/src/iblphotometry_tests/test_plots.py b/src/iblphotometry_tests/test_plots.py index 6ec9744..b97e0ce 100644 --- a/src/iblphotometry_tests/test_plots.py +++ b/src/iblphotometry_tests/test_plots.py @@ -7,6 +7,7 @@ from iblphotometry.behavior import psth, psth_times import iblphotometry.plots as plots + # from gui.rawdata_visualizer import BehaviorVisualizerGUI from iblphotometry.synthetic import synthetic101 import iblphotometry.preprocessing as ffpr