Skip to content

Commit

Permalink
Fix isinstance()
Browse files Browse the repository at this point in the history
  • Loading branch information
nalinigans committed Dec 20, 2024
1 parent bea23e0 commit a3bd0a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/genomicsdb_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def parse_vidmap_json(vidmap_file, intervals=None):
if not intervals:
intervals = []
for contig in contigs:
if isinstance(contig) == str: # Old style vidmap json
if isinstance(contig, str): # Old style vidmap json
contig_name = contig
contigs_map[contig] = {
"length": contigs[contig]["length"],
Expand Down
8 changes: 4 additions & 4 deletions examples/genomicsdb_query
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def parse_callset_json(callset_file):
callsets = callset["callsets"]
samples = []
for callset in callsets:
if isinstance(callset) == str: # Old style vidmap json
if isinstance(callset, str): # Old style vidmap json
samples.append(callset)
else: # Generated with vcf2genomicsdb_init
samples.append(callset["sample_name"])
Expand All @@ -69,8 +69,8 @@ def parse_callset_json_for_row_ranges(callset_file, samples=None):
callset["row_idx"]
for sample in samples
for callset in callsets
if (isinstance(callset) != str and sample == callset["sample_name"])
or (isinstance(callset) == str and sample == callset)
if (not isinstance(callset, str) and sample == callset["sample_name"])
or (isinstance(callset, str) and sample == callset)
]
if len(rows) == 0:
print(f"None of the samples{samples} specified were found in the workspace")
Expand Down Expand Up @@ -342,7 +342,7 @@ def main():

arrays = []
for idx, partition in enumerate(partitions):
if isinstance(partition["begin"]) == int: # Old style vidmap json
if isinstance(partition["begin"], int): # Old style vidmap json
column_begin = partition["begin"]
if "end" in partition.keys():
column_end = partition["end"]
Expand Down

0 comments on commit a3bd0a1

Please sign in to comment.