Skip to content

Fix CI: constrain baltic<1 and replace pl.count() with pl.len() - #73

Merged
briney merged 2 commits into
masterfrom
fix/baltic-1-compat
Nov 5, 2026
Merged

briney merged 2 commits into
masterfrom
fix/baltic-1-compat

Conversation

@briney

@briney briney commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Problem

abutils master last passed CI in April. Since then, two dependency releases have broken it:

  • baltic 1.0.0 renamed its API: loadNewick became load_newick, and leaf, node and tree are now modules instead of classes.
  • Recent polars raises TypeError for pl.count() without an argument. This breaks _deduplicate_sequences and pooled deduplicate(..., keep_read_numbers=True), and fails test_deduplicate_sequences on every Python version.

Fix

  • Constrain baltic<1 in requirements.txt. Porting to the 1.0 API is a separate piece of work.
  • Add test_phylogeny_tree_loads_newick, which builds the baltic tree from a Newick string and checks its leaves.
  • Replace both pl.count().alias("count") calls in tools/preprocessing.py with pl.len().alias("count"). pl.len() exists in every polars the requirements allow (>=1.6).

Verification

  • test_phylogeny_tree_loads_newick fails under baltic 1.0.0 with the loadNewick AttributeError and passes under baltic 0.3.0.
  • test_deduplicate_sequences fails with the pl.count() TypeError before the change and passes after.
  • The pooled deduplicate path (line 1033) has no test, so I checked it by hand against polars 1.44.1: it writes one record per unique sequence.
  • Full suite on Python 3.10: 255 passed with the newest polars, and 255 passed with polars 1.6.0.

Found but not changed

  • deduplicate drops every input file whose path contains "tmp" (if "tmp" not in f). Run on a project under /tmp, it finds no files and fails with cannot concat empty list.
  • The pooled read number counts how many samples contain a sequence, not how many reads. For example, a sequence seen in 2 reads of s1 and 1 read of s2 is written as |2. This behavior is unchanged by this PR.

Shipping this needs a patch release (0.6.1). After that, abstar can drop its temporary baltic<1 constraint.

🤖 Generated with Claude Code

briney and others added 2 commits November 5, 2026 09:43
baltic 1.0 renamed its API: loadNewick is now load_newick, and leaf,
node and tree are modules rather than classes. Under baltic 1.0,
`import abutils` fails on Python 3.10 (a module inside typing.Union
annotations), and Phylogeny.tree fails on every Python version. The
existing phylo tests never built the baltic tree, so CI stayed green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recent polars releases raise TypeError for pl.count() without an
argument. pl.len() is available in every polars the requirements allow
(>=1.6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@briney briney changed the title Constrain baltic<1 (baltic 1.0 breaks import on 3.10 and Phylogeny.tree) Fix CI: constrain baltic<1 and replace pl.count() with pl.len() Nov 5, 2026
@briney
briney merged commit 8122a30 into master Nov 5, 2026
8 checks passed
@briney
briney deleted the fix/baltic-1-compat branch November 5, 2026 18:25
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.

1 participant