From 463bfbd1c8ccf62b750cd190aef367db297b10b5 Mon Sep 17 00:00:00 2001 From: Edward Linscott Date: Thu, 23 Jul 2026 15:44:45 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20`PdosWorkChain`:=20thread=20`set?= =?UTF-8?q?tings`=20overrides=20to=20dos/projwfc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `get_builder_from_protocol` method populated the `code`, `parameters` and `metadata` inputs of the `dos` and `projwfc` namespaces, but never the `settings` input. As a result, a `settings` override (for example `{'projwfc': {'settings': {'CMDLINE': ['-npool', '4']}}}`) was silently dropped and never reached the builder. Set `builder.dos.settings` and `builder.projwfc.settings` from the merged protocol inputs when a `settings` override is provided. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01LGsT8YPFW5jT93FPWojAYf --- src/aiida_quantumespresso/workflows/pdos.py | 4 ++++ tests/workflows/protocols/test_pdos.py | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/aiida_quantumespresso/workflows/pdos.py b/src/aiida_quantumespresso/workflows/pdos.py index 53df67422..41c8be9ff 100644 --- a/src/aiida_quantumespresso/workflows/pdos.py +++ b/src/aiida_quantumespresso/workflows/pdos.py @@ -383,9 +383,13 @@ def get_builder_from_protocol( builder.dos.code = dos_code builder.dos.parameters = orm.Dict(inputs.get('dos', {}).get('parameters')) builder.dos.metadata = metadata_dos + if inputs.get('dos', {}).get('settings'): + builder.dos.settings = orm.Dict(inputs['dos']['settings']) builder.projwfc.code = projwfc_code builder.projwfc.parameters = orm.Dict(inputs.get('projwfc', {}).get('parameters')) builder.projwfc.metadata = metadata_projwfc + if inputs.get('projwfc', {}).get('settings'): + builder.projwfc.settings = orm.Dict(inputs['projwfc']['settings']) return builder diff --git a/tests/workflows/protocols/test_pdos.py b/tests/workflows/protocols/test_pdos.py index 7294e5a76..fb5c8ebf0 100644 --- a/tests/workflows/protocols/test_pdos.py +++ b/tests/workflows/protocols/test_pdos.py @@ -90,3 +90,15 @@ def test_options(get_pdos_generator_inputs): builder.projwfc.metadata, ): assert subspace['options']['queue_name'] == queue_name, subspace + + +def test_settings_overrides(get_pdos_generator_inputs): + """Test that ``settings`` overrides are threaded onto the ``dos`` and ``projwfc`` namespaces.""" + overrides = { + 'dos': {'settings': {'CMDLINE': ['-npool', '4']}}, + 'projwfc': {'settings': {'CMDLINE': ['-npool', '4']}}, + } + builder = PdosWorkChain.get_builder_from_protocol(**get_pdos_generator_inputs, overrides=overrides) + + assert builder.dos.settings.get_dict() == {'CMDLINE': ['-npool', '4']} + assert builder.projwfc.settings.get_dict() == {'CMDLINE': ['-npool', '4']}