Skip to content

Commit

Permalink
np.float -> float
Browse files Browse the repository at this point in the history
  • Loading branch information
sokrypton committed Mar 3, 2023
1 parent 7d5e42c commit 3e99c44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions beta/colabfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def plot_msas(msas, ori_seq=None, sort_by_seqid=True, deduplicate=True, dpi=100,
qid_ = msa_ == np.array(list("".join(seqs)))
gapid = np.stack([gap_[:,Ln[i]:Ln[i+1]].max(-1) for i in range(len(seqs))],-1)
seqid = np.stack([qid_[:,Ln[i]:Ln[i+1]].mean(-1) for i in range(len(seqs))],-1).sum(-1) / (gapid.sum(-1) + 1e-8)
non_gaps = gap_.astype(np.float)
non_gaps = gap_.astype(float)
non_gaps[non_gaps == 0] = np.nan
if sort_by_seqid:
lines.append(non_gaps[seqid.argsort()]*seqid[seqid.argsort(),None])
Expand Down Expand Up @@ -616,7 +616,7 @@ def rescale(a,amin=None,amax=None):

if chainbreak is not None:
dist = np.linalg.norm(xyz[:-1] - xyz[1:], axis=-1)
colors[...,3] = (dist < chainbreak).astype(np.float)
colors[...,3] = (dist < chainbreak).astype(float)

# add shade/tint based on z-dimension
z = rescale(seg_z,zmin,zmax)[:,None]
Expand Down
4 changes: 2 additions & 2 deletions colabfold/colabfold.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def plot_msas(msa, ori_seq=None, sort_by_seqid=True, deduplicate=True, dpi=100,
qid_ = msa_ == np.array(list("".join(seqs)))
gapid = np.stack([gap_[:,Ln[i]:Ln[i+1]].max(-1) for i in range(len(seqs))],-1)
seqid = np.stack([qid_[:,Ln[i]:Ln[i+1]].mean(-1) for i in range(len(seqs))],-1).sum(-1) / (gapid.sum(-1) + 1e-8)
non_gaps = gap_.astype(np.float)
non_gaps = gap_.astype(float)
non_gaps[non_gaps == 0] = np.nan
if sort_by_seqid:
lines.append(non_gaps[seqid.argsort()]*seqid[seqid.argsort(),None])
Expand Down Expand Up @@ -697,7 +697,7 @@ def rescale(a,amin=None,amax=None):

if chainbreak is not None:
dist = np.linalg.norm(xyz[:-1] - xyz[1:], axis=-1)
colors[...,3] = (dist < chainbreak).astype(np.float)
colors[...,3] = (dist < chainbreak).astype(float)

# add shade/tint based on z-dimension
z = rescale(seg_z,zmin,zmax)[:,None]
Expand Down

0 comments on commit 3e99c44

Please sign in to comment.