Skip to content

Commit 83fd561

Browse files
committed
fix: set np.nan array as float32 dtype
1 parent 4f43928 commit 83fd561

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

seqchromloader/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def extract_target(chrom, start, end, strand, target):
370370
logging.warning(f"RuntimeError happened when accessing {chrom}:{start}-{end}, it's probably due to at least one chromatin track bigwig doesn't have information in this region")
371371
raise BigWigInaccessible(chrom, start, end)
372372
else:
373-
target_array = np.array([np.nan])
373+
target_array = np.array([np.nan], dtype="float32")
374374
return target_array
375375

376376
def extract_info(chrom, start, end, label, genome_pyfaidx, bigwigs, target, strand="+", transforms:dict=None):
@@ -380,7 +380,7 @@ def extract_info(chrom, start, end, label, genome_pyfaidx, bigwigs, target, stra
380380
if bigwigs is not None and len(bigwigs)>0:
381381
chroms_array = extract_bw(chrom, start, end, strand, bigwigs)
382382
else:
383-
chroms_array = np.array([np.nan])
383+
chroms_array = np.array([np.nan], dtype="float32")
384384
# label
385385
label_array = np.array(label, dtype=np.int32)[np.newaxis]
386386
# counts

0 commit comments

Comments
 (0)