Skip to content

Fix templateIndices serialization crash for empty query_to_template_map#692

Closed
mooreneural wants to merge 1 commit into
google-deepmind:mainfrom
mooreneural:fix-template-indices-serialization
Closed

Fix templateIndices serialization crash for empty query_to_template_map#692
mooreneural wants to merge 1 commit into
google-deepmind:mainfrom
mooreneural:fix-template-indices-serialization

Conversation

@mooreneural

Copy link
Copy Markdown

When a ProteinChain template has an empty query_to_template_map,
list(values) or None serializes templateIndices as null. On
deserialization, from_dict calls zip(queryIndices, None) which raises:

TypeError: zip argument #2 must support iteration

Fix: remove or None so an empty map serializes as [], consistent with
how queryIndices is already written on the line above.

Files changed

  • src/alphafold3/common/folding_input.py -- 1 line removed

When query_to_template_map is empty, `list(values) or None` serializes
templateIndices as null. On deserialization, from_dict calls
zip(queryIndices, None) which raises TypeError: 'NoneType' is not iterable.

Fix: remove `or None` so an empty map serializes as [], consistent with
how queryIndices is already written.
Augustin-Zidek added a commit that referenced this pull request Jul 9, 2026
From #692.

PiperOrigin-RevId: 945022442
Change-Id: Idbebdf27f9eb16a8231b6fa128717a92a0d09964
@Augustin-Zidek

Copy link
Copy Markdown
Collaborator

Fixed in 62136ec. Thanks!

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.

2 participants