Skip to content

Commit

Permalink
casting report parameters to corresponding data types
Browse files Browse the repository at this point in the history
  • Loading branch information
ptajvar committed Oct 22, 2024
1 parent 37d1ddf commit 63145f7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pixelator/graph/community_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,18 @@ def connect_components(
logger.debug("Generate graph report")
result_metrics = edgelist_metrics(graph_output_edgelist)

result_metrics["edges_with_colliding_upi_count"] = (
(removed_edgelist_df["depth"] == 0).sum().astype(int)
result_metrics["edges_with_colliding_upi_count"] = int(
(removed_edgelist_df["depth"] == 0).sum()
)
result_metrics["edges_removed_in_multiplet_recovery_first_iteration"] = (
(removed_edgelist_df["depth"] == 1).sum().astype(int)
result_metrics["edges_removed_in_multiplet_recovery_first_iteration"] = int(
(removed_edgelist_df["depth"] == 1).sum()
)
result_metrics["edges_removed_in_multiplet_recovery_refinement"] = (
(removed_edgelist_df["depth"] > 1).sum().astype(int)
result_metrics["edges_removed_in_multiplet_recovery_refinement"] = int(
(removed_edgelist_df["depth"] > 1).sum()
)
result_metrics["fraction_edges_removed_in_refinement"] = float(
(removed_edgelist_df["depth"] > 1).sum() / max(len(removed_edgelist_df), 1)
)
result_metrics["fraction_edges_removed_in_refinement"] = (
removed_edgelist_df["depth"] > 1
).sum() / max(len(removed_edgelist_df), 1)

del graph_output_edgelist
del removed_edgelist_df
Expand Down

0 comments on commit 63145f7

Please sign in to comment.