Skip to content

Commit

Permalink
Ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
rossant committed Dec 10, 2024
1 parent 5f28f8a commit b3a8d18
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/gui/rawdata_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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')
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/iblphotometry/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
1 change: 1 addition & 0 deletions src/iblphotometry_tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3a8d18

Please sign in to comment.