Skip to content

Rename TSM primary and secondary to descendant and ancestor.#189

Merged
sebschmi merged 4 commits into
mainfrom
improve_tsalign_terminology
May 27, 2026
Merged

Rename TSM primary and secondary to descendant and ancestor.#189
sebschmi merged 4 commits into
mainfrom
improve_tsalign_terminology

Conversation

@sebschmi
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 07:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates terminology across the project by renaming Template Switch Model (TSM) “primary/secondary” to “descendant/ancestor”, and propagates that rename through configs, documentation, Rust crates, and Python bindings.

Changes:

  • Renames TSM-related types/fields/enums across lib_tsalign, lib_tsshow, and lib_ts_chainalign (e.g., TemplateSwitchPrimary/SecondaryTemplateSwitchDescendant/Ancestor, anti_primary_gapanti_descendant_gap).
  • Updates .tsa config keys and examples (ForwardAntiPrimaryGap/ReverseAntiPrimaryGapForwardAntiDescendantGap/ReverseAntiDescendantGap).
  • Updates README + Python bindings docs/types to reflect the new names and removes unused plain-text alignment stream code in lib_tsshow.

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test_files/config/small/config.tsa Renames anti-gap cost function keys to descendant terminology.
test_files/config/range/config.tsa Renames anti-gap cost function keys to descendant terminology.
test_files/config/no_intra_forward_jump/config.tsa Renames anti-gap cost function keys to descendant terminology.
test_files/config/experiments/config.tsa Renames anti-gap cost function keys to descendant terminology.
test_files/config/chainalignn/config.tsa Renames anti-gap cost function keys to descendant terminology.
test_files/config/chainalign/config.tsa Renames anti-gap cost function keys to descendant terminology.
test_files/config/bench/config.tsa Renames anti-gap cost function keys to descendant terminology.
sample_tsa_config/config.tsa Updates sample config to new anti-gap cost function key names.
README.md Updates documentation and example config snippet to new key names.
python_bindings/README.md Updates Python usage examples to new op field names.
python_bindings/python/tsalign/_types.py Renames parsed alignment op fields to descendant/ancestor and anti_descendant_gap.
lib_tsshow/src/ts_arrangement/template_switch.rs Renames TemplateSwitch struct fields to descendant/ancestor terminology.
lib_tsshow/src/ts_arrangement/source.rs Propagates descendant/ancestor rename through TS arrangement construction and helpers.
lib_tsshow/src/ts_arrangement/inner.rs Updates inner arrangement logic to use ancestor/descendant naming and accessors.
lib_tsshow/src/ts_arrangement/complement.rs Renames secondary-complement helpers to ancestor-complement.
lib_tsshow/src/ts_arrangement.rs Updates arrangement APIs and internal fields to ancestor terminology.
lib_tsshow/src/svg.rs Updates SVG rendering logic to use descendant/ancestor enums and fields.
lib_tsshow/src/plain_text/parse_template_switches.rs Updates TS parsing offsets/fields to ancestor/descendant names.
lib_tsshow/src/plain_text/alignment_stream.rs Removes now-unneeded local alignment stream implementation.
lib_tsshow/src/plain_text.rs Updates plain-text renderer to use new TS field names.
lib_tsshow/src/error.rs Renames SVG negative-gap error variant/message to anti-descendant terminology.
lib_tsalign/src/config/io.rs Updates config parser/printer to expect new anti-gap cost function keys.
lib_tsalign/src/config.rs Renames config fields and helpers to anti_descendant_gap_costs and descendant/ancestor enums.
lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/template_switch_min_length.rs Propagates renamed identifier fields (descendant/ancestor indices/types).
lib_tsalign/src/a_star_aligner/template_switch_distance/strategies/descendant.rs Updates descendant strategy trait to use the new descendant enum.
lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch.rs Updates lower-bound logic to use anti_descendant_gap and renamed config fields.
lib_tsalign/src/a_star_aligner/template_switch_distance/lower_bounds/template_switch_alignment.rs Updates generated lower-bound config to new anti-gap cost fields.
lib_tsalign/src/a_star_aligner/template_switch_distance/identifier.rs Renames core identifier enums/fields from primary/secondary to descendant/ancestor.
lib_tsalign/src/a_star_aligner/template_switch_distance/display.rs Updates display formatting for renamed TS fields (but still has old labels in places).
lib_tsalign/src/a_star_aligner/template_switch_distance/context.rs Propagates rename through successor generation and cost evaluation.
lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type.rs Renames alignment type fields (descendant/ancestor, anti_descendant_gap).
lib_tsalign/src/a_star_aligner/template_switch_distance.rs Propagates renamed identifiers/types into node generation.
lib_tsalign/src/a_star_aligner/alignment_result/alignment/template_switch_specifics.rs Updates TS-specific alignment manipulation to renamed fields.
lib_tsalign/src/a_star_aligner/alignment_result/alignment/stream.rs Updates alignment stream coordinate tracking to use descendant enum and anti-descendant gap.
lib_ts_chainalign/src/costs/compat.rs Updates chainalign compat mapping to new anti-descendant cost field.
lib_ts_chainalign/src/chain_align.rs Updates emitted tsalign alignment ops to new TS field names.
lib_ts_chainalign/src/alignment/ts_kind.rs Updates ts_kind conversions to new tsalign descendant/ancestor enums.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib_tsalign/src/a_star_aligner/template_switch_distance/display.rs Outdated
Comment thread lib_tsalign/src/a_star_aligner/template_switch_distance/display.rs
Comment thread lib_tsalign/src/config/io.rs
Comment thread python_bindings/python/tsalign/_types.py
sebschmi and others added 3 commits May 27, 2026 10:33
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sebschmi sebschmi enabled auto-merge May 27, 2026 07:37
@sebschmi sebschmi merged commit 729fe9a into main May 27, 2026
28 checks passed
@sebschmi sebschmi deleted the improve_tsalign_terminology branch May 27, 2026 07:39
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