-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: general wrapper #26
Conversation
update general_wrapper
… field mapping and a string for return value to state field mapping
Co-authored-by: benwandrew <[email protected]>
Co-authored-by: benwandrew <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is super cool! i hope John Ousterhout* would like the direction we're moving in ;)
one general question for my own understanding (which may be better for me to address in office hours): i'm confused about the relationship between the decorator/wrapper wrap_to_use_state
in delta.py
and this new wrap_to_use_state_general
in wrapper.py
. is the latter not ultimately replacing the former?
*reference to author of a book @hollandjg shared a while ago: https://milkov.tech/assets/psd.pdf
I like the look of this! Would it be sensible to split up the wrapper into two – one which does the input name mapping, and one which does the output wrapping? Then we could use the two independently – perhaps your inner function needs to return two values (say |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great; just got a minor comment for a name change.
pass | ||
|
||
|
||
def wrap_to_use_state_general( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the name be shorted, e.g., wrap_to_state
? I imagine people will be using this a lot, so we might want to give it a short name.
hey @younesStrittmatter , do you think you could refactor this so that there's a wrapper function which just does the input field-name mapping? We could include that as an option in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the general idea of this a lot, and have included a lot of the ideas in #33. Would it be possible to make a simple wrapper function which just does the input-name mapping?
fix: types on state objects for controller
I think this is covered by the newest version of the state object – closing this now. |
Description
a general wrapper that accepts arguments to field mappings as arguments
Type of change