@@ -29,29 +29,33 @@ def __init__(self, analyzer_path, recording_path, **params):
2929 # Create initial layout
3030 self .layout = pn .Column (
3131 pn .Row (
32- pn .widgets .TextInput (name = 'Analyzer path' , value = self .analyzer_path , height = 50 , sizing_mode = "stretch_width" ),
33- pn .widgets .TextInput (name = 'Recording path (optional)' , value = self .recording_path , height = 50 , sizing_mode = "stretch_width" ),
34- pn .widgets .Button (name = 'Launch!' , button_type = 'primary' , height = 50 , sizing_mode = "stretch_width" ),
35- sizing_mode = "stretch_width"
32+ pn .widgets .TextInput (
33+ name = "Analyzer path" , value = self .analyzer_path , height = 50 , sizing_mode = "stretch_width"
34+ ),
35+ pn .widgets .TextInput (
36+ name = "Recording path (optional)" , value = self .recording_path , height = 50 , sizing_mode = "stretch_width"
37+ ),
38+ pn .widgets .Button (name = "Launch!" , button_type = "primary" , height = 50 , sizing_mode = "stretch_width" ),
39+ sizing_mode = "stretch_width" ,
3640 ),
37- self ._create_main_window ()
41+ self ._create_main_window (),
3842 )
3943
4044 # Store widget references
4145 self .analyzer_input = self .layout [0 ][0 ]
4246 self .recording_input = self .layout [0 ][1 ]
4347 self .launch_button = self .layout [0 ][2 ]
44-
48+
4549 # Setup event handlers
46- self .analyzer_input .param .watch (self .update_values , ' value' )
47- self .recording_input .param .watch (self .update_values , ' value' )
50+ self .analyzer_input .param .watch (self .update_values , " value" )
51+ self .recording_input .param .watch (self .update_values , " value" )
4852 self .launch_button .on_click (self .on_click )
4953
5054 def _initialize (self ):
5155 if self .analyzer_input .value != "" :
5256 spinner = pn .indicators .LoadingSpinner (value = True , sizing_mode = "stretch_width" )
5357 # Create a TextArea widget to display logs
54- log_output = pn .widgets .TextAreaInput (value = '' , sizing_mode = "stretch_both" )
58+ log_output = pn .widgets .TextAreaInput (value = "" , sizing_mode = "stretch_both" )
5559
5660 original_stdout = sys .stdout
5761 sys .stdout = Tee (original_stdout , log_output ) # Redirect stdout
@@ -61,7 +65,9 @@ def _initialize(self):
6165
6266 self .layout [1 ] = pn .Row (spinner , log_output )
6367
64- print (f"Initializing Ephys GUI for:\n Analyzer path: { self .analyzer_path } \n Recording path: { self .recording_path } " )
68+ print (
69+ f"Initializing Ephys GUI for:\n Analyzer path: { self .analyzer_path } \n Recording path: { self .recording_path } "
70+ )
6571
6672 self ._initialize_analyzer ()
6773 if self .recording_path != "" :
@@ -97,14 +103,13 @@ def _set_processed_recording(self):
97103 print (f"Processed recording loaded: { recording_processed } " )
98104 self .analyzer .set_temporary_recording (recording_processed )
99105
100-
101106 def _check_if_s3_folder_exists (self , location ):
102107 bucket_name = location .split ("/" )[2 ]
103108 prefix = "/" .join (location .split ("/" )[3 :])
104109 try :
105- s3 = boto3 .client ('s3' )
110+ s3 = boto3 .client ("s3" )
106111 response = s3 .list_objects_v2 (Bucket = bucket_name , Prefix = prefix , MaxKeys = 1 )
107- return ' Contents' in response
112+ return " Contents" in response
108113 except Exception as e :
109114 return False
110115
0 commit comments