Force bucket_size to be at least 1
This commit is contained in:
parent
9aaf3ac896
commit
89728fdcbe
3
main.py
3
main.py
|
|
@ -71,7 +71,8 @@ if args.subparser_name == 'rank':
|
|||
else:
|
||||
dates = chain.from_iterable(v for v in entries.values())
|
||||
timestamps = list(d.timestamp() for d in dates)
|
||||
num_buckets = (max_date - min_date).total_seconds() / (args.bucket_size * 3600)
|
||||
bucket_size = max(args.bucket_size, 1)
|
||||
num_buckets = (max_date - min_date).total_seconds() / (bucket_size * 3600)
|
||||
num_buckets = max(1, int(num_buckets))
|
||||
counts, bin_edges = np.histogram(timestamps, bins=num_buckets)
|
||||
fig = tpl.figure()
|
||||
|
|
|
|||
Loading…
Reference in New Issue