In braintools.visualize.animate_2D, values is reshaped to (num_step, height, width) after the first frame is drawn (img = values[0]; ax.pcolor(img, ...)). So pcolor receives a 1-D array and matplotlib >= 3.10 raises ValueError. The function cannot run in any configuration.
Location: braintools/visualize/_plots.py (animate_2D).
Fix: reshape values to (num_step, height, width) before constructing the initial img/pcolor.
Found while adding test coverage (#90).
In
braintools.visualize.animate_2D,valuesis reshaped to(num_step, height, width)after the first frame is drawn (img = values[0]; ax.pcolor(img, ...)). Sopcolorreceives a 1-D array and matplotlib >= 3.10 raisesValueError. The function cannot run in any configuration.Location:
braintools/visualize/_plots.py(animate_2D).Fix: reshape
valuesto(num_step, height, width)before constructing the initialimg/pcolor.Found while adding test coverage (#90).