Git Product home page Git Product logo

Comments (5)

khufkens avatar khufkens commented on July 24, 2024

fixed see issue 5

from ecmwfr.

eliocamp avatar eliocamp commented on July 24, 2024

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.

khufkens avatar khufkens commented on July 24, 2024

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.

eliocamp avatar eliocamp commented on July 24, 2024

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.

khufkens avatar khufkens commented on July 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.