Skip to content

remove SLiM metadata; closes #2534 - #2535

Merged
jeromekelleher merged 1 commit into
tskit-dev:mainfrom
petrelharp:slim_muts
Aug 12, 2026
Merged

remove SLiM metadata; closes #2534#2535
jeromekelleher merged 1 commit into
tskit-dev:mainfrom
petrelharp:slim_muts

Conversation

@petrelharp

Copy link
Copy Markdown
Contributor

This just rips out all metadata stuff from the SLiMMutationModel. We should not merge this until SLiM v6 is released.

Potential breakage: if someone runs

msprime.SLiMMutationModel(type=1, next_id=1, slim_generation=10)

then they get a warning saying that type and slim_generation will be ignored.
If someone runs

msprime.SLiMMutationModel(1, 1, 10)

or

msprime.SLiMMutationModel(1, 10)

then they get a TypeError because the only valid positional argument is the first one.
The latter is necessary to exclude because previously if someone ran this they'd get a model with type 1 and next ID 10; now (if both arguments were positional) they'd get a model with next ID 1 and block_size 10.

One possible problem: previously, the only required argument was mutation type, and it was the first argument. So, if someone ran

msprime.SLiMMutationModel(k)

then they would get a model with mutation type k and next ID 0. Now, they would get a model with next ID k. This will cause no practical problems - both "mutation type" and "next ID" have to be a nonnegative integers, and so this just means msprime will not simulate mutations with SLiM ID 0, ..., k-1 when you might have thought it would.

The alternative to this PR would be to just leave everything alone: msprime puts in unneeded metadata, and we can just safely ignore it downstream. But, this is confusing.

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.84%. Comparing base (79dfc96) to head (aad986c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2535   +/-   ##
=======================================
  Coverage   93.83%   93.84%           
=======================================
  Files          20       20           
  Lines       12106    12060   -46     
  Branches     2243     2242    -1     
=======================================
- Hits        11360    11318   -42     
+ Misses        567      564    -3     
+ Partials      179      178    -1     
Flag Coverage Δ
C 84.07% <100.00%> (-0.04%) ⬇️
c-python 73.11% <100.00%> (+0.21%) ⬆️
python-tests 98.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Python API 98.61% <100.00%> (+<0.01%) ⬆️
Python C interface 92.84% <100.00%> (-0.02%) ⬇️
C library 91.05% <100.00%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petrelharp
petrelharp requested a review from nspope August 7, 2026 18:33

@jeromekelleher jeromekelleher 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.

LGTM, spotted on trivial thing.

Did we not set a metadata schema for the slim mutation metadata?

I don't think we need to wait until SLiM 6 is released to merge, but we shouldn't release msprime until it is, though.

Might be worth noting that this also means that these mutations won't work with SLiM < 6 now (this isn't obvious from the CHANGELOG).

Comment thread tests/test_mutations.py Outdated
assert t1.sites == t2.sites
# Drop the mutation metadata - we're validating that elsewhere and
# it's not worth complicating the Python generator with it.
t1.mutations.set_columns(

@jeromekelleher jeromekelleher Aug 11, 2026

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.

This set_columns is redundant now, right?

@petrelharp

Copy link
Copy Markdown
Contributor Author

Did we not set a metadata schema for the slim mutation metadata?

Huh, yeah, I guess not.

Comment thread CHANGELOG.md
@petrelharp

Copy link
Copy Markdown
Contributor Author

This should be ready now!

@jeromekelleher
jeromekelleher added this pull request to the merge queue Aug 12, 2026
Merged via the queue into tskit-dev:main with commit 3fd297a Aug 12, 2026
13 checks passed
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