krzysztofarendt / building3d

Towards 3D building modeling and simulation
MIT License
20 stars 2 forks source link

read_buffers: ValueError: could not broadcast input array from shape (500,3) into shape (1000,3) #74

Closed krzysztofarendt closed 1 month ago

krzysztofarendt commented 1 month ago
> python examples/ray_2_boxes_example.py
...
Exiting the loop
Converting buffers to contiguous arrays
Exiting the function
tot_time=82.16
Traceback (most recent call last):
  File "/home/krza/code/building3d/examples/ray_2_boxes_example.py", line 52, in <module>
    pos_buf, vel_buf, enr_buf, hit_buf = read_buffers("tmp")
  File "/home/krza/code/building3d/building3d/simulators/rays/dump_buffers.py", line 121, in read_buffers
    pos_buf[step_num, :, :] = pos
ValueError: could not broadcast input array from shape (500,3) into shape (1000,3)
krzysztofarendt commented 1 month ago

I believe this commit fixes this issue: 371f9c1b3d55dd068256f8d19fa7c6d1e4497e06 Not sure why, but Numba cannot guess the shape of the array when using :. It works in Python. Specifying the sizes of each dimension works in Numba.