AdamGohain commited on
Commit
2204ccd
·
verified ·
1 Parent(s): 4a49215

Fix dropdown values in Marimo app

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -133,18 +133,14 @@ def _():
133
  @app.cell
134
  def _(RUN_LABELS, RUN_ORDER, mo):
135
  run_select = mo.ui.dropdown(
136
- options={RUN_LABELS[key]: key for key in RUN_ORDER},
137
- value="joint_three_modality",
138
  label="Training data",
139
  full_width=True,
140
  )
141
  domain_select = mo.ui.dropdown(
142
- options={
143
- "MANC FIB-SEM": "flyem_fibsem",
144
- "FAFB ssTEM": "fafb_sstem",
145
- "FlyLICONN": "flyliconn",
146
- },
147
- value="flyem_fibsem",
148
  label="Validation modality focus",
149
  full_width=True,
150
  )
@@ -153,7 +149,8 @@ def _(RUN_LABELS, RUN_ORDER, mo):
153
 
154
  @app.cell
155
  def _(RUN_LABELS, RUN_ORDER, domain_select, mo, run_select):
156
- current = run_select.value
 
157
  idx = RUN_ORDER.index(current)
158
  prev_label = RUN_LABELS[RUN_ORDER[idx - 1]] if idx > 0 else "start"
159
  next_label = RUN_LABELS[RUN_ORDER[idx + 1]] if idx < len(RUN_ORDER) - 1 else "end"
 
133
  @app.cell
134
  def _(RUN_LABELS, RUN_ORDER, mo):
135
  run_select = mo.ui.dropdown(
136
+ options=[RUN_LABELS[key] for key in RUN_ORDER],
137
+ value=RUN_LABELS["joint_three_modality"],
138
  label="Training data",
139
  full_width=True,
140
  )
141
  domain_select = mo.ui.dropdown(
142
+ options=["MANC FIB-SEM", "FAFB ssTEM", "FlyLICONN"],
143
+ value="MANC FIB-SEM",
 
 
 
 
144
  label="Validation modality focus",
145
  full_width=True,
146
  )
 
149
 
150
  @app.cell
151
  def _(RUN_LABELS, RUN_ORDER, domain_select, mo, run_select):
152
+ label_to_run = {RUN_LABELS[key]: key for key in RUN_ORDER}
153
+ current = label_to_run[run_select.value]
154
  idx = RUN_ORDER.index(current)
155
  prev_label = RUN_LABELS[RUN_ORDER[idx - 1]] if idx > 0 else "start"
156
  next_label = RUN_LABELS[RUN_ORDER[idx + 1]] if idx < len(RUN_ORDER) - 1 else "end"