Skip to content

Conversation

jhnwllr
Copy link
Collaborator

@jhnwllr jhnwllr commented Jul 4, 2025

@jhnwllr jhnwllr changed the title adding support for collections adding support for GRSciColl endpoints Jul 7, 2025
@jhnwllr jhnwllr requested a review from Copilot July 8, 2025 11:33
Copilot

This comment was marked as outdated.

@jhnwllr jhnwllr requested a review from Copilot July 8, 2025 12:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

@Copilot Copilot AI left a 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 and institution_export functions (with tests and fixtures)
  • Introduce collection_search and collection_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 in institution_search. Consider adding conv_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 sends masterSourceType. Add conv_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 its contents 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 R c() function and can be confusing. Consider a more descriptive name like res_country or ctx.
  c <- institution_search(country = "US;GB", limit=1)

Comment on lines 272 to 275
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
Copy link

Copilot AI Jul 8, 2025

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.

Suggested change
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,
Copy link

Copilot AI Jul 8, 2025

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.

Suggested change
format = NULL,

Copilot uses AI. Check for mistakes.

@jhnwllr jhnwllr merged commit ac4e2ff into master Jul 8, 2025
7 checks passed
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.

1 participant