Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions arraycontext/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,12 @@ def compile(self, f: Callable[..., Any]) -> Callable[..., Any]:
"""
return f

# Supporting interface for function/call tracing in actx implementations
def trace_call(self, f: Callable[..., Any],
*args, identifier=None, **kwargs):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing return type annotation. More generally, trace_call really should permit the user to do two things:

  • Use the result of the traced call.
  • Call the trace result using new data.

I'm not sure we'll be able to do both with just a single return value.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also want the interface to apply tags to the call site.

"""Returns the result of the called function *f* with the specified args."""
return f(*args, **kwargs)

# undocumented for now
@property
@abstractmethod
Expand Down
Loading