@@ -28,6 +28,7 @@ def _default_callbacks() -> list[Callback]:
2828
2929 from . import defaults , extraction
3030
31+ # NB When updating this list, also update the docstring of Config.callback
3132 return [defaults , extraction .callback , plot .callback ]
3233
3334
@@ -45,13 +46,17 @@ class Config(ConfigHelper):
4546 #: Shorthand to set :py:`legacy["use"]` on a new instance.
4647 _legacy : InitVar [bool | None ] = False
4748
48- #: List of callbacks for preparing the :class:`.Reporter`.
49+ #: List of callback functions for preparing the :class:`.Reporter`.
4950 #:
5051 #: Each registered function is called by :func:`~.report.prepare_reporter` in order
5152 #: to add or modify the task graph. Specific model variants and projects can
52- #: register a callback to extend the reporting graph.
53+ #: register a callback to extend the reporting graph. The default list is:
5354 #:
54- #: Callback functions **must** take two arguments: the Computer/Reporter, and a
55+ #: 1. :func:`.report.defaults`
56+ #: 2. :func:`.report.extraction.callback`
57+ #: 3. :func:`.report.plot.callback`
58+ #:
59+ #: A callback function **must** take two arguments: the Computer/Reporter, and a
5560 #: :class:`.Context`:
5661 #:
5762 #: .. code-block:: python
@@ -63,7 +68,7 @@ class Config(ConfigHelper):
6368 #: # Modify `rep` by calling its methods ...
6469 #: pass
6570 #:
66- #: # Register this callback on an existing Context instance
71+ #: # Register this callback on an existing Context/report.Config instance
6772 #: context.report.register(cb)
6873 #:
6974 #: See also :attr:`modules`.
@@ -78,7 +83,7 @@ class Config(ConfigHelper):
7883 #: Key for the Quantity or computation to report.
7984 key : "KeyLike | None" = None
8085
81- #: Names of modules with reporting callbacks. See also :attr:`callbacks ` and
86+ #: Names of modules with reporting callbacks. See also :attr:`callback ` and
8287 #: :meth:`iter_callbacks`.
8388 modules : list [str ] = field (default_factory = list )
8489
@@ -106,8 +111,8 @@ def iter_callbacks(self) -> Generator[Callback, None, None]:
106111 """Iterate over callback functions.
107112
108113 1. All module names in :attr:`modules` are passed to :meth:`register`, such that
109- their callback functions are appended to :attr:`callbacks `.
110- 2. The :attr:`callbacks ` are yielded iteratively.
114+ their callback functions are appended to :attr:`callback `.
115+ 2. The :attr:`callback ` are yielded iteratively.
111116 """
112117 for name in self .modules :
113118 self .register (name )
0 commit comments