Skip to content

Commit

Permalink
include csr to shared state
Browse files Browse the repository at this point in the history
can't include others (distribution parameters/lattice config/space charge because either their states are nested by dictionary use or they use different validation errors. In the future, it would be good to have a single validation function than multiple separate ones.
  • Loading branch information
proy30 committed Feb 10, 2025
1 parent f28ab29 commit e3b5caf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ def card():
with vuetify.VCol(classes="py-0"):
InputComponents.text_field(
label="CSR Bins",
input=(ctrl.input_change, "['csr_bins']"),
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
# -----------------------------------------------------------------------------


DEFAULTS = list(DashboardDefaults.INPUT_PARAMETERS.keys())
input_parameters_defaults = list(DashboardDefaults.INPUT_PARAMETERS.keys())
space_charge_defaults = list(DashboardDefaults.CSR.keys())
INPUT_DEFAULTS = input_parameters_defaults + space_charge_defaults


@state.change(*DEFAULTS)
@state.change(*INPUT_DEFAULTS)
def on_input_state_change(**_):
state_changes = state.modified_keys & set(DEFAULTS)
state_changes = state.modified_keys & set(INPUT_DEFAULTS)
for state_name in state_changes:
if type(state[state_name]) is str:
print(
Expand Down

0 comments on commit e3b5caf

Please sign in to comment.