Error if initializing GridCells with random_gridscales=False
Closed this issue · 2 comments
PikaPei commented
env = Environment()
ag = Agent(env)
grid_cells = GridCells(
ag,
params={"random_gridscales": False}
)
grid_cells.plot_rate_map()
The code above raised an error:
File "/Users/pei/.pyenv/versions/3.10.5/lib/python3.10/site-packages/ratinabox/Neurons.py", line 244, in plot_rate_map
t_end = t_end or t[-1]
IndexError: index -1 is out of bounds for axis 0 with size 0
My quick workaround is:
self.gridscales = np.full(self.n, fill_value=self.gridscales)
TomGeorge1234 commented
This issue was fixed in a PR which will soon be merged once a small change is made. then I will close it
TomGeorge1234 commented
fixed