Skip to content

Commit

Permalink
linting new version black
Browse files Browse the repository at this point in the history
  • Loading branch information
saramonzon committed Apr 1, 2024
1 parent 7aea641 commit f8ebb07
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions taranis/eval_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ def evaluate_clusters(
"alleles_not_found"
]
if len(result_eval["alleles_not_in_cluster"]) > 0:
evaluation_alleles[cluster_id][
"alleles_not_in_cluster"
] = result_eval["alleles_not_in_cluster"]
evaluation_alleles[cluster_id]["alleles_not_in_cluster"] = (
result_eval["alleles_not_in_cluster"]
)
else:
evaluation_alleles[cluster_id]["result"] = "OK"
return self.summary(evaluation_alleles)
44 changes: 22 additions & 22 deletions taranis/seq_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ def _convert_cluster_ptrs(src_cluster_ptrs, last_seq_cluster_ptrs):

for cluster_id in range(np.max(src_cluster_ptrs) + 1):
src_cluster_ids = np.argwhere(src_cluster_ptrs == cluster_id).flatten()
output_seq_cluster_ptrs[
np.isin(last_seq_cluster_ptrs, src_cluster_ids)
] = cluster_id
output_seq_cluster_ptrs[np.isin(last_seq_cluster_ptrs, src_cluster_ids)] = (
cluster_id
)

return output_seq_cluster_ptrs

Expand Down Expand Up @@ -239,9 +239,9 @@ def _bin_src_clusters(
):
if len(src_cluster_bins) == 0:
src_cluster_bins.append([src_cluster_id])
avg_intra_bin_edge_weights[
str(src_cluster_id)
] = global_edge_weight_mtrx[src_cluster_id, src_cluster_id]
avg_intra_bin_edge_weights[str(src_cluster_id)] = (
global_edge_weight_mtrx[src_cluster_id, src_cluster_id]
)
continue

best_bin = None
Expand All @@ -267,16 +267,16 @@ def _bin_src_clusters(

if best_bin is None:
src_cluster_bins.append([src_cluster_id])
avg_intra_bin_edge_weights[
str(src_cluster_id)
] = global_edge_weight_mtrx[src_cluster_id, src_cluster_id]
avg_intra_bin_edge_weights[str(src_cluster_id)] = (
global_edge_weight_mtrx[src_cluster_id, src_cluster_id]
)
else:
del avg_intra_bin_edge_weights["-".join(map(str, best_bin))]
best_bin.append(src_cluster_id)
avg_intra_bin_edge_weights[
"-".join(map(str, best_bin))
] = cls._cal_cluster_avg_edge_weight(
global_edge_weight_mtrx, src_cluster_edge_counts, best_bin
avg_intra_bin_edge_weights["-".join(map(str, best_bin))] = (
cls._cal_cluster_avg_edge_weight(
global_edge_weight_mtrx, src_cluster_edge_counts, best_bin
)
)

return list(map(np.array, src_cluster_bins)), avg_intra_bin_edge_weights
Expand All @@ -297,12 +297,12 @@ def _verify_clusters(

for cluster_id in range(np.max(src_cluster_ptrs) + 1):
src_cluster_bool_ptrs = src_cluster_ptrs == cluster_id
avg_intra_super_cluster_edge_weights[
cluster_id
] = cls._cal_cluster_avg_edge_weight(
global_edge_weight_mtrx,
src_cluster_edge_counts,
src_cluster_bool_ptrs,
avg_intra_super_cluster_edge_weights[cluster_id] = (
cls._cal_cluster_avg_edge_weight(
global_edge_weight_mtrx,
src_cluster_edge_counts,
src_cluster_bool_ptrs,
)
)
else:
src_cluster_ptrs = np.full(candidate_src_cluster_ptrs.size, -1)
Expand All @@ -315,9 +315,9 @@ def _verify_clusters(
if src_cluster_ids.size == 1:
assigned_super_cluster_id = np.max(src_cluster_ptrs) + 1
src_cluster_ptrs[src_cluster_ids] = assigned_super_cluster_id
avg_intra_super_cluster_edge_weights[
assigned_super_cluster_id
] = global_edge_weight_mtrx[src_cluster_ids[0], src_cluster_ids[0]]
avg_intra_super_cluster_edge_weights[assigned_super_cluster_id] = (
global_edge_weight_mtrx[src_cluster_ids[0], src_cluster_ids[0]]
)
continue

(
Expand Down

0 comments on commit f8ebb07

Please sign in to comment.