Skip to content

Snt25 530#97

Open
irautu-bluesquare wants to merge 20 commits into
mainfrom
SNT25-530
Open

Snt25 530#97
irautu-bluesquare wants to merge 20 commits into
mainfrom
SNT25-530

Conversation

@irautu-bluesquare

Copy link
Copy Markdown
Collaborator

Update params access to health care pipeline: https://bluesquare.atlassian.net/browse/SNT25-530

Changes:

  • worldpopclient.py
    • new file to create WorldPop clien: copied shamelessly from MAP extract pipeline
  • pipeline.py
    • remove params for input shapes, input population and custom radius and adapt code
    • add param for input WorldPop year
      • validate year
      • if data for that year exists, use that; if not, try to download from WorldPop
    • validate input FOSA file type
    • use worldpopclient.py
    • new functions:
      • has_allowed_extension (to check FOSA input extension)
      • get_or_download_worldpop_raster (uses worldpopclient.py)
      • retrieve_shapes (no more param)
  • snt_utils.r
    • removed 2 functions (both make coverage radius from the "utils"; one moved to snt_healthcare_access.r, one not used anymore)
  • snt_healthcare_access.r
    • added the function to make coverage radii from snt_utils.r
  • snt_healthcare_access_report
    • added the ovelaid FOSA with radii plot
    • added common SNT formatting to it (title format/size, theme, etc.)
  • snt_healthcare_access.ipynb
    • update for the new params/process
  • snt_healthcare_access_report.ipynb
    • update for the new params/process
    • add an option to specify in plots when user data inputs are used
  • readme.md
    • update document for the new params/process

Examples of runs
image
image
image
snt_healthcare_access_report_OUTPUT_2026-06-22_084832.zip

@EstebanMontandon EstebanMontandon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the pipeline has been tested in the snt-testing , then is ready to be merged ;)

num_km = input_radius_meters / 1000
shapes_file_path: str | None = None
# validate input parameter values
if input_fosa_file is not None:

@EstebanMontandon EstebanMontandon Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also do something like:

if input_fosa_file is None:
    current_run.log_info("Using default FOSA data (DHIS2).")
elif not Path(input_fosa_file.path).exists():
    current_run.log_warning("User provided file not found, check the path.")
elif not has_allowed_extension(input_fosa_file):
    current_run.log_warning("FOSA location file should be a .csv file. Using default FOSA data instead.")
else:
    current_run.log_info(f"Using FOSA coordinates file: {input_fosa_file.path}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants