From 0542daa5e9e06194999b39b27844ed8163187a6a Mon Sep 17 00:00:00 2001 From: Edan Bainglass <45081142+edan-bainglass@users.noreply.github.com> Date: Sat, 21 Dec 2024 08:19:23 +0100 Subject: [PATCH] Silence warning (#647) Recent developments in aiidalab-home of an external notebook to manage codes run into an issue with the AWB computational resources widgets when used without a default calcjob plugin. This PR silences a suspected false warning for now, to be properly investigated in a future PR. --- aiidalab_widgets_base/computational_resources.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aiidalab_widgets_base/computational_resources.py b/aiidalab_widgets_base/computational_resources.py index c52a2c6c..f88722bb 100644 --- a/aiidalab_widgets_base/computational_resources.py +++ b/aiidalab_widgets_base/computational_resources.py @@ -1302,6 +1302,13 @@ def _observe_code_setup(self, _=None): for key, value in self.code_setup.items(): if hasattr(self, key): if key == "default_calc_job_plugin": + if "None" in value: + # NOTE: Using this widget through the `_ResourceSetupBaseWidget` + # without an explicit `default_calc_job_plugin` causes `value` + # to be ".None", which is not a valid plugin name. + # HACK to avoid the warning message + # TODO see https://github.com/aiidalab/aiidalab-widgets-base/issues/648 + return try: self.default_calc_job_plugin.value = value except tl.TraitError: