From 7c764d1ed48b4f15eba4c0047f49ce818fd1e6b3 Mon Sep 17 00:00:00 2001 From: Dan Birman Date: Wed, 11 Dec 2024 18:11:42 -0800 Subject: [PATCH] chore: removing some debug statements, minor refactor --- src/aind_qc_portal/panel/media.py | 6 +++--- src/aind_qc_portal/panel/quality_control.py | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/aind_qc_portal/panel/media.py b/src/aind_qc_portal/panel/media.py index c961fd2..2acc100 100644 --- a/src/aind_qc_portal/panel/media.py +++ b/src/aind_qc_portal/panel/media.py @@ -208,7 +208,7 @@ def _parse_type(reference, data): data : _type_ _description_ """ - print(f"Parsing type: {reference} with data: {data}") + # print(f"Parsing type: {reference} with data: {data}") if "https://s3" in data: data = _get_s3_file(data, os.path.splitext(reference)[1]) @@ -281,7 +281,7 @@ def _get_s3_data(bucket, key): S3 key name """ - print((f"Getting S3 data for {bucket}/{key}")) + # print((f"Getting S3 data for {bucket}/{key}")) try: response = s3_client.get_object(Bucket=bucket, Key=key) data = BytesIO(response["Body"].read()) @@ -301,7 +301,7 @@ def _get_kachery_cloud_url(hash: str): """ timestamp = int(time.time() * 1000) - print(f"Getting kachery-cloud URL for {hash}") + # print(f"Getting kachery-cloud URL for {hash}") # take the full hash string, e.g. sha1://fb558dff5ed3c13751b6345af8a3128b25c4fa70?label=vid_side_camera_right_start_0_end_0.1.mp4 and just get the hash simplified_hash = hash.split("?")[0].split("://")[1] diff --git a/src/aind_qc_portal/panel/quality_control.py b/src/aind_qc_portal/panel/quality_control.py index b719c95..96bf2d7 100644 --- a/src/aind_qc_portal/panel/quality_control.py +++ b/src/aind_qc_portal/panel/quality_control.py @@ -180,8 +180,8 @@ def status_panel(self): # We'll loop over stage and modality to build a table data = [] - for modality in self.modalities: - for stage in self.stages: + for stage in self.stages: + for modality in self.modalities: data.append( { "Group": modality.abbreviation, @@ -191,8 +191,7 @@ def status_panel(self): ), } ) - for tag in self.tags: - for stage in self.stages: + for tag in self.tags: data.append( { "Group": tag, @@ -204,7 +203,6 @@ def status_panel(self): ) df = pd.DataFrame(data, columns=["Group", "Stage", "Status"]) - print(df) # Reshape the DataFrame using pivot_table df_squashed = df.pivot_table(