More numpy for speed

This commit is contained in:
2024-12-25 10:34:40 +01:00
parent 4a479c1646
commit f3a3e1fca3

View File

@@ -20,11 +20,10 @@ class DayRunner(CombinedRunner):
else: else:
keys.append(heights) keys.append(heights)
fitting = 0 locks = numpy.stack(locks, axis=0)
for key in keys: fitting = sum(
for lock in locks: numpy.count_nonzero(numpy.all((key + locks) <= 7, axis=1)) for key in keys
if numpy.all((key + lock) <= 7): )
fitting += 1
return fitting, None return fitting, None