utils/dash_utils.py
def add_choice(
    choices: list, coord: Dict[str, List[float]], option: int, year: int, season_id: int
) -> None:
    """Adds choice to the list of choices used for a dropdown component

    Args:
        choices (list): List of choices
        coord (Dict[str, List[float]]): Coordinates of the choice
        option (int): Option number
        season_id (int): Season id
    """
    coord_str = f"lat {coord['lat'][0]:.2f}, long {coord['long'][0]:.2f}"
    if season_id == 1:
        season_str = "JAN-MAR"
    elif season_id == 2:
        season_str = "APR-JUN"
    elif season_id == 3:
        season_str = "JUL-SEP"
    elif season_id == 4:
        season_str = "OCT-DEC"
    else:
        raise ValueError("Season id is not valid")
    choices.append(
        {
            "label": f"Polygon {option} (Coord: {coord_str}), {year}  {season_str}",
            "value": f"{option}_y{year}_s{season_id}",
        }
    )
Adds choice to the list of choices used for a dropdown component

    Args:
        choices (list): List of choices
        coord (Dict[str, List[float]]): Coordinates of the choice
        option (int): Option number
        season_id (int): Season id
    
Adds choice to the list of choices used for a dropdown component
Adds choice to the list of choices used for a dropdown component
def add_choice(
    choices: list, coord: Dict[str, List[float]], option: int, year: int, season_id: int
) -> None:
    coord_str = f"lat {coord['lat'][0]:.2f}, long {coord['long'][0]:.2f}"
    if season_id == 1:
        season_str = "JAN-MAR"
    elif season_id == 2:
        season_str = "APR-JUN"
    elif season_id == 3:
        season_str = "JUL-SEP"
    elif season_id == 4:
        season_str = "OCT-DEC"
    else:
        raise ValueError("Season id is not valid")
    choices.append(
        {
            "label": f"Polygon {option} (Coord: {coord_str}), {year}  {season_str}",
            "value": f"{option}_y{year}_s{season_id}",
        }
    )
def add_choice ( choices : list , coord : Dict [ str , List [ float ] ] , option : int , year : int , season_id : int ) -> None : coord_str = f"lat {coord['lat'][0]:.2f}, long {coord['long'][0]:.2f}" if season_id == 1 : season_str = "JAN-MAR" elif season_id == 2 : season_str = "APR-JUN" elif season_id == 3 : season_str = "JUL-SEP" elif season_id == 4 : season_str = "OCT-DEC" else : raise ValueError ( "Season id is not valid" ) choices . append ( { "label" : f"Polygon {option} (Coord: {coord_str}), {year}  {season_str}" , "value" : f"{option}_y{year}_s{season_id}" , } )
Adds choice to the list of choices used for a dropdown component
Adds choice to the list of choices used for a dropdown component
"""Adds choice to the list of choices used for a dropdown component

    Args:
        choices (list): List of choices
        coord (Dict[str, List[float]]): Coordinates of the choice
        option (int): Option number
        season_id (int): Season id
    """
choices
list
List of choices
List of choices
coord
Dict[str, List[float]]
Coordinates of the choice
Coordinates of the choice
option
int
None
year
int
season_id
int
None