Skip to content

Commit

Permalink
Merge pull request #138 from bluegreen-labs/v2-bug-fix-round-1
Browse files Browse the repository at this point in the history
V2 bug fix round 1
  • Loading branch information
khufkens authored Aug 25, 2024
2 parents 96681bd + 46fd39f commit bb682f7
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Depends:
R (>= 4.2)
Imports:
httr,
keyring,
memoise,
getPass,
curl,
Expand All @@ -44,6 +43,7 @@ License: AGPL-3
ByteCompile: true
RoxygenNote: 7.3.1
Suggests:
keyring,
rmarkdown,
covr,
xml2,
Expand Down
2 changes: 1 addition & 1 deletion R/wf_request_batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
wf_request_batch <- function(
request_list,
workers = 2,
user = "ecmwf",
user = "ecmwfr",
path = tempdir(),
time_out = 3600,
retry = 5,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ library("ecmwfr")
## Use: ECMWF Data Store services

Create a ECMWF account by [self
registering](https://accounts.ecmwf.int/auth/realms/ecmwf/login-actions/registration?client_id=cms-www&tab_id=-Wuo-QeT0_k). Once your user account has been verified you can get your personal access token or *key* by visiting one of the Data Stores user profiles, for example the CDS [user profile](https://cds-beta.climate.copernicus.eu/profile).
registering](https://accounts.ecmwf.int/auth/realms/ecmwf/protocol/openid-connect/auth?client_id=cms-www&response_type=code&scope=openid%20email%20profile&redirect_uri=https%3A//www.ecmwf.int/openid-connect/). Once your user account has been verified you can get your personal access token or *key* by visiting one of the Data Stores user profiles, for example the CDS [user profile](https://cds-beta.climate.copernicus.eu/profile).

The Personal Access Token is a long string of letters and numbers:

Expand Down
2 changes: 1 addition & 1 deletion man/wf_request.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 47 additions & 2 deletions vignettes/advanced_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,53 @@ batch_request <- list(
# can't exceed 20)
wf_request_batch(
batch_request,
workers = 2,
user = user
workers = 2
)
```

### Mixing data services in batch requests

It is allowed to mix data services in a batch requests. This allows you to formulate complex multi-service requests. Below you see a simple example using a batch requests for data from both the CDS and ADS services in one pass.

```{r eval=FALSE}
# CDS
cds_request <-
list(
product_type = 'reanalysis',
variable = 'geopotential',
year = '2024',
month = '03',
day = '01',
time = '13:00',
pressure_level = '1000',
data_format = 'grib',
dataset_short_name = 'reanalysis-era5-pressure-levels',
target = 'test.grib'
)
# ADS
ads_request <- list(
dataset_short_name = "cams-global-radiative-forcings",
variable = "radiative_forcing_of_carbon_dioxide",
forcing_type = "instantaneous",
band = "long_wave",
sky_type = "all_sky",
level = "surface",
version = "2",
year = "2018",
month = "06",
target = "download.grib"
)
combined_request <- list(
cds_request,
ads_request
)
files <- wf_request_batch(
combined_request
)
```

Expand Down

0 comments on commit bb682f7

Please sign in to comment.