Skip to content

Commit c843950

Browse files
committed
Update for numpy deprecations
1 parent f80e085 commit c843950

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

python/tests/test_combinatorics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# MIT License
33
#
4-
# Copyright (c) 2020-2022 Tskit Developers
4+
# Copyright (c) 2020-2023 Tskit Developers
55
#
66
# Permission is hereby granted, free of charge, to any person obtaining a copy
77
# of this software and associated documentation files (the "Software"), to deal
@@ -27,6 +27,7 @@
2727
import io
2828
import itertools
2929
import json
30+
import math
3031
import random
3132

3233
import msprime
@@ -1057,7 +1058,7 @@ def num_leaf_labelled_binary_trees(n):
10571058
10581059
https://oeis.org/A005373/
10591060
"""
1060-
return int(np.math.factorial(2 * n - 3) / (2 ** (n - 2) * np.math.factorial(n - 2)))
1061+
return int(math.factorial(2 * n - 3) / (2 ** (n - 2) * math.factorial(n - 2)))
10611062

10621063

10631064
class TestPolytomySplitting:

python/tests/test_tables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,13 +1603,13 @@ def test_bad_indexes(self, table):
16031603
table[[5.5]]
16041604
with pytest.raises(TypeError, match="Cannot convert"):
16051605
table[[None]]
1606-
with pytest.raises(TypeError, match="not supported between instances"):
1606+
with pytest.raises(TypeError, match="not supported|did not contain"):
16071607
table[["foobar"]]
16081608
with pytest.raises(TypeError, match="Index must be integer, slice or iterable"):
16091609
table[5.5]
16101610
with pytest.raises(TypeError, match="Cannot convert to a rectangular array"):
16111611
table[None]
1612-
with pytest.raises(TypeError, match="not supported between instances"):
1612+
with pytest.raises(TypeError, match="not supported|did not contain"):
16131613
table["foobar"]
16141614

16151615

0 commit comments

Comments
 (0)