diff --git a/src/aiidalab_qe/app/submission/global_settings/model.py b/src/aiidalab_qe/app/submission/global_settings/model.py index 4e36ac5ad..5ef16482e 100644 --- a/src/aiidalab_qe/app/submission/global_settings/model.py +++ b/src/aiidalab_qe/app/submission/global_settings/model.py @@ -93,6 +93,7 @@ def add_global_model( description=name, default_calc_job_plugin=default_calc_job_plugin, ) + base_code_model.activate() else: base_code_model = CodeModel( name=name, diff --git a/src/aiidalab_qe/app/submission/global_settings/setting.py b/src/aiidalab_qe/app/submission/global_settings/setting.py index 6db0fdeb6..b1c0bf8bc 100644 --- a/src/aiidalab_qe/app/submission/global_settings/setting.py +++ b/src/aiidalab_qe/app/submission/global_settings/setting.py @@ -56,7 +56,6 @@ def render(self): self.rendered = True # Render any active codes - self._model.get_model("quantumespresso.pw").activate() for _, code_model in self._model.get_models(): if code_model.is_active: self._toggle_code(code_model) diff --git a/src/aiidalab_qe/common/panel.py b/src/aiidalab_qe/common/panel.py index 223de660a..9cfa0541b 100644 --- a/src/aiidalab_qe/common/panel.py +++ b/src/aiidalab_qe/common/panel.py @@ -226,6 +226,7 @@ def get_model_state(self): "codes": { identifier: code_model.get_model_state() for identifier, code_model in self.get_models() + if code_model.is_ready }, } @@ -357,6 +358,10 @@ class PluginResourceSettingsModel(ResourceSettingsModel): override = tl.Bool(False) + def add_model(self, identifier, model: CodeModel): + super().add_model(identifier, model) + model.activate() + def update(self): """Updates the code models from the global resources. @@ -441,7 +446,8 @@ def render(self): # Render any active codes for _, code_model in self._model.get_models(): - self._toggle_code(code_model) + if code_model.is_active: + self._toggle_code(code_model) return self.code_widgets_container diff --git a/tests/test_submit_qe_workchain/test_create_builder_default.yml b/tests/test_submit_qe_workchain/test_create_builder_default.yml index 9652a7e6d..57be5a98f 100644 --- a/tests/test_submit_qe_workchain/test_create_builder_default.yml +++ b/tests/test_submit_qe_workchain/test_create_builder_default.yml @@ -59,13 +59,6 @@ codes: nodes: 1 ntasks_per_node: 2 parallelization: {} - quantumespresso.xspectra: - code: null - cpus: 1 - cpus_per_task: 1 - max_wallclock_seconds: 43200 - nodes: 1 - ntasks_per_node: 1 pdos: codes: dos: