reno.pymc.expected_pt_scan_arg_names#

reno.pymc.expected_pt_scan_arg_names(model, as_dict=False, tap_1_only=False)#

Pytensor scan target functions are called with a very specific ordering of function arguments (see https://pytensor.readthedocs.io/en/latest/library/scan.html).

Assuming a scan function signature of def scan(*args):, this function returns a list of the appropriate reference names to put on the left side of a refname1, refname2, ... = args line.

Note that with as_dict, it returns a dictionary of reference strings. This is used directly by pt_sim_step_str, but also includes refs for tap -1 references (to avoid being updated to the “current” timestep) so this is useful for pt_sim_step too

so with as_dict False:

[t, v0, v1, v2_h2, v2, …]

with as_dict True, tap_1_only False:

{“t”: “t”, “v0”: “v0”, “v1_h1”: “v1”, “v1”: “v1”, “v2_h2”: “v2_h2”, “v2_h1”: “v2”, “v2”: “v2”, …}

with as_dict True, tap_1_only True:

{“v1_h1”: “v1”, “v2_h1”: “v2”}

Parameters:
  • model (Model)

  • as_dict (bool)

  • tap_1_only (bool)

Return type:

list[str] | dict[str, str]