Comments (5)
fixed see issue 5
from ecmwfr.
Hi! I'm aware that this would be a breaking change but, if I may give my opinion, for me the "natural" order is to have request
as the first argument. For me, the user is a mere technicality, and the important bit is what data I want to request/transfer. The user is also a parameter that probably doesn't change a lot.
Having it as the first argument would also make it pipable. So the if an user had a custom function that builds the request, they could do something like:
build_request("era4", "gepotential") %>%
wf_request(...)
Or, with a list of requests:
walk(request_lists, wf_request)
Anyway. That's my two cents. Feel free to ignore!
from ecmwfr.
Interesting idea, would this really break that many items? I don't think I call things blindly anywhere within the package, as with above.
This being said, I'm not a big fan of the pipes and in general the tidyverse way of doing things. It is good, but mostly for people who already know what they are doing. It can be a hellhole if you don't wrap your head around a simple loop first. Just my $.02.
from ecmwfr.
Yes, it takes a while to get use to using pipes. I only use it for the most simple tasks because I get lost otherwise (and it's also harder to debug).
In any case, even with no pipes, at least in my workflow I feel that the request
argument is the important one that changes more often. Maybe there are people that use many different users and feel differently. It's fairly subjective.
Changing the order of arguments would break any scripts that call wf_request()
without naming arguments. It would probably be nice to have a catch like:
if (is.character(request)) {
stop("request must be a named list. Argument order changed in version x.x.x")
}
from ecmwfr.
I'm not against pipes, but I use them sparingly in my own projects, even less or not if I can avoid it in packages. Find them hard to debug if shit hits the fan, especially unwieldy "one liners".
So sounds, good, trap the error like this and provide the option to play with pipes. More functionality I would say.
from ecmwfr.
Related Issues (20)
- `wf_requests_batch()` accepts requests that overwrite each other HOT 3
- `wf_request_batch()` with `transfer=FALSE` HOT 12
- batch requests: Send a new request as soon as one is downloaded HOT 8
- Daily averages using CDS API HOT 28
- Empty CDS queue after download HOT 4
- CRAN release 1.5.0
- wf_set_key gives pop up message 'Keyring password' HOT 12
- Decomissioning WebAPI service HOT 2
- wf_transfer failed actually stops loops. HOT 2
- Error when requesting data HOT 12
- Addressing failure of long batch jobs HOT 1
- SVG version of logo HOT 2
- Unlock keyring in (headless) scripts
- Check status of WebAPI?
- Failed HTTP request (500) in update_status() breaks wf_request() for CDS HOT 8
- Errore: Data identifier cems-fire-historical-v1 is not found in Web API, CDS or ADS datasets. Or your login credentials do not match your request. HOT 1
- Migration CDS/ADS -- anticipated package failure HOT 5
- Use {cli} for nice messaging
- Increase unit tests / code coverage HOT 4
- Confused by the new update of `wf_transfer()` HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecmwfr.