Switch repeat id assignment from leg to repeat in AFE Protocols (#1948)

* switch uuid from leg to repeat

* Add news item

---------

Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>
This commit is contained in:
Irfan Alibay
2026-05-21 17:50:48 +01:00
committed by GitHub
parent cb10892e79
commit 53470827a4
5 changed files with 35 additions and 12 deletions

25
news/afe-uuid.rst Normal file
View File

@@ -0,0 +1,25 @@
**Added:**
* <news item>
**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:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* <news item>
**Security:**
* <news item>

View File

@@ -502,10 +502,9 @@ class AbsoluteBindingProtocol(gufe.Protocol):
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,

View File

@@ -466,10 +466,9 @@ class AbsoluteSolvationProtocol(gufe.Protocol):
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,

View File

@@ -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():

View File

@@ -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):