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

[feat] Add EsgfQuery class to wrap ESGF search RESTful APIs #73

Merged
merged 18 commits into from
Oct 9, 2022

Conversation

hongyuanjia
Copy link
Member

@hongyuanjia hongyuanjia commented Oct 8, 2022

Pull request overview

This is a big PR with a lot of refactorings and new features.

  • Follow the tidyverse style, the name of environment to store the internal state has been changed from EPWSHIFTR_ENV to this.
  • A new R6 class EsgfQuery has been added to wrap the ESGF search RESTful APIs in a more flexible way. This allows to build a query in a step by step, e.g. query_esgf()$project("CMIP6")$activity_id("ScenarioMIP")$experiment_id(!"ssp126")$collect(). This solves Refactor esgf_query() to enable a step-by-step query builder #63 and Use offset for query result pagination #65.
  • TBH, the function name of the EsgfQuery$new() should be esgf_query(). Unfortunately, this name has been taken.
  • esgf_query() has also utilized the new query URL encoding function. This solves Use utils:URLencode() #62. Note that utils::URLencode() is not used, since it also encodes other characters like !, +, etc.
  • Complete the test migration to use {testthat} 3rd edition.

@hongyuanjia hongyuanjia linked an issue Oct 8, 2022 that may be closed by this pull request
@hongyuanjia hongyuanjia self-assigned this Oct 8, 2022
@hongyuanjia hongyuanjia added this to the v0.2.0 milestone Oct 8, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2022

Codecov Report

Merging #73 (0d0ff9c) into master (ce7dadb) will decrease coverage by 0.02%.
The diff coverage is 99.71%.

@@            Coverage Diff             @@
##           master      #73      +/-   ##
==========================================
- Coverage   99.82%   99.80%   -0.03%     
==========================================
  Files           7        8       +1     
  Lines        1678     2005     +327     
==========================================
+ Hits         1675     2001     +326     
- Misses          3        4       +1     
Impacted Files Coverage Δ
R/morph.R 100.00% <ø> (ø)
R/utils.R 96.87% <92.30%> (-3.13%) ⬇️
R/dict.R 99.75% <100.00%> (+<0.01%) ⬆️
R/esgf.R 100.00% <100.00%> (ø)
R/netcdf.R 99.48% <100.00%> (ø)
R/query.R 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hongyuanjia hongyuanjia marked this pull request as ready for review October 9, 2022 07:31
@hongyuanjia hongyuanjia merged commit cc62c23 into master Oct 9, 2022
@hongyuanjia hongyuanjia deleted the 62-use-utilsurlencode branch October 9, 2022 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants