-
Notifications
You must be signed in to change notification settings - Fork 51
adding support for GRSciColl endpoints #793
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
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the new GRSciColl API endpoints, exposing institution_search
/institution_export
and collection_search
/collection_export
functions in the rgbif
package. It includes new tests with VCR fixtures, updated documentation/man pages, NAMESPACE exports, pkgdown configuration, and bumps the package version.
- Introduce
institution_search
andinstitution_export
functions (with tests and fixtures) - Introduce
collection_search
andcollection_export
functions (with tests and fixtures) - Update documentation, NAMESPACE, and
_pkgdown.yml
to expose the new endpoints
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tests/testthat/test-institution_search.R | Add unit tests for institution search/export |
tests/testthat/test-collection_search.R | Add unit tests for collection search/export |
tests/fixtures/*.yml | Add VCR fixtures for the new endpoints |
R/institution_search.R | Implement institution_search & institution_export |
R/collection_search.R | Implement collection_search & collection_export |
man/institution_search.Rd | Add help page for institution endpoints |
man/collection_search.Rd | Add help page for collection endpoints |
_pkgdown.yml | Add GRSciColl reference section |
NAMESPACE | Export new functions |
DESCRIPTION | Bump package version |
Comments suppressed due to low confidence (5)
R/institution_search.R:195
- The
masterSourceType
parameter is accepted in the signature but never sent to the API ininstitution_search
. Consider addingconv_many(masterSourceType)
to the compacted args so the filter actually works.
convmany(identifierType)
R/institution_search.R:297
- Similarly to the search function,
institution_export
never sendsmasterSourceType
. Addconv_many(masterSourceType)
so that filter is respected on exports.
args,
R/collection_search.R:50
- [nitpick] The
@param alternativeCode
tag is duplicated in the docs header. Remove the redundant entry to keep the documentation clear.
#' @param alternativeCode Alternative code of a GrSciColl institution or
_pkgdown.yml:62
- [nitpick] The indentation for the GRSciColl section looks misaligned; ensure
- title
and itscontents
entries use the same indent level as other reference sections so they appear correctly on the site.
- title: "GRSciColl"
tests/testthat/test-institution_search.R:8
- [nitpick] Using
c
as a variable name shadows the base Rc()
function and can be confusing. Consider a more descriptive name likeres_country
orctx
.
c <- institution_search(country = "US;GB", limit=1)
R/institution_search.R
Outdated
warning("Only 'TSV' format is supported for collection_export") | ||
} | ||
if(!is.null(limit) | !is.null(offset)) { | ||
warning("Limit and offset are ignored for collection_export. The full export |
Copilot
AI
Jul 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning appears in institution_export
but refers to collection_export
. Update the message to mention institution_export
or remove it if not needed.
warning("Only 'TSV' format is supported for collection_export") | |
} | |
if(!is.null(limit) | !is.null(offset)) { | |
warning("Limit and offset are ignored for collection_export. The full export | |
warning("Only 'TSV' format is supported for institution_export") | |
} | |
if(!is.null(limit) | !is.null(offset)) { | |
warning("Limit and offset are ignored for institution_export. The full export |
Copilot uses AI. Check for mistakes.
sortOrder = NULL, | ||
offset = NULL, | ||
limit = NULL, | ||
format = NULL, |
Copilot
AI
Jul 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The format
argument in institution_search
is never used. Consider removing it or wiring it into the request if intended.
format = NULL, |
Copilot uses AI. Check for mistakes.
#554