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

Custom Transform #9

Open
glennmoy opened this issue Feb 2, 2021 · 1 comment
Open

Custom Transform #9

glennmoy opened this issue Feb 2, 2021 · 1 comment
Labels
new transform New transform request

Comments

@glennmoy
Copy link
Member

glennmoy commented Feb 2, 2021

As mentioned in #5 and #6, a CustomTransform (or some other name) would be useful when one wants to apply some custom function to their data.

This would be quite useful since we then wouldn't have to write a new Transform for each of these.

TODO: MWE

@glennmoy glennmoy added the new transform New transform request label Feb 2, 2021
@nicoleepp
Copy link
Contributor

Something like

"""
    CustomTransform <: Transform

Apply the function passed in to CustomTransform as the transform.
"""
struct CustomTransform <: Transform
    transform_function::Function
    args
end

function _apply!(x::AbstractArray, CT::CustomTransform; kwargs...)
    return CT.transform_function(x, ct.args...; kwargs...)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new transform New transform request
Projects
None yet
Development

No branches or pull requests

2 participants