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

Incorrect display of filename in wf_transfer #152

Open
Rafnuss opened this issue Dec 12, 2024 · 2 comments
Open

Incorrect display of filename in wf_transfer #152

Rafnuss opened this issue Dec 12, 2024 · 2 comments

Comments

@Rafnuss
Copy link
Contributor

Rafnuss commented Dec 12, 2024

I really like this feature of showing in the console which code you can run in case the code crash. But there seems to be an issue when using wf_request_batch

library(ecmwfr)

request_list = list()

for (i in c(1,2)){
  print(i)
  request_list[[i]] <- list(
    dataset_short_name = "reanalysis-era5-pressure-levels",
    product_type = "reanalysis",
    format = "netcdf",
    variable = "pressure",
    pressure_level = c(1, 2, 3),
    year = "2010",
    month = "1",
    day = "2",
    time = "13:00",
    area = c(1,0,0,1), # N, W, S, E
    target = glue::glue("test_{i}.nc")
    )
    }

ecmwfr::wf_request_batch(
  request_list,
  path = "~/Downloads/"
)

This will give you:

wf_transfer(
  url = 'https://cds.climate.copernicus.eu/api/retrieve/v1/jobs/52df1030-01bd-41b1-802b-7aa8e8754081',
  path = '~/Downloads/',
  filename = '~/Downloads//test_1'
)

instead of

wf_transfer(
  url = 'https://cds.climate.copernicus.eu/api/retrieve/v1/jobs/52df1030-01bd-41b1-802b-7aa8e8754081',
  path = '~/Downloads/',
  filename = 'test_1.nc'
)
@Rafnuss
Copy link
Contributor Author

Rafnuss commented Dec 12, 2024

I've been trying to find a fix for this, but I don't fully undestand that is happening. A bad solution is to replace file by basename(file) in

ecmwfr/R/zzz.R

Line 237 in bd7bf26

file,

but I suspect that this should be dealt with somewhere else?

@khufkens
Copy link
Member

I'll put it on my todo list. Not a high priority right now though.

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

No branches or pull requests

2 participants