Skip to content

Commit

Permalink
fix: fix too restrictive numpy integer check in hist_stitcher
Browse files Browse the repository at this point in the history
This fixes issue 143:
#143
  • Loading branch information
mbaak committed Sep 30, 2021
1 parent 0ee5019 commit c162f11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions popmon/stitching/hist_stitcher.py
Expand Up @@ -218,7 +218,7 @@ def stitch_histograms(
)
if time_bin_idx is None:
raise ValueError(
"Request to insert delta hists but time_bin_idx not set. Please do."
"Request to insert delta hists but time_bin_idx not set or deductable. Please set manually."
)
self.logger.info(
f'Inserting delta histograms in axis "{time_axis}" at bin indices {time_bin_idx}.'
Expand Down Expand Up @@ -310,7 +310,7 @@ def _generate_time_bin_idx(self, hists_basis, features_basis, time_axis, n):
if max_time_bin_idx is not None:
self.logger.info(f"Maximum time bin index found: {max_time_bin_idx}")
time_bin_idx = None
if isinstance(max_time_bin_idx, (int, np.int64)):
if isinstance(max_time_bin_idx, (int, np.integer)):
start = max_time_bin_idx + 1
stop = start + n
time_bin_idx = np.arange(start, stop)
Expand Down Expand Up @@ -351,7 +351,7 @@ def _insert_hists(self, hbasis, hdelta_list, time_bin_idx, mode):
if isinstance(time_bin_idx[0], str):
if not isinstance(hbasis, hg.Categorize):
raise TypeError("hbasis does not accept string time-values.")
elif isinstance(time_bin_idx[0], (int, np.int64)):
elif isinstance(time_bin_idx[0], (int, np.integer)):
if not isinstance(hbasis, hg.SparselyBin):
raise TypeError("hbasis does not accept integer time-values.")

Expand Down

0 comments on commit c162f11

Please sign in to comment.