Skip to content

Commit

Permalink
Avoid deprecation warnings
Browse files Browse the repository at this point in the history
Curewntly getting "FutureWarning: This property is a deprecated alias for Tree.tree_sequence.num_nodes and will be removed in the future"
  • Loading branch information
hyanwong authored and mergify[bot] committed Jan 7, 2023
1 parent 816e4aa commit cba6922
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions python/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License
#
# Copyright (c) 2018-2022 Tskit Developers
# Copyright (c) 2018-2023 Tskit Developers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(self, num_nodes):

@classmethod
def from_tree(cls, tree):
ret = PythonTree(tree.num_nodes)
ret = PythonTree(tree.tree_sequence.num_nodes)
ret.left, ret.right = tree.get_interval()
ret.site_list = list(tree.sites())
ret.index = tree.get_index()
Expand Down
6 changes: 3 additions & 3 deletions python/tests/test_genotype_matching_fb.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def stupid_compress_dict(self):
# Retain the old T_index, because the internal T that's passed up the tree will
# retain this ordering.
old_T_index = copy.deepcopy(self.T_index)
self.T_index = np.zeros(tree.num_nodes, dtype=int) - 1
self.N = np.zeros(tree.num_nodes, dtype=int)
self.T_index = np.zeros(tree.tree_sequence.num_nodes, dtype=int) - 1
self.N = np.zeros(tree.tree_sequence.num_nodes, dtype=int)
self.T.clear()

# First, create T root.
Expand Down Expand Up @@ -345,7 +345,7 @@ def update_tree(self):
vt.tree_node = -1
vt.value_index = -1

self.N = np.zeros(self.tree.num_nodes, dtype=int)
self.N = np.zeros(self.tree.tree_sequence.num_nodes, dtype=int)
node_map = {st.tree_node: st for st in self.T}

for u in self.tree.samples():
Expand Down

0 comments on commit cba6922

Please sign in to comment.