Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Aug 20, 2024
1 parent 5e1bbd1 commit 960c94a
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/aind_metadata_viz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,23 @@ def build_top():
return pane


missing_selector = pn.widgets.Select(name='Value state', options=['Missing', 'Present'])
missing_selector = pn.widgets.Select(
name="Value state", options=["Missing", "Present"]
)


def build_csv(file, field):
# For everybody who is missing the currently active file/field
id_fields = ["name", "_id", "location", "creation"]

get_present = missing_selector.value == 'Present'
get_present = missing_selector.value == "Present"

df_data = []
for data in data_list:
if not data[file] is None:
if mid_selector.value == " " or check_present(field, data[file], check_present=get_present):
if mid_selector.value == " " or check_present(
field, data[file], check_present=get_present
):
# This file/field combo is present/missing, get all the id information
id_data = {}
for id_field in id_fields:
Expand All @@ -140,11 +144,13 @@ def build_csv_jscode(event):
'"', '\\"'
) # Escape newlines and double quotes

get_missing = missing_selector.value == 'Missing'
missing_text = 'missing' if get_missing else 'present'
get_missing = missing_selector.value == "Missing"
missing_text = "missing" if get_missing else "present"

if not mid_selector.value == " ":
filename = f"{top_selector.value}-{mid_selector.value}-{missing_text}.csv"
filename = (
f"{top_selector.value}-{mid_selector.value}-{missing_text}.csv"
)
else:
filename = f"{top_selector.value}-{missing_text}.csv"

Expand Down Expand Up @@ -231,7 +237,12 @@ def build_mid(selected):

# Left column (controls)
left_col = pn.Column(
header_pane, top_selector, mid_selector, missing_selector, download_button, width=400
header_pane,
top_selector,
mid_selector,
missing_selector,
download_button,
width=400,
)

mid_plot = pn.bind(build_mid, selected=top_selector)
Expand Down

0 comments on commit 960c94a

Please sign in to comment.