From 85769121ea55187f72d4a5db0f97e4345c86431e Mon Sep 17 00:00:00 2001 From: Marco Pagani Date: Sat, 17 Oct 2026 22:16:56 +0200 Subject: [PATCH] fnm: count possible connections from the distance matrix shape len() is not defined for sparse matrices. --- openquake/fnm/all_together_now.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openquake/fnm/all_together_now.py b/openquake/fnm/all_together_now.py index d26c2a430..a58d51de5 100644 --- a/openquake/fnm/all_together_now.py +++ b/openquake/fnm/all_together_now.py @@ -282,7 +282,7 @@ def build_fault_network( ) n_connections = fault_network['bin_dist_mat'].sum() - n_possible_connections = len(fault_network['dist_mat']) ** 2 + n_possible_connections = fault_network['dist_mat'].shape[0] ** 2 logging.info( f"\t{'{:,}'.format(n_connections)} "