Heatmap ValueError
Summary
(Arin to add more details later)
Steps to reproduce
Run strain_report_dev.py in skeletons (https://git.ecdf.ed.ac.uk/swain-lab/aliby/skeletons/-/blob/04a03bcffba903d5522255f882bd56822577eb1d/scripts/users/arin/strain_report_dev.py) on jura.
What is the current bug behavior?
(What actually happens)
What is the expected correct behavior?
(What you should see instead)
Logs/Traceback
Strain chosen: fy4
Interval: time points 0 to 287
Number of cells: 441
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/srv/data/shared/skeletons/scripts/users/arin/strain_report_dev.py in <module>
356 xtick_step=1,
357 xlabel="Time (hours)",
--> 358 ax=ax_heatmap,
359 )
360
~/.local/lib/python3.7/site-packages/postprocessor/routines/heatmap.py in heatmap(trace_df, trace_name, births_df, cmap, sampling_period, xtick_step, scale, robust, xlabel, plot_title, ax, cbar_ax)
166 robust,
167 xlabel,
--> 168 plot_title,
169 )
170 if ax is None:
~/.local/lib/python3.7/site-packages/postprocessor/routines/heatmap.py in __init__(self, trace_df, trace_name, births_df, cmap, sampling_period, xtick_step, scale, robust, xlabel, plot_title)
64 xticklabels = np.arange(xtick_min, xtick_max, self.xtick_step)
65 self.xticks = [
---> 66 int(np.where(time_axis == label)[0].item()) for label in xticklabels
67 ]
68 self.xticklabels = list(map(str, xticklabels.tolist()))
~/.local/lib/python3.7/site-packages/postprocessor/routines/heatmap.py in <listcomp>(.0)
64 xticklabels = np.arange(xtick_min, xtick_max, self.xtick_step)
65 self.xticks = [
---> 66 int(np.where(time_axis == label)[0].item()) for label in xticklabels
67 ]
68 self.xticklabels = list(map(str, xticklabels.tolist()))
ValueError: can only convert an array of size 1 to a Python scalar
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)