Skip to content

acedrg_tables: extract insert_bond_row / insert_angle_row - #438

Open
pemsley wants to merge 1 commit into
project-gemmi:masterfrom
pemsley:gemmi-acedrg-insert-row-pr
Open

acedrg_tables: extract insert_bond_row / insert_angle_row#438
pemsley wants to merge 1 commit into
project-gemmi:masterfrom
pemsley:gemmi-acedrg-insert-row-pr

Conversation

@pemsley

@pemsley pemsley commented Aug 24, 2026

Copy link
Copy Markdown

Extract the inline per-row index-insertion logic from load_bond_tables() and load_angle_tables() into two public methods, insert_bond_row() and insert_angle_row(), and point the loaders at them.

This deduplicates the key construction and gives external code a way to populate the bond/angle index containers row by row (e.g. an on-demand backend feeding fill_restraints without bulk-loading the whole table set). The scratch key buffers are passed in by the caller and reused across rows, avoiding per-row allocations that the old inline code made.

Behaviour-preserving: gemmi drg output is byte-identical before and after - tested against a handful of monomers.

Extract the inline per-row index-insertion logic from load_bond_tables()
and load_angle_tables() into two public methods, insert_bond_row() and
insert_angle_row(), and point the loaders at them.

This deduplicates the key construction and gives external code a way to
populate the bond/angle index containers row by row (e.g. an on-demand
backend feeding fill_restraints without bulk-loading the whole table
set). The scratch key buffers are passed in by the caller and reused
across rows, avoiding per-row allocations that the old inline code made.

Behaviour-preserving: gemmi drg output is byte-identical before and
after for ALA, ASN, ATP, CQ8, GLC, NAG, PLP and STI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant