Skip to content

Commit

Permalink
resolve #229
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Jul 15, 2024
1 parent a67525a commit fb33b0e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion giddy/directional.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def plot_origin(self): # TODO add attribute option to color vectors

xlim = [self._dx.min(), self._dx.max()]
ylim = [self._dy.min(), self._dy.max()]
for x, y in zip(self._dx, self._dy):
for x, y in zip(self._dx, self._dy, strict=False):
xs = [0, x]
ys = [0, y]
plt.plot(xs, ys, "-b") # TODO change this to scale with attribute
Expand Down
2 changes: 1 addition & 1 deletion giddy/markov.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ def __init__(
self.classes = classes
self.k = len(classes)
self.m = self.k
label_dict = dict(zip(classes, range(self.k)))
label_dict = dict(zip(classes, range(self.k), strict=False))
y_int = []
for yi in y:
y_int.append(list(map(label_dict.get, yi)))
Expand Down
10 changes: 7 additions & 3 deletions giddy/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(self, y, subs_mat=None, dist_type=None, indel=None, cluster_type=No
self.indel = indel
self.subs_mat = subs_mat
self.cluster_type = cluster_type
self.label_dict = dict(zip(self.classes, range(self.k)))
self.label_dict = dict(zip(self.classes, range(self.k), strict=False))

y_int = []
for yi in y:
Expand Down Expand Up @@ -267,7 +267,11 @@ def __init__(self, y, subs_mat=None, dist_type=None, indel=None, cluster_type=No
y_tran_index = np.zeros_like(y_int)
y_tran = []
for i in range(y_int.shape[1]):
y_tran.append(list(zip(y_int_ext[:, i], y_int_ext[:, i + 1])))
y_tran.append(
list(
zip(y_int_ext[:, i], y_int_ext[:, i + 1], strict=False)
)
)
for i in range(y_int.shape[0]):
for j in range(y_int.shape[1]):
y_tran_index[i, j] = dict_trans_state[y_tran[j][i]]
Expand Down Expand Up @@ -337,7 +341,7 @@ def _om_dist(self, y_int):
moves_str, unique_indices = np.unique(y_str, axis=0, return_index=True)
moves_int = y_int[unique_indices]
uni_num = len(moves_str)
dict_move_index = dict(zip(map(tuple, moves_int), range(uni_num)))
dict_move_index = dict(zip(map(tuple, moves_int), range(uni_num), strict=False))

# dict_move_index = dict(zip(map(tuple, moves_str), range(uni_num)))

Expand Down
2 changes: 1 addition & 1 deletion giddy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def _fill_empty_diagonal_3d(p):
p0 = p_temp.sum(axis=2) == 0
if p0.sum() > 0:
rows, cols = np.where(p0)
row_zero_i = list(zip(rows, cols))
row_zero_i = list(zip(rows, cols, strict=False))
for row in row_zero_i:
i, j = row
p_temp[i, j, j] = 1
Expand Down

0 comments on commit fb33b0e

Please sign in to comment.