Skip to content

Commit

Permalink
address CI testing failures #191
Browse files Browse the repository at this point in the history
  • Loading branch information
weikang9009 committed Sep 6, 2023
1 parent dad3f8a commit e799777
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions giddy/markov.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ class Spatial_Markov(object):
the second quintile, 0.204 (0.190) in the third, 0.0684 (0.255) in the
fourth and 0.029 (0.337) in the fifth quintile.
>>> sm.S
>>> sm.S.astype(float).round(8)
array([[0.43509425, 0.2635327 , 0.20363044, 0.06841983, 0.02932278],
[0.13391287, 0.33993305, 0.25153036, 0.23343016, 0.04119356],
[0.12124869, 0.21137444, 0.2635101 , 0.29013417, 0.1137326 ],
Expand All @@ -567,7 +567,7 @@ class Spatial_Markov(object):
fourth quintile after 28.473 years.
>>> for f in sm.F:
... print(f)
... print(f.round(8))
[[ 2.29835259 28.95614035 46.14285714 80.80952381 279.42857143]
[ 33.86549708 3.79459555 22.57142857 57.23809524 255.85714286]
[ 43.60233918 9.73684211 4.91085714 34.66666667 233.28571429]
Expand Down Expand Up @@ -1327,7 +1327,7 @@ class LISA_Markov(Markov):
>>> lm_random.significant_moves[0, :3]
array([11, 11, 11])
>>> lm_random.significant_moves[0,-3:]
array([59, 43, 27])
array([59, 59, 43])
Any value less than 49 indicates at least one of the LISA end points was
Expand Down
18 changes: 9 additions & 9 deletions giddy/rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __init__(self, y, regime, permutations=999):
n, k = y.shape
ranks_d = ranks[:, list(range(1, k))] - ranks[:, list(range(k - 1))]
self.ranks_d = ranks_d
regimes = sp.unique(regime)
regimes = np.unique(regime)
self.regimes = regimes
self.total = sum(abs(ranks_d))
self.max_total = sum([abs(i - n + i - 1) for i in range(1, n + 1)])
Expand Down Expand Up @@ -152,15 +152,15 @@ class Tau:
>>> x1 = [12, 2, 1, 12, 2]
>>> x2 = [1, 4, 7, 1, 0]
>>> kt = Tau(x1,x2)
>>> kt.tau
-0.47140452079103173
>>> kt.tau_p
0.24821309157521476
>>> print("%.5f" % kt.tau)
-0.47140
>>> print("%.5f" % kt.tau_p)
0.24821
>>> tau, p = kendalltau(x1,x2)
>>> tau
-0.4714045207910316
>>> p
0.2827454599327748
>>> print("%.5f" % tau)
-0.47140
>>> print("%.5f" % p)
0.28275
"""

Expand Down
3 changes: 2 additions & 1 deletion giddy/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ def __init__(self, y, subs_mat=None, dist_type=None, indel=None, cluster_type=No
"hamming distance cannot be calculated for "
"sequences of unequal lengths!"
)
hamming_dist = d.pdist(y_int, metric="hamming") * y_int.shape[1]

hamming_dist = d.pdist(y_int.astype(int), metric="hamming") * y_int.shape[1]
self.seq_dis_mat = d.squareform(hamming_dist)

elif dist_type.lower() == "arbitrary":
Expand Down

0 comments on commit e799777

Please sign in to comment.