Commit a30c2c71 authored by Jan Reimes's avatar Jan Reimes
Browse files

refactor(meetings/utils): update normalize_subgroup_alias return type and logic

- Change return type documentation to reflect a single enum value.
- Adjust logic to append the short code of the normalized subgroup.
- Improve clarity in the function's purpose and output.
parent d115aeef
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ def normalize_working_group_alias(alias: str) -> WorkingGroup:
def normalize_subgroup_alias(alias: str) -> SubWorkingGroup:
    """Normalize subgroup aliases to canonical subgroup enums.

    Returns a list of possible matching subgroup enum values (e.g., SubWorkingGroup.S4).
    Returns a SubWorkingGroup enum value (e.g., SubWorkingGroup.S4).
    Supports:
    - Short codes: S4, R1, C3
    - Full names: SA4, RAN1, CT3
@@ -58,7 +58,7 @@ def normalize_subgroup_alias(alias: str) -> SubWorkingGroup:
        alias: Subgroup alias or code

    Returns:
        List of possible matching canonical subgroup enum values
        Canonical subgroup enum value (e.g., SubWorkingGroup.S4)
    """
    input_str = alias.strip().upper()
    cleaned = re.sub(r"[#\-_\s]", "", input_str)
+6 −10
Original line number Diff line number Diff line
@@ -238,12 +238,10 @@ class TDocCrawler:
                    meeting.meeting_id,
                    base_url,
                    meeting.short_name or "",
                    config.timeout,
                    config.max_retries,
                    target_tuple,
                    str(config.cache_dir),
                    config.http_cache.ttl,
                    config.http_cache.refresh_ttl_on_access,
                    config.timeout,
                    config.cache_manager_name,
                    config.http_cache,
                )
                futures[future] = meeting

@@ -573,12 +571,10 @@ class HybridTDocCrawler:
                        meeting.meeting_id,
                        base_url,
                        meeting.short_name or "",
                        config.timeout,
                        config.max_retries,
                        target_tuple,
                        str(config.cache_dir),
                        config.http_cache.ttl,
                        config.http_cache.refresh_ttl_on_access,
                        config.timeout,
                        config.cache_manager_name,
                        config.http_cache,
                    )
                )
                tasks[task] = meeting
+2 −1
Original line number Diff line number Diff line
@@ -97,7 +97,8 @@ def parse_subgroups(values: list[str] | None) -> list[str] | None:
            _logger.warning(f"Unknown subgroup: {item}")
            raise typer.Exit(code=2)

        resolved.extend(normalized)
        # Use .name to get the short code (e.g., "S4" not "SA4")
        resolved.append(normalized.name)

    return resolved