-
Notifications
You must be signed in to change notification settings - Fork 49
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
refactor[next]: itir embedded: cleaner closure run #1521
Conversation
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 good. My only concern is about improving the documentation and usage of the new_context()
function.
src/gt4py/next/embedded/context.py
Outdated
@@ -62,4 +60,4 @@ def ctx_updater(*args: tuple[cvars.ContextVar[Any], Any]) -> None: | |||
|
|||
|
|||
def within_context() -> bool: |
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'd rename it to something like within_valid_context()
and add a docstring to this function also.
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.
ILGTM.
This enables to run the closure also outside of the fendef context, e.g. from field view embedded.