This commit is contained in:
Aseem Saxena 2026-01-09 10:50:34 +08:00 committed by GitHub
commit be9ec5f1da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,8 +23,16 @@ import numpy
def add_area_dims(area, num_dims):
while (len(area) // 2) < num_dims:
area = [2147483648] + area[:len(area) // 2] + [0] + area[len(area) // 2:]
current_dims = len(area) // 2
while current_dims < num_dims:
midpoint = len(area) // 2
# More efficient construction of the new area list
new_area = [2147483648]
new_area.extend(area[:midpoint])
new_area.append(0)
new_area.extend(area[midpoint:])
area = new_area
current_dims += 1
return area
def get_area_and_mult(conds, x_in, timestep_in):