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

Provide function in index arrays? #22

Open
mschubert opened this issue Mar 1, 2018 · 0 comments
Open

Provide function in index arrays? #22

mschubert opened this issue Mar 1, 2018 · 0 comments
Labels

Comments

@mschubert
Copy link
Owner

mschubert commented Mar 1, 2018

This refers to indexing as in lambda.r#L14-L19 (multiple arrays, multiple axes, index as data.frame).

Idea:

  • This could be provided as a separate function (analogous to group)
  • The index could be filtered (e.g. to iterate 2 arrays together instead of every combination)
  • lambda could take an index instead of the along argument

Issues:

  • The index wouldn't know necessarily know which axis it was derived from
    • could be solved by adding along attribute to df
    • or wrapping the function call to subset indices (as below)
  • HPC calls like clustermq::Q_rows would not be able to call a function with the indexed object instead of the index of the object
    • instead of just creating the index we could also create a wrapped function call that does the subsetting (would no longer require along attr on df)
    • or lambda could do this if given an index (but how to do custom cmq calls then?)
    • wouldn't this be essentially exporting the wrapper function in lambda?

Proposed solution:

  • Provide indexing function that returns both the index and a function that wraps the call around the index (this way it could be processed by e.g. purrr::pmap, clustermq::Q_rows)
  • lambda/wrapper should work on lists of args instead of row number (so it can be used as a wrapping function and more generalizable for other tools like purrr)
  • lambda/wrapper:simplify shouldn't this all be handled by the same construct call?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant