Skip to content

Add compatibility (docs + extra checks) for external data use#50

Merged
CyGei merged 4 commits into
mainfrom
external-data-docs
Mar 10, 2026
Merged

Add compatibility (docs + extra checks) for external data use#50
CyGei merged 4 commits into
mainfrom
external-data-docs

Conversation

@emprzy
Copy link
Copy Markdown
Contributor

@emprzy emprzy commented Mar 6, 2026

This PR:

  • Adds a documentation page (and reference to this page on the "getting started" page) to show users how they could use their own ground truth data as a parameter in get_fcast(). Note that using ones' own data is an alternative path to fetching NHSN data with our get_data().
  • Adds a couple of extra safety checks to get_fcast() and to_respilens():
    • get_fcast(): explicitly requires that get_fcast() df parameter have target and location columns (in addition to target_end_date and observation)
    • get_fcast(): throws an error if there is more than one unique location or unique target in the df parameter
    • to_respilens(): throws an error if the model_out_tbl or oracle_output components of the parameter have more than one unique location

Separately, I also removed the codebase's dependency on loc_data. Because we want to aim to accommodate external data, we can't possibly have location metadata that covers every possible location. So, to_respilens() (which was the only thing that needed loc_data) simply just broadcasts the value in model_out_tbl$location[1] across every location-related metadata entry. MyRespiLens doesn't need abbreviation, location_name, location, and population to function correctly. It just needs a single location name.

@emprzy
Copy link
Copy Markdown
Contributor Author

emprzy commented Mar 6, 2026

Linked to issue #42

@CyGei CyGei merged commit 654cba0 into main Mar 10, 2026
1 check passed
@CyGei CyGei deleted the external-data-docs branch March 10, 2026 15:46
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