From 99a3929eec5603fc05e2f0c58cf2254fde727592 Mon Sep 17 00:00:00 2001 From: Richard Neher Date: Sun, 10 Mar 2024 16:58:50 +0100 Subject: [PATCH] fix: replace call to non-existent rng.randint with rng.integers or rng.random --- treetime/gtr.py | 4 ++-- treetime/treeanc.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/treetime/gtr.py b/treetime/gtr.py index d3351c93..56dae2d5 100644 --- a/treetime/gtr.py +++ b/treetime/gtr.py @@ -476,8 +476,8 @@ def random(cls, mu=1.0, alphabet='nuc', rng=None): alphabet=alphabets[alphabet] gtr = cls(alphabet) n = gtr.alphabet.shape[0] - pi = 1.0*rng.randint(0,100,size=(n)) - W = 1.0*rng.randint(0,100,size=(n,n)) # with gaps + pi = 1.0*rng.random(size=n) + W = 1.0*rng.random(size=(n,n)) # with gaps gtr.assign_rates(mu=mu, pi=pi, W=W) return gtr diff --git a/treetime/treeanc.py b/treetime/treeanc.py index ebf7ac74..5d641f8e 100644 --- a/treetime/treeanc.py +++ b/treetime/treeanc.py @@ -572,7 +572,7 @@ def _fitch_anc(self, **kwargs): "in the position %d: %s, " "choosing %s" % (amb, str(self.tree.root.state[amb]), self.tree.root.state[amb][0]), 4) - self.tree.root._cseq = np.array([k[self.rng.randint(len(k)) if len(k)>1 else 0] + self.tree.root._cseq = np.array([k[self.rng.integers(len(k)) if len(k)>1 else 0] for k in self.tree.root.state])