Skip to content

Commit

Permalink
Fix bug in reads not unblocking as expected #372
Browse files Browse the repository at this point in the history
  • Loading branch information
Adoni5 committed Aug 20, 2024
1 parent 20e3e55 commit dbcfd65
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/readfish/_read_until_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""read_until_client.py
Subclasses ONTs read_until_api ReadUntilClient added extra function that logs unblocks read_ids.
"""

from __future__ import annotations
import logging
import time
Expand Down Expand Up @@ -92,24 +93,21 @@ def __init__(self, *args, **kwargs):
)

def unblock_read_batch(
self, reads: list[tuple[int, int, str]], duration: float = 0.1
self, reads: list[tuple[int, str]], duration: float = 0.1
) -> None:
"""Request for a bunch of reads be unblocked.
``reads`` is expected to be a list of (channel, ReadData.number)
``reads`` is expected to be a list of (channel, ReadData.id)
:param reads: List of (channel, read_number, read_id)
:param reads: List of (channel, read_id)
:param duration: time in seconds to apply unblock voltage.
"""
actions = list()
for channel, read_number, *read_id in reads:
for channel, read_id in reads:
actions.append(
self._generate_action(
channel, read_number, "unblock", duration=duration
)
self._generate_action(channel, read_id, "unblock", duration=duration)
)
if read_id:
self.unblock_logger.debug(read_id[0])
self.unblock_logger.debug(read_id)
self.action_queue.put(actions)

def unblock_read(
Expand Down

0 comments on commit dbcfd65

Please sign in to comment.