Skip to content

Commit

Permalink
input checking for range_sketch to align with windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbin973 committed Oct 13, 2024
1 parent 0ac88b8 commit a6fa8ab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/tskit/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -8653,11 +8653,12 @@ def pca(
assert individuals is not None
output_type = "individual"
dim = len(individuals)

if windows is None and range_sketch is not None:
raise ValueError("Windows should be given to supply range_sketch")

if range_sketch is not None:
assert range_sketch.shape == len(windows) - 1
if windows is not None:
assert range_sketch.shape[0] == len(windows) - 1
elif windows is None:
range_sketch = np.expand_dims(range_sketch, 0)

if num_components > dim:
raise ValueError(
Expand Down

0 comments on commit a6fa8ab

Please sign in to comment.