Skip to content

Commit

Permalink
[Fix] Remove empty namespace from plugins' builder (#1073)
Browse files Browse the repository at this point in the history
In principle, the plugin's workchain should validate whether an input namespace is empty or not, but not all developers are doing this. We assume all empty namespaces are not used, which is by default when submitting a builder in the aiida-core. Here, we simply remove the empty namespace.
  • Loading branch information
superstar54 authored Jan 10, 2025
1 parent d89548a commit 416fb6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/aiidalab_qe/workflows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def get_builder_from_protocol(
plugin_workchain = entry_point["workchain"]
if plugin_workchain.spec().has_input("clean_workdir"):
plugin_builder.clean_workdir = clean_workdir
setattr(builder, name, plugin_builder)
# some plugin's logic depend on whether a input exist or not, but not check if it is empty.
# here we remove the empty namespace for safety.
setattr(builder, name, plugin_builder._inputs(prune=True))
else:
builder.pop(name, None)

Expand Down

0 comments on commit 416fb6f

Please sign in to comment.