From 0a5437be04db0ba72f87a73524ee99849f855c6d Mon Sep 17 00:00:00 2001 From: VenishPaneliya <141703684+VenishPaneliya@users.noreply.github.com> Date: Tue, 8 Sep 2026 14:14:04 +0530 Subject: [PATCH] Fix three more docstrings that name parameters the functions do not have Follow-up to #2408, same class of mismatch. `FunctionGraph.import_var` takes `var` but documents `variable`. `replace_patterns` takes `x` but documents `s`; its own summary line already says "Replace `replace` in string `x`". `toposort_with_orderings` documents `outputs`, which is not a parameter, and leaves `blockers` undocumented. It also had the remaining entry backwards: `graphs` was described as "Graph inputs". Both summary lines say otherwise - this function's own reads "between blocker (input) and graphs (output) variables", and `toposort`, which it delegates to, says "between graphs (outputs) and blockers (inputs)". --- pytensor/d3viz/d3viz.py | 2 +- pytensor/graph/fg.py | 2 +- pytensor/graph/traversal.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pytensor/d3viz/d3viz.py b/pytensor/d3viz/d3viz.py index 9f935570e5..d8a5dfc80d 100644 --- a/pytensor/d3viz/d3viz.py +++ b/pytensor/d3viz/d3viz.py @@ -18,7 +18,7 @@ def replace_patterns(x, replace): Parameters ---------- - s : str + x : str String on which function is applied replace : dict `key`, `value` pairs where key is a regular expression and `value` a diff --git a/pytensor/graph/fg.py b/pytensor/graph/fg.py index 7ab6df5477..35bbdc69b9 100644 --- a/pytensor/graph/fg.py +++ b/pytensor/graph/fg.py @@ -321,7 +321,7 @@ def import_var( Parameters ---------- - variable : pytensor.graph.basic.Variable + var : pytensor.graph.basic.Variable The variable to be imported. reason : str The name of the optimization or operation in progress. diff --git a/pytensor/graph/traversal.py b/pytensor/graph/traversal.py index 0cac5791cf..37c082896f 100644 --- a/pytensor/graph/traversal.py +++ b/pytensor/graph/traversal.py @@ -666,9 +666,9 @@ def toposort_with_orderings( Parameters ---------- graphs : list or tuple of Variable instances - Graph inputs. - outputs : list or tuple of Apply instances Graph outputs. + blockers : list or tuple of Variable instances + Graph inputs. orderings : dict Keys are `Apply` or `Variable` instances, values are lists of `Apply` or `Variable` instances.