From b37ca775f912b37133e4b02d43832674a3793242 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Wed, 1 Jul 2026 08:27:13 -0700 Subject: [PATCH 1/3] make protocol mapping None by default --- src/gufe/protocols/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gufe/protocols/protocol.py b/src/gufe/protocols/protocol.py index 86c78c2b..7c687ae3 100644 --- a/src/gufe/protocols/protocol.py +++ b/src/gufe/protocols/protocol.py @@ -207,7 +207,7 @@ def create( *, stateA: ChemicalSystem, stateB: ChemicalSystem, - mapping: ComponentMapping | list[ComponentMapping] | dict[str, ComponentMapping] | None, + mapping: ComponentMapping | list[ComponentMapping] | dict[str, ComponentMapping] | None = None, extends: ProtocolDAGResult | None = None, name: str | None = None, transformation_key: GufeKey | None = None, @@ -300,7 +300,7 @@ def _validate( *, stateA: ChemicalSystem, stateB: ChemicalSystem, - mapping: ComponentMapping | list[ComponentMapping] | None, + mapping: ComponentMapping | list[ComponentMapping] | None = None, extends: ProtocolDAGResult | None = None, ): r"""Method to override in custom :class:`Protocol` subclasses. From 8f894aa19a8395b72f0ac9c0a5401b07aa40bacd Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Wed, 1 Jul 2026 08:32:21 -0700 Subject: [PATCH 2/3] update tests --- src/gufe/tests/test_protocol.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gufe/tests/test_protocol.py b/src/gufe/tests/test_protocol.py index 10de7485..48ec31b7 100644 --- a/src/gufe/tests/test_protocol.py +++ b/src/gufe/tests/test_protocol.py @@ -218,7 +218,6 @@ def protocol_dag(self, solvated_ligand, vacuum_ligand, tmp_path): stateA=solvated_ligand, stateB=vacuum_ligand, name="a dummy run", - mapping=None, ) shared = pathlib.Path(tmp_path / "shared") @@ -246,7 +245,6 @@ def protocol_dag_broken(self, solvated_ligand, vacuum_ligand, tmp_path): stateA=solvated_ligand, stateB=vacuum_ligand, name="a broken dummy run", - mapping=None, ) shared = pathlib.Path(tmp_path / "shared") shared.mkdir(parents=True) @@ -388,7 +386,6 @@ def test_dag_execute_failure_raise_error(self, solvated_ligand, vacuum_ligand, t stateA=solvated_ligand, stateB=vacuum_ligand, name="a broken dummy run", - mapping=None, ) shared = pathlib.Path(tmp_path / "shared") shared.mkdir(parents=True) @@ -575,7 +572,6 @@ def instance(self, vacuum_ligand, solvated_ligand): settings={}, stateA=vacuum_ligand, stateB=solvated_ligand, - mapping=None, start=None, some_dict={"a": 2, "b": 12}, ) @@ -645,7 +641,6 @@ def dag(self, protocol): return protocol.create( stateA=ChemicalSystem(components={"solvent": gufe.SolventComponent(positive_ion="Na")}), stateB=ChemicalSystem(components={"solvent": gufe.SolventComponent(positive_ion="Li")}), - mapping=None, ) def test_create(self, dag): @@ -801,7 +796,6 @@ def test_execute_DAG_retries(solvated_ligand, vacuum_ligand, tmp_path): dag = protocol.create( stateA=solvated_ligand, stateB=vacuum_ligand, - mapping=None, ) shared = pathlib.Path(tmp_path / "shared") @@ -837,7 +831,6 @@ def test_execute_DAG_bad_nretries(solvated_ligand, vacuum_ligand, tmp_path): dag = protocol.create( stateA=solvated_ligand, stateB=vacuum_ligand, - mapping=None, ) shared = pathlib.Path(tmp_path / "shared") From 408b5f699df8dde2e78ba53671cf63d324197ded Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Wed, 1 Jul 2026 11:14:42 -0700 Subject: [PATCH 3/3] add news item --- news/protocol_mapping_none.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/protocol_mapping_none.rst diff --git a/news/protocol_mapping_none.rst b/news/protocol_mapping_none.rst new file mode 100644 index 00000000..0de414da --- /dev/null +++ b/news/protocol_mapping_none.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Protocols no longer require ``mapping`` as an argument, by default ``mapping=None`` (`PR #809 `_). + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*