From 48903c030b08414e53bbaa96026cc15245a51367 Mon Sep 17 00:00:00 2001 From: lavafreak Date: Wed, 3 Jun 2026 20:32:29 -0600 Subject: [PATCH 1/3] docs: reference template method pattern --- doc/source/examples.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 3ba1064..8c6f32f 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -188,7 +188,11 @@ the stages as they run. Recall from number of phases, each of which has a corresponding method. These phase methods have reasonable :ref:`default implementations ` in the base class, but may be extended or -overridden in your subclasses. +overridden in your subclasses. If you're familiar with software design +patterns, this overall structure follows the `Template Method pattern +`_: the base +class defines the high-level algorithm for running a stage, while +subclasses customize selected steps in that flow. .. literalinclude:: ../../example/ex_4_customizing_stage_behavior.py :language: python From 46935a12e6ae89accece0be81977f617796adfc5 Mon Sep 17 00:00:00 2001 From: lavafreak Date: Thu, 4 Jun 2026 10:17:46 -0600 Subject: [PATCH 2/3] docs: relocate template method note --- doc/source/examples.rst | 6 +----- doc/source/features/stage-implementation-details.rst | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 8c6f32f..3ba1064 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -188,11 +188,7 @@ the stages as they run. Recall from number of phases, each of which has a corresponding method. These phase methods have reasonable :ref:`default implementations ` in the base class, but may be extended or -overridden in your subclasses. If you're familiar with software design -patterns, this overall structure follows the `Template Method pattern -`_: the base -class defines the high-level algorithm for running a stage, while -subclasses customize selected steps in that flow. +overridden in your subclasses. .. literalinclude:: ../../example/ex_4_customizing_stage_behavior.py :language: python diff --git a/doc/source/features/stage-implementation-details.rst b/doc/source/features/stage-implementation-details.rst index 7acf657..f40b705 100644 --- a/doc/source/features/stage-implementation-details.rst +++ b/doc/source/features/stage-implementation-details.rst @@ -124,3 +124,9 @@ customizing): .. note:: You can zoom and pan in the image above. + +If you're familiar with software design patterns, this overall structure +follows the `Template Method pattern +`_: the base +class defines the high-level algorithm for running a stage, while +subclasses customize selected steps in that flow. From c7b8c3a9a315c8c2826f333732f8fa56a9eebdf7 Mon Sep 17 00:00:00 2001 From: "Jason M. Gates" Date: Thu, 4 Jun 2026 10:41:03 -0600 Subject: [PATCH 3/3] style: Switch link syntax Just for consistency, and ease of readability. --- doc/source/features/stage-implementation-details.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/source/features/stage-implementation-details.rst b/doc/source/features/stage-implementation-details.rst index f40b705..26bcf51 100644 --- a/doc/source/features/stage-implementation-details.rst +++ b/doc/source/features/stage-implementation-details.rst @@ -126,7 +126,8 @@ customizing): You can zoom and pan in the image above. If you're familiar with software design patterns, this overall structure -follows the `Template Method pattern -`_: the base -class defines the high-level algorithm for running a stage, while -subclasses customize selected steps in that flow. +follows the `Template Method pattern`_: the base class defines the +high-level algorithm for running a stage, while subclasses customize +selected steps in that flow. + +.. _Template Method pattern: https://refactoring.guru/design-patterns/template-method