Skip to content

Commit

Permalink
Remove redundant error_message state inits
Browse files Browse the repository at this point in the history
  • Loading branch information
proy30 committed Jan 7, 2025
1 parent 7550126 commit 163b3c6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# -----------------------------------------------------------------------------

state.csr_bins = generalFunctions.get_default("csr_bins", "default_values")
state.csr_bins_error_message = ""

# -----------------------------------------------------------------------------
#
Expand All @@ -20,8 +19,9 @@

@state.change("csr_bins")
def on_csr_bins_change(csr_bins, **kwargs):
error_message = generalFunctions.validate_against(csr_bins, "int", ["positive"])
state.csr_bins_error_message = error_message
state.csr_bins_error_message = generalFunctions.validate_against(
csr_bins, "int", ["positive"]
)
generalFunctions.update_simulation_validation_status()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ def __init__(self):
state.charge_qe = generalFunctions.get_default("charge_qe", "default_values")
state.mass_MeV = generalFunctions.get_default("mass_MeV", "default_values")

state.npart_error_message = []
state.kin_energy_error_message = []
state.bunch_charge_C_error_message = []
state.mass_MeV_error_message = []
state.charge_qe_error_message = []

def card(self):
"""
Creates UI content for beam properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
state.selectedLattice = generalFunctions.get_default("lattice", "default_values")
state.selectedLatticeList = []
state.nslice = generalFunctions.get_default("n_slice", "default_values")
state.nslice_error_message = ""
state.lattice_configuration_dialog_settings = False

# -----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
state.mlmg_max_iters = generalFunctions.get_default("mlmg_max_iters", "default_values")
state.mlmg_verbosity = generalFunctions.get_default("mlmg_verbosity", "default_values")

state.mlmg_relative_tolerance_error_message = ""
state.mlmg_absolute_tolerance_error_message = ""
state.mlmg_max_iters_error_message = ""
state.mlmg_verbosity_error_message = ""
state.space_charge_dialog_settings = False
# -----------------------------------------------------------------------------
# Helper functions
Expand Down
2 changes: 1 addition & 1 deletion src/python/impactx/dashboard/Input/trameFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def text_field(label, v_model_name, **kwargs):
vuetify.VTextField(
label=label,
v_model=(f"{v_model_name}",),
error_messages=(f"{v_model_name}_error_message",),
error_messages=(f"{v_model_name}_error_message", []),
type="number",
step=generalFunctions.get_default(f"{v_model_name}", "steps"),
suffix=generalFunctions.get_default(f"{v_model_name}", "units"),
Expand Down

0 comments on commit 163b3c6

Please sign in to comment.