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

Implement "Zip" pipeline element #276

Open
jgpruitt opened this issue Oct 18, 2021 · 0 comments
Open

Implement "Zip" pipeline element #276

jgpruitt opened this issue Oct 18, 2021 · 0 comments
Labels
feature-request And area of analysis that could be made easier

Comments

@jgpruitt
Copy link

I would like to be able to use function pipelines to combine multiple timevectors according to a calculation -- something like zip from functional programming.

select tv1 -> zip(tv2, $lambda$ $value1 * $value2 $lambda$)

The above snippet illustrates what I'm thinking. A timevector tv1 has the zip pipeline element applied to it. The element takes a second timevector tv2 and a lambda as an argument. The data points from tv1 and tv2 are matched on times and the values are combined by applying the lambda which should produce a single result. Values from tv1 are referred to by $value1 in the lambda, and values from tv2 are referred to by $value2.

This could be extended to more than two timevectors potentially using a variadic parameter:

select tv1 -> zip($lambda$ $value1 * $value2 + $value3 $lambda$, tv2, tv3)

Without something like zip, one would need to "render" tv1 and tv2 using something like the unnest pipeline element, join the two on times, compute the new value using the calculation, form a new timevector, and then pass it on potentially to the rest of the pipeline.

@jgpruitt jgpruitt added the feature-request And area of analysis that could be made easier label Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request And area of analysis that could be made easier
Projects
None yet
Development

No branches or pull requests

1 participant