Skip to content

Implement logic to determine if a jurisdiction should be created for a given Division object #40

@kstohr

Description

@kstohr

Module: src/init_migration/generate_pipeline.py
Method:
def should_create_jurisdiction(self, division: Division) -> JurisdictionLevel:
"""Determine what type of Jurisdiction should be created for this Division"""

    TODO: Define jurisdiction creation rules based on Division classification/type.
    Currently: Create jurisdiction for all cases (placeholder logic).

    Args:
        division: The Division object to evaluate

    Returns:
        True if Jurisdiction should be created, False otherwise
    """
    # Placeholder: Create jurisdiction for all Divisions
    return True

Output: JurisdictionLevel

JurisdictionLevel(BaseModel):
ocdid_level: Literal["county", "place", "governing board"] -- check that this is correct that we only have places and county subs.

The method will:

  • Examine the LSAD code against an Enum of LSAD codes. The Enum needs to be created. See ticket:
    This logic would perform the following logical checks:
  • If cousub, and not special district (based on LSAD designation) then set to True and ocdid_level = county
  • If cousub, and special district (i.e. marin city) based on LSAD designation, then set to True and ocdid_level = governing board
  • If place, then set to True and ocdid_level = place

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions