Skip to content

Commit c8417b7

Browse files
committed
handle datetime with sub seconds
1 parent 91fb140 commit c8417b7

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

bonito/fast5.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import torch
1515
import numpy as np
1616
from tqdm import tqdm
17+
from dateutil import parser
1718
from scipy.signal import find_peaks
1819
from ont_fast5_api.fast5_interface import get_fast5_file
1920

@@ -67,7 +68,7 @@ def __init__(self, read, filename, meta=False):
6768
self.start = read_attrs['start_time'] / self.sampling_rate
6869
self.duration = read_attrs['duration'] / self.sampling_rate
6970

70-
exp_start_dt = datetime.strptime(self.exp_start_time, "%Y-%m-%dT%H:%M:%S")
71+
exp_start_dt = parser.parse(self.exp_start_time)
7172
start_time = exp_start_dt + timedelta(seconds=self.start)
7273
self.start_time = start_time.replace(microsecond=0).isoformat()
7374

requirements-cuda111.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ requests==2.25.1
1111
ont-remora==0.1.1
1212
ont-fast5-api==3.3.0
1313
fast-ctc-decode==0.3.0
14+
python-dateutil==2.8.2
1415
# cuda requirements
1516
torch==1.10.0+cu111
1617
koi-cuda111==0.0.5

requirements-cuda113.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ requests==2.25.1
1111
ont-remora==0.1.1
1212
ont-fast5-api==3.3.0
1313
fast-ctc-decode==0.3.0
14+
python-dateutil==2.8.2
1415
# cuda requirements
1516
torch==1.10.0+cu113
1617
koi-cuda113==0.0.5

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ requests==2.25.1
1111
ont-remora==0.1.1
1212
ont-fast5-api==3.3.0
1313
fast-ctc-decode==0.3.0
14+
python-dateutil==2.8.2
1415
# cuda requirements
1516
torch~=1.10.0
1617
koi-cuda102==0.0.5

0 commit comments

Comments
 (0)