Skip to content

Commit 7947690

Browse files
committed
Port changes from main
2 parents a4c133f + 03e80cc commit 7947690

File tree

7 files changed

+164
-218
lines changed

7 files changed

+164
-218
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN pip install wavpack-numcodecs
2525
# Install spikeinterface-gui from source
2626
RUN git clone https://github.com/alejoe91/spikeinterface-gui.git && \
2727
cd spikeinterface-gui && \
28-
git checkout f8198db0ac04232f594dcb1bef80c446e41cd775 && \
28+
git checkout a616ff653eea37632cac013bf21a39cdea18c0c1 && \
2929
pip install . && cd ..
3030

3131

src/aind_ephys_portal/docdb/database.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"""Database access functions for the AIND SIGUI Portal."""
22

33
import os
4-
from typing import Optional, List, Dict, Any
4+
from typing import List, Dict, Any
55

6-
import numpy as np
7-
import pandas as pd
86
import panel as pn
97
from aind_data_access_api.document_db import MetadataDbClient
108

@@ -81,6 +79,7 @@ def get_asset_by_name(asset_name: str):
8179
response = client.retrieve_docdb_records(filter_query={"name": {"$regex": asset_name, "$options": "i"}}, limit=0)
8280
return response
8381

82+
8483
@pn.cache(ttl=TIMEOUT_1H)
8584
def get_raw_asset_by_name(asset_name: str):
8685
"""Get all assets that match a given asset name pattern.
@@ -96,22 +95,22 @@ def get_raw_asset_by_name(asset_name: str):
9695
List of matching asset records.
9796
"""
9897
raw_name = _raw_name_from_derived(asset_name)
99-
response = client.retrieve_docdb_records(filter_query={"name": {"$regex": raw_name, "$options": "i"},
100-
"data_description.data_level": "raw"}, limit=0)
98+
response = client.retrieve_docdb_records(
99+
filter_query={"name": {"$regex": raw_name, "$options": "i"}, "data_description.data_level": "raw"}, limit=0
100+
)
101101
return response
102102

103103

104104
@pn.cache(ttl=TIMEOUT_1H)
105105
def get_all_ecephys_derived() -> List[Dict[str, Any]]:
106106
"""Get a limited set of all records from the database.
107-
107+
108108
Returns
109109
-------
110110
list[dict]
111111
List of records, limited to 50 entries.
112112
"""
113-
filter_query = {"data_description.modality.abbreviation": "ecephys",
114-
"data_description.data_level": "derived"}
113+
filter_query = {"data_description.modality.abbreviation": "ecephys", "data_description.data_level": "derived"}
115114
response = client.retrieve_docdb_records(
116115
filter_query=filter_query,
117116
)

src/aind_ephys_portal/ephys_gui_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""SIGUI View main entrypoint"""
2+
23
import urllib
34
import param
45

src/aind_ephys_portal/panel/ephys_gui.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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:\nAnalyzer path: {self.analyzer_path}\nRecording path: {self.recording_path}")
68+
print(
69+
f"Initializing Ephys GUI for:\nAnalyzer path: {self.analyzer_path}\nRecording 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

Comments
 (0)