Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.0.0 #64

Merged
merged 7 commits into from
Jan 22, 2025
Merged

Version 1.0.0 #64

merged 7 commits into from
Jan 22, 2025

Conversation

RobLBaker
Copy link
Member

Includes breaking changes such as removing get_data_package_deprecated and changes to documentation in multiple functions.

@RobLBaker RobLBaker added the documentation Improvements or additions to documentation label Jan 22, 2025
@RobLBaker RobLBaker requested a review from wright13 January 22, 2025 15:59
@RobLBaker RobLBaker self-assigned this Jan 22, 2025
Copy link
Collaborator

@wright13 wright13 left a comment

Choose a reason for hiding this comment

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

It looks like get_unit_code, get_park_code, get_unit_code_info, get_unit_info share a lot of code in common (including the API request I think?). At some point, not necessarily as part of this PR, it might be good to have a single function that fetches the unit info from IRMA and gets called by the rest.

In general looks good, and I don't think anything I've commented on necessarily has to change for this release.

@@ -11,7 +11,7 @@
#'
#' @importFrom magrittr %>%
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of importing the magrittr pipe in individual functions, I'd recommend using usethis::use_pipe() to make it available throughout the whole package (and, optionally, re-export it so that users don't have to load magrittr in order to use the pipe themselves - not sure what the best practice on that is though)

Copy link
Collaborator

Choose a reason for hiding this comment

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

after some googling, I can't find any reason not to re-export the pipe (usethis::use_pipe(export = TRUE))

alpha <- dat %>% dplyr::filter(grepl(unit, FullName, ignore.case = TRUE)) # filter FullName for input
dat <- XML::xmlToDataFrame(result)
# pare down the output some
dat <- dat[, c(1, 3, 5, 7, 8, 9, 11, 13)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe consider referring to columns by name here, for clarity and so that we don't get weird behavior if column order changes

Copy link
Collaborator

Choose a reason for hiding this comment

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

similar situation in the rest of the functions here

@RobLBaker
Copy link
Member Author

These are definitely the oldest functions in the package and need a re-write to consolidate them, reduce API calls and file downloads, and probably even some thinking about whether they should be included in the package at all (what is their utility?). But for now, it works so merging ahead!

@RobLBaker RobLBaker merged commit e2310f7 into nationalparkservice:master Jan 22, 2025
5 checks passed
@wright13
Copy link
Collaborator

These are definitely the oldest functions in the package and need a re-write to consolidate them, reduce API calls and file downloads, and probably even some thinking about whether they should be included in the package at all (what is their utility?). But for now, it works so merging ahead!

Makes sense! I could see these functions, or an updated version of them, eventually becoming part of an R package that's just a wrapper for the DataStore API (but I think that involves some work on the API itself first).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants