SCAN: Rename (user-facing) taps to lags and offer nicer constructor #1653
ricardoV94
started this conversation in
Ideas
Replies: 1 comment
-
OTOH Sequences can also have taps (TIL), and they can be both negative and positive. Internally they just show up as distinct inputs, so it's just syntactic sugar. But in this case lags is not such a good name. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Writing multi-lagged inputs to Scan is not very intuitive. You pass a dictionary with
outputs_info={"initial": var, "taps": [-2, -1]}
. I don't usually remember the name of the keys, and also I don't thinktaps
is a great name.Syntatic-sugar suggestion, offer a function
lags
?outputs_info=scan.lags(var, n=2)
that creates the dict? Docstrings can be used to provide useful info for the user: What are lagged inputs, how a minimal step function may look like, what the input order is in the inner function (-2, -1), not (-1, -2), etc....We can also call it
scan.taps
or something else. The main idea is having a function for discoverability / auto-completionNext-level suggestion
If the user uses the lags constructor, the user function doesn't receive separate lagged arguments but a tuple of them?
GPT-5 explanation for the term taps:
Origin: “Taps” comes from signal processing. In FIR/IIR filters you read from a delay line at different “taps” (connection points) to access delayed samples; scan borrowed that for relative time-step reads.
GPT-5 name alternative suggestions:
Short answer
Better name: index_offsets (most general/clear), with time_offsets or lags as good alternates depending on audience.
Details
Why index_offsets: Scan iterates along an axis; the parameter is a set of relative indices w.r.t. the current step (e.g., [-2, -1, 0, +1]). “Index offsets” is precise, axis-agnostic, and conveys sign.
Other viable names (trade-offs):
Beta Was this translation helpful? Give feedback.
All reactions