Skip to content

Commit

Permalink
Use list comparison in test (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpoznik authored Mar 20, 2024
1 parent e38066f commit 8b78235
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [2.1.9]

### Fixed
- `Node.hg_snp` values would drift upon repeated `Tree` instantiation
- `Node.hg_snp` values of SNP-less intermediate branches now stable upon repeated `Tree` instantiation

[2.1.9]: https://github.com/23andMe/yhaplo/compare/2.1.8..2.1.9

Expand Down
9 changes: 4 additions & 5 deletions tests/test_tree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import numpy as np

from yhaplo.config import Config
from yhaplo.tree import Tree
from yhaplo.utils.context_managers import logging_disabled
Expand All @@ -11,7 +9,8 @@ def test_hg_snp_idempotency():
tree_1 = Tree(config)
tree_2 = Tree(config)

hg_snps_1 = np.array([node.hg_snp for node in tree_1.depth_first_node_list])
hg_snps_2 = np.array([node.hg_snp for node in tree_2.depth_first_node_list])
assert extract_hg_snps(tree_1) == extract_hg_snps(tree_2)


assert (hg_snps_1 == hg_snps_2).all()
def extract_hg_snps(tree):
return [node.hg_snp for node in tree.depth_first_node_list]

0 comments on commit 8b78235

Please sign in to comment.