From a68217f079f23fd05a880a70cd612b17c4aaa99c Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sat, 18 Apr 2026 21:11:07 +0100 Subject: [PATCH 1/2] switch uuid from leg to repeat --- .../protocols/openmm_afe/equil_binding_afe_method.py | 7 +++---- .../protocols/openmm_afe/equil_solvation_afe_method.py | 7 +++---- .../tests/protocols/openmm_abfe/test_abfe_protocol.py | 4 ++-- .../tests/protocols/openmm_ahfe/test_ahfe_protocol.py | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/openfe/protocols/openmm_afe/equil_binding_afe_method.py b/src/openfe/protocols/openmm_afe/equil_binding_afe_method.py index 4a5c18f94..4b8978c35 100644 --- a/src/openfe/protocols/openmm_afe/equil_binding_afe_method.py +++ b/src/openfe/protocols/openmm_afe/equil_binding_afe_method.py @@ -502,10 +502,9 @@ def _create( protocol_units: dict[str, list[gufe.ProtocolUnit]] = {"solvent": [], "complex": []} - for phase in ["solvent", "complex"]: - for i in range(self.settings.protocol_repeats): - repeat_id = int(uuid.uuid4()) - + for i in range(self.settings.protocol_repeats): + repeat_id = int(uuid.uuid4()) + for phase in ["solvent", "complex"]: setup = unit_classes[phase]["setup"]( protocol=self, stateA=stateA, diff --git a/src/openfe/protocols/openmm_afe/equil_solvation_afe_method.py b/src/openfe/protocols/openmm_afe/equil_solvation_afe_method.py index 6e879a4a4..d1b143ee9 100644 --- a/src/openfe/protocols/openmm_afe/equil_solvation_afe_method.py +++ b/src/openfe/protocols/openmm_afe/equil_solvation_afe_method.py @@ -466,10 +466,9 @@ def _create( protocol_units: dict[str, list[gufe.ProtocolUnit]] = {"solvent": [], "vacuum": []} - for phase in ["solvent", "vacuum"]: - for i in range(self.settings.protocol_repeats): - repeat_id = int(uuid.uuid4()) - + for i in range(self.settings.protocol_repeats): + repeat_id = int(uuid.uuid4()) + for phase in ["solvent", "vacuum"]: setup = unit_classes[phase]["setup"]( protocol=self, stateA=stateA, diff --git a/src/openfe/tests/protocols/openmm_abfe/test_abfe_protocol.py b/src/openfe/tests/protocols/openmm_abfe/test_abfe_protocol.py index ee69720d2..6ba27ca2b 100644 --- a/src/openfe/tests/protocols/openmm_abfe/test_abfe_protocol.py +++ b/src/openfe/tests/protocols/openmm_abfe/test_abfe_protocol.py @@ -158,8 +158,8 @@ def test_create_independent_repeat_ids(benzene_modifications, T4_protein_compone for u in dag.protocol_units: repeat_ids.add(u.inputs["repeat_id"]) - # squashed by repeat_id, that's 2 sets of 6 - assert len(repeat_ids) == 12 + # squashed by repeat_id, that's 1 uuid per repeat + assert len(repeat_ids) == 6 def test_mda_universe_error(): diff --git a/src/openfe/tests/protocols/openmm_ahfe/test_ahfe_protocol.py b/src/openfe/tests/protocols/openmm_ahfe/test_ahfe_protocol.py index 0d2c27adc..a5193a530 100644 --- a/src/openfe/tests/protocols/openmm_ahfe/test_ahfe_protocol.py +++ b/src/openfe/tests/protocols/openmm_ahfe/test_ahfe_protocol.py @@ -142,8 +142,8 @@ def test_create_independent_repeat_ids(benzene_system): for u in dag.protocol_units: repeat_ids.add(u.inputs["repeat_id"]) - # squashed by repeat_id, that's 2 sets of 6 - assert len(repeat_ids) == 12 + # squashed by repeat_id, that's 1 uuid by repeat + assert len(repeat_ids) == 6 def _assert_num_forces(system, forcetype, number): From 6b2395119562467abedbaada4ddf0b066d8030a0 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Mon, 20 Apr 2026 09:24:55 +0100 Subject: [PATCH 2/2] Add news item --- news/afe-uuid.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 news/afe-uuid.rst diff --git a/news/afe-uuid.rst b/news/afe-uuid.rst new file mode 100644 index 000000000..976d8a6e6 --- /dev/null +++ b/news/afe-uuid.rst @@ -0,0 +1,25 @@ +**Added:** + +* + +**Changed:** + +* AFE Protocols (AbsoluteBindingProtocol and AbsoluteSolvationProtocol) + now assign a single uuid for all ProtocolUnits in a repeat rather than + separating the uuid by legs of the transformation. PR #1948 + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*