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

function-to-module builder #44

Open
sgoldenCS opened this issue Aug 5, 2024 · 0 comments
Open

function-to-module builder #44

sgoldenCS opened this issue Aug 5, 2024 · 0 comments

Comments

@sgoldenCS
Copy link
Contributor

A thought about making implementation easier, specifically for very simple transformations/functions.

The general idea is to make a decorator or class that can take in a function and "modularize" it without worrying about boilerplate code for things like configurations, saving/loading.

I'm not exactly sure how this would work, but if you have a simple transformation or plot, you could create a module with something like

@modularize
def my_transform(data, alpha=0, beta=1.2):
    # Write code here
    return transformed_data

In this example, the configuration would simply be the kwargs passed to my_transform and the run() or transform() function in the module class would simply call my_transform(). I'm not sure if this can really be done in a decorator, or if it needs to be a special class that takes a function for the __init__()...

This might not be a good idea, just wanted to document it somewhere...

@sgoldenCS sgoldenCS changed the title Function to module builder function-to-module builder Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant