ADR suggestion: user defined component
#131
henrikjacobsenfys
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
We should stop using the I think You need to rethink the serialization for Custom Components. These will be arbitrary functions which might not easily go through our |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I vibe coded this, looks interesting: and this: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I haven't found the right name yet -
UserComponent?CustomComponent?Basically, users will have needs that I cannot predict. One asked for an exponential function, but what's next? I want to allow them to define their own function.
Syntax
I think the most straightforward thing is that the users define a function in a file, e.g.
They then create a
CustomComponentlike this:And use it like any other component.
Implementation
CustomComponentshould then inject the**kwargslike the oldObjBasedid and createParameters and setters and getters out of the variables.It will inherit from
ModelComponent, and it'sevaulatemethod will then have to pass theParameter.valuefrom each of itsParameters tomy_function.It'll of course need checks on the inputs.
This is a rough idea, and I'd love to receive feedback.
Beta Was this translation helpful? Give feedback.
All reactions