docs: clarify that memories arg is intentionally unused in swapping set_others (refs #170)#391
Conversation
|
Hello, thank you for your contribution. While we review your changes please fix the title of the PR to comply with conventional commits, the format is Valid subjects are: feat, fix, docs, test, ci, refactor, perf, chore, revert |
|
Thanks @hayekr — I've updated the title to |
…hers The memories parameter in EntanglementSwappingA/B.set_others is part of the shared EntanglementProtocol.set_others() interface (called positionally by ResourceManager, and used by the generation protocols), so it cannot be removed without breaking that interface. Add a short comment in both swapping overrides clarifying it is intentionally unused there. Refs sequence-toolbox#170.
43fecce to
7b9af35
Compare
| node (str): other node name. | ||
| memories (list[str]): the list of memories name used on other node. | ||
| """ | ||
| # `memories` is intentionally unused here: the swapping protocol keys off the |
There was a problem hiding this comment.
Please move the comments into the set_others docstring. Also, please shorten the comments. Thanks!
caitaozhan
left a comment
There was a problem hiding this comment.
Thanks, please fix my comment.
|
Hello @rayair250-droid, can you please complete the changes so we can get this merged. Thank you! |
Follow-up to #170.
EntanglementSwappingA.set_others(and, as noted in #170's thread,EntanglementSwappingB.set_others) accept amemoriesargument that they never use — the swapping protocols key off theleft_memo/right_memothey already hold.The argument cannot simply be removed, though:
set_others(remote_protocol, remote_node, memories)is the sharedEntanglementProtocolinterface, called positionally byResourceManager(resource_manager.py:410and:439) on any protocol instance, and the generation protocols do use it (self.remote_memo_id = memories[0]). Dropping it from the swapping overrides would raise aTypeErrorwhen the manager pairs a swapping protocol.This PR just adds a short clarifying comment in both swapping
set_othersoverrides explaining the argument is intentionally unused there and kept for interface consistency. No behavior change.