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:** + +* 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 e5c6ee0a2..06dcbaed0 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 f43383830..5b2069c0d 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):