Skip to content

IMP: add skbio.DistanceMatrix validation for LSMatFormat - #407

Merged
lizgehret merged 7 commits into
qiime2:devfrom
VinzentRisch:lsmat_distance
Oct 13, 2026
Merged

lizgehret merged 7 commits into
qiime2:devfrom
VinzentRisch:lsmat_distance

Conversation

@VinzentRisch

@VinzentRisch VinzentRisch commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Expands the validation of the LSMatFormat to the skbio.DistanceMatrix restrictions.
  • Matrix has to be square, numerical, with unique ids, symmetrical and 0 on the diagonal.
  • The LSMatFormat was always designed to be a skbio.DistanceMatrix as seen in the transformers but the validation did not enforce the symmetry and the 0 on the diagonal until now.
  • I added this better validation because I want to use the format for the PLSDA implementation.
  • Added transformers for LSMatFormat <-> pd.DataFrame

AI Disclosure

  • NO AI USED.
  • AI USED.

AI Usage Details

Codex

@VinzentRisch VinzentRisch changed the title IMP: better validation for LSMatFormat IMP: skbio.DistanceMatrix validation for LSMatFormat Sep 22, 2026
@VinzentRisch VinzentRisch changed the title IMP: skbio.DistanceMatrix validation for LSMatFormat IMP: add skbio.DistanceMatrix validation for LSMatFormat Sep 22, 2026
Comment thread q2_types/distance_matrix/tests/test_transformers.py Outdated
Comment thread q2_types/distance_matrix/_formats.py
Comment thread q2_types/distance_matrix/_formats.py
Comment thread q2_types/distance_matrix/tests/test_formats.py Outdated

@lizgehret lizgehret left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hey @VinzentRisch overall these changes look good! just few comments inline.

@lizgehret lizgehret assigned VinzentRisch and unassigned lizgehret Oct 6, 2026
@lizgehret

Copy link
Copy Markdown
Member

Hey @VinzentRisch these changes look great, thanks! I pushed some small lint/format updates (since you're ooo) but once CI passes this will be good to merge 🙂

@lizgehret
lizgehret merged commit b51081a into qiime2:dev Oct 13, 2026
6 checks passed
@lizgehret lizgehret removed their assignment Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants