Skip to content

feat: added a function to compute population coefficient between target year and latest available year from world bank#149

Merged
JinIgarashi merged 1 commit intomainfrom
feat/146-pop-coefficient-wb
Feb 4, 2025
Merged

feat: added a function to compute population coefficient between target year and latest available year from world bank#149
JinIgarashi merged 1 commit intomainfrom
feat/146-pop-coefficient-wb

Conversation

@JinIgarashi
Copy link
Contributor

fixes #146

added the below function to compute coefficient.

def get_pop_coefficient_world_bank(target_year: int, country_code: str) -> list[int | float]:
    """
    Fetches population data from the World Bank API and calculates the population growth coefficient.
    Parameters:
        target_year (int): The base year for comparison.
        country_code (str): The ISO3 country code.
    Returns:
        list[int, float]: A list containing the latest available year and the calculated coefficient.
    """

this is called at parent function of get_pop_coefficient and will compare both result of world bank and UNSD to get latest one. currently UNSD is not supported.

Also, added some simple test cases by mocking world bank api.

…et year and latest available year from world bank
@JinIgarashi JinIgarashi added the enhancement New feature or request label Feb 4, 2025
@JinIgarashi JinIgarashi temporarily deployed to github container registry February 4, 2025 05:22 — with GitHub Actions Inactive
@JinIgarashi JinIgarashi temporarily deployed to azure container registry February 4, 2025 05:22 — with GitHub Actions Inactive
@JinIgarashi JinIgarashi merged commit 5679e87 into main Feb 4, 2025
3 checks passed
@JinIgarashi JinIgarashi deleted the feat/146-pop-coefficient-wb branch February 4, 2025 06:45
iferencik pushed a commit that referenced this pull request Apr 10, 2025
…et year and latest available year from world bank (#149)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

from World Bank

1 participant