Skip to content

Commit 0cfee8e

Browse files
Remove identify_controversial_clusters from exports
Eliminated the identify_controversial_clusters function and its related import/export from the package. This streamlines the API and removes unused or deprecated functionality.
1 parent a69a72c commit 0cfee8e

2 files changed

Lines changed: 1 addition & 39 deletions

File tree

python/mllmcelltype/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
process_controversial_clusters,
1111
summarize_discussion,
1212
)
13-
from .functions import (
14-
get_provider,
15-
identify_controversial_clusters,
16-
)
13+
from .functions import get_provider
1714
from .logger import setup_logging, write_log
1815
from .prompts import (
1916
create_batch_prompt,
@@ -48,7 +45,6 @@
4845
# Functions
4946
"get_provider",
5047
"clean_annotation",
51-
"identify_controversial_clusters",
5248
# Logging
5349
"setup_logging",
5450
"write_log",

python/mllmcelltype/functions.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
process_stepfun,
1313
process_zhipu,
1414
)
15-
from .utils import find_agreement
16-
1715
# Global provider function mapping for reuse across modules
1816
PROVIDER_FUNCTIONS = {
1917
"openai": process_openai,
@@ -83,35 +81,3 @@ def get_provider(model: str) -> str:
8381
f"Cannot determine provider for model: {model}. "
8482
f"Supported model prefixes: {', '.join(supported_prefixes)}"
8583
)
86-
87-
88-
def identify_controversial_clusters(
89-
annotations: dict[str, dict[str, str]], threshold: float = 0.6
90-
) -> list[str]:
91-
"""Identify clusters with inconsistent annotations across models.
92-
93-
This function uses find_agreement() to compute consensus statistics,
94-
then filters clusters where the consensus proportion is below the threshold.
95-
96-
Args:
97-
annotations: Dictionary mapping model names to dictionaries of cluster annotations
98-
threshold: Agreement threshold below which a cluster is considered controversial
99-
100-
Returns:
101-
list[str]: List of controversial cluster IDs
102-
103-
"""
104-
if not annotations or len(annotations) < 2:
105-
return []
106-
107-
# Use find_agreement() to compute consensus statistics for all clusters
108-
_consensus, consensus_proportion, _entropy = find_agreement(annotations)
109-
110-
# Filter clusters where agreement is below threshold
111-
controversial = [
112-
cluster
113-
for cluster, agreement in consensus_proportion.items()
114-
if agreement < threshold
115-
]
116-
117-
return controversial

0 commit comments

Comments
 (0)