Skip to content

Bump to v2025.0.2#33

Merged
dcolombara merged 18 commits intomainfrom
dev
May 17, 2025
Merged

Bump to v2025.0.2#33
dcolombara merged 18 commits intomainfrom
dev

Conversation

@dcolombara
Copy link
Copy Markdown
Contributor

New

  • chi_suppress_results() - applies primary and secondary suppression
  • check_version() - checks if you have the latest version installed. Autochecks when attaching library.

Improvements

  • chi_calc() - validate analysis years requested by ph.instructions compared to available chi_years in ph.data
  • chi_calc() - correct values for SE and RSE when numerator and or denominare are zero or NA
  • chi_get_proper_pop() - optimize to run faster by batching pulls from rads::get_population.
  • chi_get_proper_pop() - add is_chars paramater to allow for differnt definition of King County for CHARS analyses
  • chi_get_proper_pop() - fixed assign_geographic_crosswalk helper function (catvarname was not passed but was expected)
  • chi_get_proper_pop() - Fixed small bug for race/ethnicity (capitalization matters)
  • updated tests because standards in rads.data::misc_chi_byvars changed

dcolombara and others added 18 commits May 9, 2025 15:16
 - chi_race_7 is no longer in rads.data::misc_chi_byvars
 - replaced it with race4 in the test helper file and test-chi_calc()
 - confirmed now passes all tests
Critical fix to update to latest CHI standards
 - based heavily on rads::suppress
 - main improvement is that it suppresses on denominators (not just numerators)
 - also add caution when numerator == 0
 - more validation
 - more customizable arguments, but defaults are for CHI output
 - many more tests
 - passes all tests without errors or warnings in devtools::check()
 - gets latest version from main on GitHub
 - get local version
 - compares and gives notice if you're behind
 - passes all tests
fucntion to check if latest version installed
 - added to the columns_to_suppress default
 - no other changes needed because validation of columns_to_suppress
   already notifies of missing columns and will remove from columns_to_suppress
 - gets latest version from main on GitHub
 - get local version
 - compares and gives notice if you're behind
 - passes all tests
- Implements request batching to minimize get_population database calls by
  consolidating similar queries -- this can save substantial amounts of time
 - Adds `is_chars` parameter to support CHARS data processing where King County
   is defined by ZIP codes beginning with #980 | #981
 - Refactor code into modular helper functions for maintenance and troubleshooting
 - Fixes issue in process_template_row() function parameter reference
 - Fixed assign_geographic_crosswalks() helper function which did not have
   catvarname passed as a parameter and was looking for it in the wrong scope.
   This fix allowed for the output of pov200grp (which is defined by zip or block)
 - Fixed error for 'race' where it looked for 'Race/ethnicity' for the cat#_group
   but it shoudl have looked for 'Race/Ethnicity' (capitalization matters!)
 - Output structure is identical to previous verison of the function
 - separate helper functions into a distinct file
 - pass only necessary subset of population data to
   process_template_row() to avoid memory problems
 - allow for sequential processing if future plan not set
 - improved helpfile with example of how to set-up futures
- tested successfully with Ron's death ETL
 - implemented for rads.data and requested by
   Daniel for rads, so adding to apde.chi.tools
   for consistency
- updated from rads::suppress to apde.chi.tools::chi_suppress_results
- specify definitions of values when have NA or zero for numerator and or denominator
Refactored `chi_get_proper_pop`
- faster due to batching population pulls from SQL and post-processing for each row of pop.template
- improved memory management when using future_lapply (dividing and saving population data rather than passing one huge reference file)
- improved helpfile, with description of how to set up future plan
- tested with death, chars, and birth data

Fixed `chi_calc()`
- Correctly ascribe SE and RSE when numerator or denominator is zero or NA 
- call on `chi_suppress_results()` rather than `rads::suppress()`
abstract check for latest version to a function
 - now gives a warning and drops rows outside of the available range
 - added qs to imports
 - changed .() to list() in chi_get_proper_pop()
chi_calc validation & address devtools::check
@dcolombara dcolombara merged commit 6a93c14 into main May 17, 2025
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