Skip to content

Commit

Permalink
Merge pull request #184 from UC-Davis-molecular-computing/181-rna_dup…
Browse files Browse the repository at this point in the history
…lex_multiple-causes-keyerror-with-parallel-true

181 rna duplex multiple causes keyerror with parallel=true
  • Loading branch information
dave-doty authored Jun 24, 2022
2 parents 242a4a5 + a44a571 commit 09bf48c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nuad/vienna_nupack.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,14 @@ def rna_duplex_multiple(seq_pairs: Sequence[Tuple[str, str]],
for i, energy, seq_pair in zip(idxs_to_calculate, energies_to_calculate, seq_pairs_to_calculate):
energies[i] = energy
if cache:
key = (seq_pair, temperature, parameters_filename)
_rna_duplex_cache[key] = energy

# clear out oldest cache key if _rna_duplex_queue is full
if len(_rna_duplex_queue) == _rna_duplex_queue.maxlen:
lru_item = _rna_duplex_queue[0]
del _rna_duplex_cache[lru_item]
if lru_item in _rna_duplex_cache:
del _rna_duplex_cache[lru_item]

key = (seq_pair, temperature, parameters_filename)
_rna_duplex_cache[key] = energy
_rna_duplex_queue.append(key)

return energies
Expand Down

0 comments on commit 09bf48c

Please sign in to comment.