From a58f24941ef5bf361ad3d0b8350abbb6addf0efc Mon Sep 17 00:00:00 2001 From: danielSanchezQ <3danimanimal@gmail.com> Date: Mon, 23 Jun 2025 13:31:25 +0000 Subject: [PATCH] Remove main block --- da/assignations/refill.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/da/assignations/refill.py b/da/assignations/refill.py index 82b2e0f..7d0adb7 100644 --- a/da/assignations/refill.py +++ b/da/assignations/refill.py @@ -101,27 +101,3 @@ def calculate_subnetwork_assignations( heappush(available_nodes, participant) heappush(subnetworks, subnetwork) return [subnetwork.participants for subnetwork in sorted(subnetworks, key=lambda x: x.subnetwork_id)] - - - - -if __name__ == "__main__": - import random - number_of_columns = 4096 - for size in [100, 500, 1000, 10000]: - nodes_ids = [random.randbytes(32) for _ in range(size)] - replication_factor = 3 - print(size, replication_factor) - # print(a := calculate_subnets(nodes_ids, number_of_columns, replication_factor)) - from pprint import pprint - b = calculate_subnetwork_assignations(nodes_ids, [set() for _ in range(number_of_columns)], replication_factor) - # pprint(b) - assert len(set(chain.from_iterable(b))) == len(nodes_ids) - # fill up new nodes - for i in range(0, size, 5): - nodes_ids[i] = random.randbytes(32) - b = calculate_subnetwork_assignations(nodes_ids, b, replication_factor) - # pprint(b) - assert len(set(chain.from_iterable(b))) == len(nodes_ids), f"{len(set(chain.from_iterable(b)))} != {len(nodes_ids)}" - print(Counter(chain.from_iterable(b)).values()) -