Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if sgkit sample data is unphased #784

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

benjeffery
Copy link
Member

Fixes #772

This is doing unnecessary checks as not all sites may be used - but this is the simplest approach. If we think there are common use cases where used are only using a subset of sites and the rest are unphased, then could consider only checking used sites.

@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #784 (5f147b0) into main (5f147b0) will not change coverage.
The diff coverage is n/a.

❗ Current head 5f147b0 differs from pull request most recent head a7543b9. Consider uploading reports for the commit a7543b9 to get more accurate results

@@           Coverage Diff           @@
##             main     #784   +/-   ##
=======================================
  Coverage   93.32%   93.32%           
=======================================
  Files          17       17           
  Lines        5571     5571           
  Branches      990      990           
=======================================
  Hits         5199     5199           
  Misses        246      246           
  Partials      126      126           
Flag Coverage Δ
C 93.32% <0.00%> (ø)
python 96.33% <0.00%> (ø)

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

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

LGTM - I guess pulling in just dask is sensible since we're already doing a bunch of behind the scenes stuff as far as sgkit is concerned.

@@ -48,3 +50,42 @@ def test_sgkit_dataset(tmp_path):
samples = tsinfer.SgkitSampleData(tmp_path / "data.zarr")
inf_ts = tsinfer.infer(samples)
assert np.array_equal(ts.genotype_matrix(), inf_ts.genotype_matrix())


def test_sgkit_unphased(tmp_path):
Copy link
Member

Choose a reason for hiding this comment

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

This looks like four tests. Also you wouldnt' need to rmtree by doing this.

@benjeffery benjeffery marked this pull request as ready for review December 19, 2022 12:55
@benjeffery
Copy link
Member Author

@jeromekelleher Review changes made - should be good to go.

@benjeffery
Copy link
Member Author

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Jan 16, 2023

rebase

✅ Branch has been successfully rebased

@mergify mergify bot merged commit 32aa201 into tskit-dev:main Jan 16, 2023
@benjeffery benjeffery deleted the unphased-error branch January 16, 2023 13:05
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.

sgkit: Error/Warning on unphased data when ploidy > 1.
2 participants