You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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...
The text was updated successfully, but these errors were encountered:
sgoldenCS
changed the title
Function to module builder
function-to-module builder
Aug 5, 2024
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
In this example, the configuration would simply be the kwargs passed to my_transform and the
run()
ortransform()
function in the module class would simply callmy_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...
The text was updated successfully, but these errors were encountered: