-
Notifications
You must be signed in to change notification settings - Fork 21
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
Refactor oa_fetch parameters #182
Comments
Discussion point.I think this discussion is linked to the question, how power user arguments should be handled (pages, cursor, per_page, ...) while at the same time keep the usage for the non-power user as simple (probably even simpler?) as it is. The question of separating the arguments into power user arguments in Argument provisionI like the simplicity to supply OpenAlex parameter using the ellipsis |
Assuming that we should move some parameters out, and those parameters are a significant chunk, one could imagine an interface where we move "power user" related options into a single argument, where the argument can take a constructor function that specifies those power user settings in bulk. This is an alternative to passing everything down For what it's worth, the construction function design is how things are usually implemented in the modelling world. For example, args(lme4::lmer)
#> function (formula, data = NULL, REML = TRUE, control = lmerControl(),
#> start = NULL, verbose = 0L, subset, weights, na.action, offset,
#> contrasts = NULL, devFunOnly = FALSE) But crucially, it also has a args(lme4::lmerControl)
#> function (optimizer = "nloptwrap", restart_edge = TRUE, boundary.tol = 1e-05,
#> calc.derivs = TRUE, use.last.params = FALSE, sparseX = FALSE,
#> standardize.X = FALSE, check.nobs.vs.rankZ = "ignore", check.nobs.vs.nlev = "stop",
#> check.nlev.gtreq.5 = "ignore", check.nlev.gtr.1 = "stop",
#> check.nobs.vs.nRE = "stop", check.rankX = c("message+drop.cols",
#> "silent.drop.cols", "warn+drop.cols", "stop.deficient",
#> "ignore"), check.scaleX = c("warning", "stop", "silent.rescale",
#> "message+rescale", "warn+rescale", "ignore"), check.formula.LHS = "stop",
#> check.conv.grad = .makeCC("warning", tol = 0.002, relTol = NULL),
#> check.conv.singular = .makeCC(action = "message", tol = formals(isSingular)$tol),
#> check.conv.hess = .makeCC(action = "warning", tol = 1e-06),
#> optCtrl = list(), mod.type = "lmer") |
Yes - and these can be saved in using |
This comment was marked as off-topic.
This comment was marked as off-topic.
I can definitely look at implementation, as I have used similar approaches in other projects, but we should first agree on going in this direction, and which parameters should be dealt with first. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@trangdata Agreed. I will delete the comment here. |
Moved from #179. Suggested by @rkrug.
Which of the following parameters to the OpenAlex query should be moved into/out of
options
?Other special parameters that I think should be kept outside of
options
: filter, page, per_page, cursor (related to paging)Something else to consider is the number of arguments in
oa_fetch
. I'm not sure if there is a recommended style somewhere, but I personally don't wantoa_fetch
to have too many arguments. But I could be convinced otherwise. Note that the the ellipses are already reserved for differentfilter
parameters.The text was updated successfully, but these errors were encountered: