Skip to content

Commit

Permalink
remove unused dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mam10eks committed Nov 19, 2024
1 parent eac0498 commit 7c4d0cc
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,19 +429,6 @@ def _generate_password(length: int = 10) -> str:
"prefix",
type=str,
)
@argument(
"topics_path",
type=PathType(
exists=True,
file_okay=True,
dir_okay=False,
writable=False,
readable=True,
resolve_path=True,
allow_dash=False,
path_type=Path,
),
)
@argument(
"pool_path",
type=PathType(
Expand All @@ -462,7 +449,6 @@ def prepare_relevance_judgments(
guidelines_path: Path | None,
extra_supervisors: Sequence[str],
prefix: str,
topics_path: Path,
pool_path: Sequence[Path],
) -> None:
"""
Expand All @@ -475,6 +461,9 @@ def prepare_relevance_judgments(
raise ValueError("Empty project prefix.")
project_prefix = slugify(prefix)

if len(pool_path) == 0:
raise ValueError("Empty pool_path.")

guidelines: str
if guidelines_path is not None:
with guidelines_path.open("rt") as file:
Expand All @@ -488,7 +477,6 @@ def prepare_relevance_judgments(
password=doccano_password,
)
echo("Successfully authenticated with Doccano API.")

pool = concat(
read_json(
open(path, "r"),
Expand All @@ -511,20 +499,8 @@ def prepare_relevance_judgments(
)
echo(f"Found {len(pool)} pooled documents.")

# Read the topics.
topics = read_xml(topics_path, dtype=str)
echo(f"Found {len(topics)} topics.")

# Merge in groups from the topics
pool = pool.merge(
topics[["number", "group"]],
how="left",
left_on="query_id",
right_on="number",
)

groups: set[str] = set(pool["group"].drop_duplicates().to_list())
echo(f"Found {len(groups)} groups.")
echo(f"Found {len(groups)} groups:", groups)

# Create mapping of groups to usernames and project names.
group_user_names: Mapping[str, str] = {
Expand Down

0 comments on commit 7c4d0cc

Please sign in to comment.