Skip to content

docs: clarify that memories arg is intentionally unused in swapping set_others (refs #170)#391

Open
rayair250-droid wants to merge 1 commit into
sequence-toolbox:masterfrom
rayair250-droid:docs/clarify-swapping-set-others-memories
Open

docs: clarify that memories arg is intentionally unused in swapping set_others (refs #170)#391
rayair250-droid wants to merge 1 commit into
sequence-toolbox:masterfrom
rayair250-droid:docs/clarify-swapping-set-others-memories

Conversation

@rayair250-droid

Copy link
Copy Markdown

Follow-up to #170.

EntanglementSwappingA.set_others (and, as noted in #170's thread, EntanglementSwappingB.set_others) accept a memories argument that they never use — the swapping protocols key off the left_memo/right_memo they already hold.

The argument cannot simply be removed, though: set_others(remote_protocol, remote_node, memories) is the shared EntanglementProtocol interface, called positionally by ResourceManager (resource_manager.py:410 and :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 a TypeError when the manager pairs a swapping protocol.

This PR just adds a short clarifying comment in both swapping set_others overrides explaining the argument is intentionally unused there and kept for interface consistency. No behavior change.

@hayekr

hayekr commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

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 subject: title

Valid subjects are: feat, fix, docs, test, ci, refactor, perf, chore, revert

@rayair250-droid rayair250-droid changed the title Document that memories arg is intentionally unused in swapping set_others (refs #170) docs: clarify that memories arg is intentionally unused in swapping set_others (refs #170) Jul 2, 2026
@rayair250-droid

Copy link
Copy Markdown
Author

Thanks @hayekr — I've updated the title to docs: clarify that memories arg is intentionally unused in swapping set_others (refs #170), so it should satisfy the conventional-commits check now. Appreciate the review!

…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.
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the comments into the set_others docstring. Also, please shorten the comments. Thanks!

@caitaozhan caitaozhan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, please fix my comment.

@hayekr

hayekr commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Hello @rayair250-droid, can you please complete the changes so we can get this merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants