[W]e could really use some type annotations for arguments like this. I honestly don't know the exact form of a valid kernel type (other than that it's a callable of some sort), so this is one instance where the type info really helps. In order to figure this out, I would have to trace where it's used in this codebase, and/or guess and check.
A custom type (alias) that explicitly ties together the functions in this library that construct valid kernel arguments is really all that's necessary to answer basic questions, so there's no need to delve much deeper than KernelType = Callable[[...], ...]—although something like KernelType = NewType("KernelType", Callable[[...], ...]) might be better for maintaining the "this function takes/outputs acceptable kernels" information when the local variable name KernelType isn't present in context (e.g. some Mypy reporting).
[W]e could really use some type annotations for arguments like this. I honestly don't know the exact form of a valid
kernel
type (other than that it's a callable of some sort), so this is one instance where the type info really helps. In order to figure this out, I would have to trace where it's used in this codebase, and/or guess and check.A custom type (alias) that explicitly ties together the functions in this library that construct valid
kernel
arguments is really all that's necessary to answer basic questions, so there's no need to delve much deeper thanKernelType = Callable[[...], ...]
—although something likeKernelType = NewType("KernelType", Callable[[...], ...])
might be better for maintaining the "this function takes/outputs acceptable kernels" information when the local variable nameKernelType
isn't present in context (e.g. some Mypy reporting)._Originally posted by @brandonwillard in https://github.com/aesara-devs/aehmc/pull/66#discussion_r915285566_