From 92cd62ba53d62587b5d7b4fa1fd35825f73f7edd Mon Sep 17 00:00:00 2001 From: Frederik Hennig <frederik.hennig@fau.de> Date: Fri, 8 Nov 2024 16:35:50 +0100 Subject: [PATCH] fix two minor doc errors --- src/pystencils/backend/ast/iteration.py | 4 ++-- src/pystencils/backend/ast/util.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pystencils/backend/ast/iteration.py b/src/pystencils/backend/ast/iteration.py index cc666c722..a3152863a 100644 --- a/src/pystencils/backend/ast/iteration.py +++ b/src/pystencils/backend/ast/iteration.py @@ -10,7 +10,7 @@ def dfs_preorder( Args: node: The tree's root node - filter_pred: Filter predicate; a node is only returned to the caller if `yield_pred(node)` returns True + filter_pred: Filter predicate; a node is only returned to the caller if ``yield_pred(node)`` returns True """ if filter_pred(node): yield node @@ -26,7 +26,7 @@ def dfs_postorder( Args: node: The tree's root node - filter_pred: Filter predicate; a node is only returned to the caller if `yield_pred(node)` returns True + filter_pred: Filter predicate; a node is only returned to the caller if ``yield_pred(node)`` returns True """ for c in node.children: yield from dfs_postorder(c, filter_pred) diff --git a/src/pystencils/backend/ast/util.py b/src/pystencils/backend/ast/util.py index 288097a90..27a643054 100644 --- a/src/pystencils/backend/ast/util.py +++ b/src/pystencils/backend/ast/util.py @@ -20,7 +20,7 @@ def failing_cast(target: type | tuple[type, ...], obj: Any) -> Any: class AstEqWrapper: """Wrapper around AST nodes that computes a hash from the AST's textual representation - and maps the `__eq__` method onto `structurally_equal`. + and maps the ``__eq__`` method onto `structurally_equal <PsAstNode.structurally_equal>`. Useful in dictionaries when the goal is to keep track of subtrees according to their structure, e.g. in elimination of constants or common subexpressions. -- GitLab