Skip to content

Commit

Permalink
fix: replace call to non-existent rng.randint with rng.integers or rn…
Browse files Browse the repository at this point in the history
…g.random
  • Loading branch information
rneher committed Mar 10, 2024
1 parent 624653a commit 99a3929
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions treetime/gtr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion treetime/treeanc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])


Expand Down

0 comments on commit 99a3929

Please sign in to comment.