@@ -171,21 +171,23 @@ class CompositeProcessor(
171171 typing .Generic [SettingsType , MessageInType , MessageOutType ],
172172):
173173 """
174- A processor that chains multiple processor together in a feedforward non-branching graph.
174+ A processor that chains multiple processors together in a feedforward non-branching graph.
175175 The individual processors may be stateless or stateful. The last processor may be a consumer,
176- otherwise processors must be transformers. Use CompositeProducer if you want the first
177- processor to be a producer. Concrete subclasses must implement `_initialize_processors`.
178- Optionally override `_reset_state` if you want adaptive state behaviour.
179- Example implementation:
180-
181- class CustomCompositeProcessor(CompositeProcessor[CustomSettings, AxisArray, AxisArray]):
182- @staticmethod
183- def _initialize_processors(settings: CustomSettings) -> dict[str, BaseProcessor]:
184- return {
185- "stateful_transformer": CustomStatefulProducer(**settings),
186- "transformer": CustomTransformer(**settings),
187- }
188- Where **settings should be replaced with initialisation arguments for each processor.
176+ otherwise processors must be transformers. Use ``CompositeProducer`` if you want the first
177+ processor to be a producer. Concrete subclasses must implement ``_initialize_processors``.
178+ Optionally override ``_reset_state`` if you want adaptive state behaviour.
179+
180+ Example implementation::
181+
182+ class CustomCompositeProcessor(CompositeProcessor[CustomSettings, AxisArray, AxisArray]):
183+ @staticmethod
184+ def _initialize_processors(settings: CustomSettings) -> dict[str, BaseProcessor]:
185+ return {
186+ "stateful_transformer": CustomStatefulProducer(**settings),
187+ "transformer": CustomTransformer(**settings),
188+ }
189+
190+ Where ``**settings`` should be replaced with initialisation arguments for each processor.
189191 """
190192
191193 def __init__ (self , * args , ** kwargs ) -> None :
0 commit comments