Skip to content

Commit

Permalink
Merge pull request #323 from robomics/bugfix
Browse files Browse the repository at this point in the history
Improve handling of uint attributes
  • Loading branch information
nvictus committed May 22, 2023
2 parents a355abc + 90ca802 commit 8f3f47b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cooler/balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def balance_cooler(
"""
# Divide the number of elements into non-overlapping chunks
nnz = clr.info["nnz"]
nnz = int(clr.info["nnz"])
if chunksize is None:
chunksize = nnz
spans = [(0, nnz)]
Expand All @@ -356,7 +356,7 @@ def balance_cooler(
base_filters.append(partial(_zero_diags, ignore_diags))

# Initialize the bias weights
n_bins = clr.info["nbins"]
n_bins = int(clr.info["nbins"])
if x0 is not None:
bias = x0
bias[np.isnan(bias)] = 0
Expand Down
2 changes: 1 addition & 1 deletion cooler/cli/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def update_heatmap(event):
im.set_extent(extent)
ax.figure.canvas.draw_idle()

binsize = c.info["bin-size"]
binsize = int(c.info["bin-size"])
row_chrom_len = c.chromsizes[row_chrom]
col_chrom_len = c.chromsizes[col_chrom]
plotstate = {"placeholders": [], "prev_extent": get_extent(plt.gca())}
Expand Down
2 changes: 1 addition & 1 deletion cooler/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,5 @@ def __call__(self, span):

def split(clr, map=map, chunksize=10_000_000, spans=None, **kwargs):
if spans is None:
spans = partition(0, clr.info["nnz"], chunksize)
spans = partition(0, int(clr.info["nnz"]), chunksize)
return MultiplexDataPipe(chunkgetter(clr, **kwargs), spans, map)

0 comments on commit 8f3f47b

Please sign in to comment.