Skip to content

Commit f723b49

Browse files
committed
DOC(modifs): explain Diacritics, +term synonym
1 parent 4dc52c2 commit f723b49

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

docs/source/arch.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Architecture
252252
- operation *needs* & *provides* are zipped against the underlying function's
253253
arguments and results.
254254

255-
These matchings are affected by `modifier`\s.
255+
These matchings are affected by `modifier`\s, print-out with `diacritic`\s.
256256

257257
needs
258258
fn_needs
@@ -299,10 +299,15 @@ Architecture
299299
over which `outputs` were actually produced, or to cancel `sideffects`.
300300

301301
modifier
302+
diacritic
302303
A `modifier` change `dependency` behavior during `compilation` or `execution`.
303304

304305
For instance, `needs` may be annotated as `optionals` function arguments,
305-
`provides` and *needs* can be annotated as "ghost" `sideffects`
306+
`provides` and *needs* can be annotated as "ghost" `sideffects`.
307+
308+
.. include:: ../../graphtik/modifiers.py
309+
:start-after: .. diacritics-start
310+
:end-before: .. diacritics-end
306311

307312
See :mod:`graphtik.modifiers` module.
308313

@@ -331,6 +336,8 @@ Architecture
331336
:start-after: .. varargs-mistake-start
332337
:end-before: .. varargs-mistake-end
333338

339+
In printouts, it is denoted either with ``*`` or ``+`` `diacritic`.
340+
334341
sideffects
335342
A `modifier` denoting a fictive `dependency` linking `operation`\s into virtual flows,
336343
without real data exchanges.
@@ -342,6 +349,7 @@ Architecture
342349

343350
- An *abstract sideffect* modifier (annotated with :func:`.sfx`)
344351
describing modifications taking place beyond the scope of the solution.
352+
It may have just the "optional" `diacritic` in printouts.
345353

346354
- The `sideffected` modifier (annotated with :func:`.sfxed`)
347355
denoting modifications on a *real* dependency read from and written to
@@ -367,7 +375,8 @@ Architecture
367375
the *sideffected dependency* is declared both as *needs* and *provides*
368376
of some operation.
369377

370-
It is annotated with :func:`.sfxed`.
378+
It is annotated with :func:`.sfxed`; it may have all `diacritic`\s
379+
in printouts.
371380

372381
reschedule
373382
rescheduling

graphtik/modifiers.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010
This module (along with :mod:`.op` & :mod:`.pipeline`) is what client code needs
1111
to define pipelines *on import time* without incurring a heavy price
1212
(~7ms on a 2019 fast PC)
13+
14+
**Diacritics**
15+
16+
.. diacritics-start
17+
18+
When printed, *modifiers* annotate regular or sideffect dependencies with
19+
these **diacritics**::
20+
21+
> : mapped (fn_keyword)
22+
? : optional (fn_keyword)
23+
* : vararg
24+
+ : varargs
25+
26+
.. diacritics-end
1327
"""
1428
import enum
1529
from typing import Optional, Tuple, Union

graphtik/op.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class FunctionalOperation(Operation, Plottable):
221221
.. Tip::
222222
- Use :func:`.operation()` factory to build instances of this class instead.
223223
- Call :meth:`withset()` on existing instances to re-configure new clones.
224+
- See :term:`diacritic`\\s to understand printouts of this class.
224225
"""
225226

226227
def __init__(
@@ -343,7 +344,7 @@ def __hash__(self):
343344

344345
def __repr__(self):
345346
"""
346-
Display more informative names for the Operation class
347+
Display operation & dependency names annotated with :term:`diacritic`\\s.
347348
"""
348349
from .config import (
349350
is_debug,

graphtik/pipeline.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ class Pipeline(Operation, Plottable):
5959
An operation that can :term:`compute` a network-graph of operations.
6060
6161
.. Tip::
62-
Use :func:`compose()` factory to prepare the `net` and build
63-
instances of this class.
62+
- Use :func:`compose()` factory to prepare the `net` and build
63+
instances of this class.
64+
- See :term:`diacritic`\\s to understand printouts of this class.
6465
"""
6566

6667
#: The name for the new pipeline, used when nesting them.

0 commit comments

Comments
 (0)