Skip to content

Commit

Permalink
fix: fixing errors that were crashing functional QC objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Nov 15, 2024
1 parent 6b13ebe commit f30cc2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/aind_qc_portal/panel/custom_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ def _checkbox_helper(self, data: dict):
self._panel.param.watch(self._callback_helper, "value")

def _rulebased_helper(self, data: dict):
self._panel = pn.widgets.StaticText("Todo")
self._panel = pn.widgets.StaticText(value="Todo")
5 changes: 4 additions & 1 deletion src/aind_qc_portal/panel/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from io import BytesIO
from urllib.parse import urlparse
import param
from pathlib import Path
from panel.reactive import ReactiveHTML

CSS = """
Expand Down Expand Up @@ -150,10 +151,12 @@ def parse_reference(self, reference):
return _get_s3_asset(self.parent.s3_client, bucket, key)

elif "png" in reference:
print(self.parent.s3_bucket)
print(Path(self.parent.s3_prefix) / reference)
return _get_s3_asset(
self.parent.s3_client,
self.parent.s3_bucket,
self.parent.s3_prefix + reference,
str(Path(self.parent.s3_prefix) / reference),
)

elif reference == "ecephys-drift-map":
Expand Down
7 changes: 6 additions & 1 deletion src/aind_qc_portal/panel/quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ def get_data(self):
else:
return

if "data_description" in json_data:
if "data_description" in json_data and json_data["data_description"] and "modality" in json_data["data_description"]:
self.modalities = [
modality["abbreviation"]
for modality in json_data["data_description"]["modality"]
]
else:
# fallback: pull the modality from the name
self.modalities = [
json_data["name"].split("_")[0]
]

s3_location = json_data.get("location", None)
if s3_location:
Expand Down

0 comments on commit f30cc2f

Please sign in to comment.