Skip to content

Refactor to add set_tigris_year() and incorporate validate_ functions#205

Open
elipousson wants to merge 23 commits into
walkerke:masterfrom
elipousson:feat-arg-checks
Open

Refactor to add set_tigris_year() and incorporate validate_ functions#205
elipousson wants to merge 23 commits into
walkerke:masterfrom
elipousson:feat-arg-checks

Conversation

@elipousson

@elipousson elipousson commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

Here are the changes focused on continued improvements to validation

  • Revise state/county checks to use new require_ and multiple parameters
  • Add set_tigris_year to reduce duplicate code + improve validation
  • Add year_suffix() helper function for readability
  • Add match_resolution() function
  • Add check_cb() function to validate cb argument
  • Replace calls to stop w/ cli_abort + message w/ cli_inform
  • Expand tests to cover new features and improve coverage

Other related clean-up changes include:

  • Remove .data operator (deprecated in tidyselect 1.2.0)
  • Minor style clean-up
  • Tidy DESCRIPTION
  • Remove uuid from Imports (it was unused)
  • Remove ggthemes from Suggests (replacing theme_map w/ theme_void
  • Remove tidycensus from Suggests to avoid a recursive dependency

- Revise state/county checks to use new `require_` and `multiple` parameters
- Add `set_tigris_year` to reduce duplicate code + improve validation
- Add `year_suffix()` helper function for readability
- Add `match_resolution()` function
- Replace calls to stop w/ cli_abort + message w/ cli_inform
- Remove .data operator (deprecated in tidyselect 1.2.0)
- Minor style clean-up
Unnecessary after prefixing fips_code
Reorganize test for enumeration units by function
Also swap email for Eli Pousson
`theme_void()` is equivalent to `ggthemes::theme_map()` so dropped ggthemes from examples
Issue due to removal of .data
Add test for new_england error
Simplify `check_tigris_year()` by removing function name from message and dropping "To request this feature, file an issue" suggestion

Add `not_year` argument to exclude years between min/max values
Remove duplicative check for year < 1990 (couldn't be triggered)

Remove call to cli_abort w/ no message (for years 2001-2009
Revert change to set_tigris_year message
Relocate match_resolution function to calls w/ cb = TRUE
Remove repetitive calls to local_options
Drop tidycensus from Suggests
Also add tests for list_states, filter_state, and grep_state
@elipousson

Copy link
Copy Markdown
Contributor Author

Hey @walkerke! It has been a while but I pushed a couple updates to this PR so it works with the latest version of roxygen. I also swapped cli_inform for cli_bullets so the message can be suppressed by suppressMessages. Let me know if do anything else to prep this for review.

@walkerke

Copy link
Copy Markdown
Owner

Thanks! I'll dig in soon.

As an FYI - tigris is going to go through a full modernization this summer so I'll be weaving a lot of your work into that.

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