Skip to content

Commit

Permalink
cd_idx -> cw_idx
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkjo committed Jun 28, 2021
1 parent 5cfca05 commit 576a48c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions freebarcodes/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def build_codebook_from_random_codewords(self, codewords, max_err_decode, max_er
# Assign decode spheres proper index, rejecting conflicts
reject_idx = len(self._codewords) + 1
for i, cw in enumerate(self._codewords):
cd_idx = i + 1
cw_idx = i + 1
for seq in FreeDivSphere.FreeDivSphere(cw, self.max_err_decode):
seq_idx = seqtools.dna2num(seq)
if self._codebook[seq_idx] == 0: # unassigned
Expand All @@ -95,7 +95,7 @@ def build_codebook_from_random_codewords(self, codewords, max_err_decode, max_er

# Iterate detect spheres, rejecting conflicts
for i, cw in enumerate(self._codewords):
cd_idx = i + 1
cw_idx = i + 1
for seq in FreeDivSphere.FreeDivSphere(
cw,
min_r=self.max_err_decode+1,
Expand All @@ -115,7 +115,7 @@ def analyze_random_codeword_codebook(self):
"""
stats_given_cw = {}
for i, cw in enumerate(self._codewords):
cd_idx = i + 1
cw_idx = i + 1
stats = {'good': 0, 'bad': 0}
if self._codebook[seqtools.dna2num(cw)] == cw_idx:
stats['self'] = 'good'
Expand Down

0 comments on commit 576a48c

Please sign in to comment.