Skip to content

Commit 4f8e9ba

Browse files
committed
Cleanups following comments from developers
1 parent bc69b38 commit 4f8e9ba

25 files changed

+158
-133
lines changed

doc/_static/phlexframework.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ table.docutils caption {
1616
}
1717

1818
.body {
19-
background-image: url("preliminary-watermark.png");
19+
background-image: url("watermark-preliminary.png");
2020
background-repeat: repeat;
2121
background-size: 100%;
2222
}
370 KB
Loading

doc/appendices/requirements.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ Conceptual requirements
417417

418418
The framework shall accept exactly one configuration per program execution.
419419

420-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
420+
- See :numref:`ch_conceptual_design/program_configuration:Program Configuration`
421421

422422
.. req:: Framework configuration language
423423
:collapse:
@@ -429,7 +429,7 @@ Conceptual requirements
429429

430430
The framework shall provide the ability to configure the execution of a framework program at runtime using a human-readable language.
431431

432-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
432+
- See :numref:`ch_conceptual_design/program_configuration:Program Configuration`
433433

434434
.. req:: I/O plugins
435435
:collapse:
@@ -591,7 +591,7 @@ Conceptual requirements
591591

592592
The framework shall support executing programs configured by composing configurations of separate components.
593593

594-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
594+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
595595

596596
.. req:: Graceful shutdown of framework program
597597
:collapse:
@@ -677,7 +677,7 @@ Supporting requirements
677677

678678
The framework shall provide the ability to compare two configurations.
679679

680-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
680+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
681681

682682
.. req:: Record execution environment
683683
:collapse:
@@ -965,7 +965,7 @@ Supporting requirements
965965

966966
The framework shall validate an algorithm's configuration against specifications provided at registration time.
967967

968-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
968+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
969969

970970
.. req:: Algorithm configuration schema availability
971971
:collapse:
@@ -977,7 +977,7 @@ Supporting requirements
977977

978978
The framework shall have an option to emit an algorithm's configuration schema in human-readable form.
979979

980-
- See :numref:`ch_conceptual_design/user_configuration:Semantic structure of the configuration`
980+
- See :numref:`ch_subsystem_design/configuration:Semantic structure of the configuration`
981981

982982
.. req:: Eager validation of algorithm configuration
983983
:collapse:
@@ -990,7 +990,7 @@ Supporting requirements
990990

991991
The framework shall validate the configuration of each algorithm before that algorithm processes data.
992992

993-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`, :numref:`ch_conceptual_design/user_configuration:Semantic structure of the configuration`.
993+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`, :numref:`ch_subsystem_design/configuration:Semantic structure of the configuration`.
994994

995995
.. req:: I/O backend for ROOT
996996
:collapse:
@@ -1143,7 +1143,7 @@ Supporting requirements
11431143

11441144
The framework shall provide an option to persist the configuration of each framework execution to the output of that execution.
11451145

1146-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
1146+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
11471147

11481148
.. req:: Independence from unique hardware characteristics
11491149
:collapse:
@@ -1166,7 +1166,7 @@ Supporting requirements
11661166

11671167
The framework shall provide a command-line interface that allows the setting of configuration parameters.
11681168

1169-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
1169+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
11701170

11711171
.. req:: Support local configuration changes
11721172
:collapse:
@@ -1177,7 +1177,7 @@ Supporting requirements
11771177

11781178
The framework shall support the use of local configuration changes with respect to a separate complete configuration to modify the execution of a program.
11791179

1180-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
1180+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
11811181

11821182
.. req:: Configuration tracing
11831183
:collapse:
@@ -1188,7 +1188,7 @@ Supporting requirements
11881188

11891189
The framework configuration system shall have an option to provide diagnostic information for an evaluated configuration, including origins of final parameter values.
11901190

1191-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
1191+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
11921192

11931193
.. req:: Configuration language single point of maintenance
11941194
:collapse:
@@ -1200,7 +1200,7 @@ Supporting requirements
12001200

12011201
The language used for configuring a framework program shall include features for maintaining hierarchical configurations from a single point of maintenance.
12021202

1203-
- See :numref:`ch_conceptual_design/user_configuration:Mechanics of configuration specification`
1203+
- See :numref:`ch_subsystem_design/configuration:Mechanics of Configuration Specification`
12041204

12051205
.. req:: Enable identification of data sets containing chunked data products
12061206
:collapse:

doc/ch_conceptual_design/algorithms.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ When member functions are required, the qualifier :cpp:`const` should be specifi
7474

7575
.. rubric:: Footnotes
7676

77-
.. [#f1] In C++, the function signature corresponds to the function *declaration* [CppFunctionDecl]_, for which the type :cpp:`P` and :cpp:`P const` are treated identically by the compiler.
77+
.. [#f1] In C++, the function signature corresponds to the function *declaration* [Cpp-Function]_, for which the type :cpp:`P` and :cpp:`P const` are treated identically by the compiler.
7878
However, for the function implementation or *definition*, algorithm authors are encouraged to use :cpp:`P const` to help guarantee the immutability of data.
7979
.. [#f2] Phlex permits the registration of member functions that do not use the :cpp:`const` qualifier.
8080
However, using such functions is highly discouraged as it indicates a class instance is modifiable during member-function execution, which is at odds with Phlex's functional-programming paradigm.
@@ -83,4 +83,4 @@ When member functions are required, the qualifier :cpp:`const` should be specifi
8383

8484
.. rubric:: References
8585

86-
.. [CppFunctionDecl] https://en.cppreference.com/w/cpp/language/function.html
86+
.. [Cpp-Function] https://en.cppreference.com/w/cpp/language/function.html

doc/ch_conceptual_design/hofs/partitioned_folds.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ where
5454
Partitions
5555
^^^^^^^^^^
5656

57-
Factorizing a set of data into non-overlapping subsets that collectively span the entire set is called creating a set *partition* [Wiki-partition]_.
57+
Factorizing a set of data into non-overlapping subsets that collectively span the entire set is called creating a set *partition* [Wiki-Partition]_.
5858
Each subset of the partition is called a *cell*.
5959
In the above example, the role of the :math:`\textit{into\_spills}` operation is to partition the input sequence into `Spill`\ s so that there is one fold result per `Spill`.
6060
In general, however, the partitioning function is of the form :math:`\textit{part}: \{\iset{c}\} \rightarrow \mathbb{P}(\iset{c})`, where:
@@ -157,4 +157,4 @@ Possible solutions include using :cpp:`std::atomic_ref<double>` [#fatomicref]_,
157157

158158
.. rubric:: References
159159

160-
.. [Wiki-partition] https://en.wikipedia.org/wiki/Partition_of_a_set
160+
.. [Wiki-Partition] https://en.wikipedia.org/wiki/Partition_of_a_set

doc/ch_conceptual_design/hofs/partitioned_unfolds.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ Partitioned Unfolds
1313
+----------------------------------------------------------+------------------------------------------------+------------------------+
1414

1515
As discussed in :numref:`ch_preliminaries/functional_programming:Sequences of Data and Higher-Order Functions`, the opposite of a fold is an *unfold*, where a sequence of objects is generated from a single object.
16-
The example given in :numref:`ch_preliminaries/data_flow:Data Flow with Sequences` is :math:`\textit{iota}`, which generates a sequence of contiguous integers given one input number:
16+
The example given in :numref:`ch_preliminaries/data_flow:Data Flow with Sequences` is :math:`\text{iota}`, which generates a sequence of contiguous integers given one input number:
1717

1818
.. math::
1919
20-
c = [1,\ 2,\ 3,\ \dots,\ n] = \textit{iota}\ n = \unfold{\gt 0}{\textit{decrement}}\ n
20+
c = [1,\ 2,\ 3,\ \dots,\ n] = \text{iota}\ n = \unfold{greater\_than\_zero}{decrement}\ n
2121
22-
where :math:`\textit{iota}` has been expressed in terms of an unfold HOF that receives the predicate :math:`\gt 0` and a generator called :math:`\textit{decrement}`.
22+
where :math:`\text{iota}` has been expressed in terms of an unfold HOF that receives the predicate :math:`greater\_than\_zero` and a generator called :math:`decrement`.
2323

24-
The unfold operation is recursively called until the predicate returns `false`, whereby it emits an empty list :math:`[\ ]`:
24+
The unfold operation is repeatedly called until the predicate returns `false`, whereby it emits an empty list :math:`[\ ]`:
2525

2626
.. math::
2727
:no-wrap:
2828
2929
\begin{align*}
30-
c &= \unfold{\gt 0}{\textit{decrement}}\ n \\
31-
&= \unfold{\gt 0}{\textit{decrement}}\ n-1\ \boldsymbol{+}\ [n] \\
30+
c &= \unfold{greater\_than\_zero}{decrement}\ n \\
31+
&= \unfold{greater\_than\_zero}{decrement}\ n-1\ \boldsymbol{+}\ [n] \\
3232
&\quad\quad \vdots \\
33-
&= \unfold{\gt 0}{\textit{decrement}}\ 0\ \boldsymbol{+}\ [1, 2, \dots, n-1, n] \\
33+
&= \unfold{greater\_than\_zero}{decrement}\ 0\ \boldsymbol{+}\ [1, 2, \dots, n-1, n] \\
3434
&=[\ ]\ \boldsymbol{+}\ [1, 2, \dots, n-1, n]
3535
\end{align*}
3636
@@ -46,7 +46,7 @@ Heuristically, this can be thought of as executing the function:
4646
while predicate(next_value):
4747
# generator returns a new value for next_value
4848
next_value, sequence_element = generator(next_value)
49-
result.append(sequence_element)
49+
result.prepend(sequence_element)
5050
return result
5151
5252
where the user supplies the :py:`predicate` (:math:`p`) and :py:`generator` (:math:`\textit{gen}`) algorithms.
@@ -66,7 +66,7 @@ Next Type
6666

6767
The signatures for the operators :math:`p` and :math:`\textit{gen}` have the curious type :math:`N`, which seems unrelated to the input sequence :math:`d`, whose elements are of type :math:`D`, or the output sequence :math:`c`, whose elements are of type :math:`C`.
6868
The type :math:`N` refers to the type of the *next* value on which the unfold operates.
69-
In the :math:`\textit{iota}` example above, the type :math:`N` is the same as the input argument :math:`n`, which is an integer, and it is the same as that of the output sequence elements, which are also integers.
69+
In the :math:`\text{iota}` example above, the type :math:`N` is the same as the input argument :math:`n`, which is an integer, and it is the same as that of the output sequence elements, which are also integers.
7070

7171
The unfold in :numref:`workflow`, however, demonstrates an example where :math:`N` is equal to neither :math:`D` nor :math:`C`.
7272
Whereas the input type :math:`D` corresponds to the :cpp:`"SimDepos"` data product in each `Spill`, the output type :math:`C` represents the :cpp:`"Waveforms"` data products produced for each `APA`.

doc/ch_conceptual_design/hofs/windows.rst

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Windows
55
+---------------------------------------+---------------------------------------------------------+------------------------+
66
| **Window** | Operators | Output sequence length |
77
+=======================================+=========================================================+========================+
8-
| :math:`y = \window{f}{adj}{label}\ x` | :math:`f': X \times \opt{X} \rightarrow Y` | :math:`|y| = |x|` |
8+
| :math:`y = \window{f}{adj}{label}\ x` | :math:`f: X \times \opt{X} \rightarrow Y` | :math:`|y| = |x|` |
99
| +---------------------------------------------------------+ |
1010
| | :math:`adj: \iset{x} \times \iset{x} \rightarrow \bool` | |
1111
| +---------------------------------------------------------+ |
@@ -31,12 +31,12 @@ A straightforward :math:`adj` implementation might be to group the :cpp:`"GoodHi
3131
3232
\isequence{hs}{\text{APA}} = [\ \rlap{$\overbracket{\phantom{hs_1 \ \ hs_2}}^{a}\ \ \overbracket{\phantom{hs_3\ \ hs_4}}^{c}$}hs_1, \underbracket{hs_2,\ hs_3}_{b},\ hs_4,\ \dots,\ \underbracket{hs_{n-1},\ hs_n}_{m}\ ]
3333
34-
The data products corresponding to windows :math:`a` through :math:`m` are grouped into pairs and presented to the :cpp:`make_tracks` algorithm, which has the signature :math:`\text{Hits} \times \text{Hits} \rightarrow \text{Tracks}`.
35-
There are, at most, :math:`n-1` unique pairs that can be presented to the function :cpp:`make_tracks` such that:
34+
The data products corresponding to windows :math:`a` through :math:`m` are grouped into pairs and presented to an algorithm :math:`make\_tracks'`, which has the signature :math:`\text{Hits} \times \text{Hits} \rightarrow \text{Tracks}`.
35+
There are, at most, :math:`n-1` unique pairs that can be presented to the function :math:`make\_tracks'` such that:
3636

3737
.. math::
3838
39-
\left[ts_i\right]_{i \in \iset{\text{APA}}'} = \left[make\_tracks(hs_i, hs_{i+1})\right]_{i \in \iset{\text{APA}}'} = \window{make\_tracks}{adj}{\text{APA}} \isequence{hs}{\text{APA}}
39+
\left[ts_i\right]_{i \in \iset{\text{APA}}'} = \left[make\_tracks'(hs_i, hs_{i+1})\right]_{i \in \iset{\text{APA}}'} = \window{make\_tracks'}{adj}{\text{APA}} \isequence{hs}{\text{APA}}
4040
4141
where the index set :math:`\iset{\text{APA}}'` is :math:`\iset{\text{APA}}` without the last identifier :math:`n` [#flast]_.
4242
In this example, the identifier of the first :math:`hs` object in the pair is used to identify the tracks collection :math:`ts`.
@@ -46,40 +46,41 @@ Operator Signatures
4646
^^^^^^^^^^^^^^^^^^^
4747

4848
One limitation of the above formulation is that index sets of the input and output sequences are not the same.
49-
To address this infelicity, the function signature of :cpp:`make_tracks` can be adjusted such that the second argument receives an optional type:
49+
To address this infelicity, the function signature of :math:`make\_tracks'` can be adjusted such that the second argument receives an optional type.
50+
We call this new algorithm :math:`make\_tracks`:
5051

5152
.. math::
5253
53-
make\_tracks': \text{Hits} \times \opt{\text{Hits}} \rightarrow \text{Tracks}
54+
make\_tracks: \text{Hits} \times \opt{\text{Hits}} \rightarrow \text{Tracks}
5455
5556
thus permitting symmetry between the input and output data-product sequences:
5657

5758
.. math::
5859
59-
\isequence{ts}{\text{APA}} &= \left[make\_tracks'(hs_i, hs_{i+1})\right]_{i \in \iset{\text{APA}}'} \boldsymbol{+}\ \left[make\_tracks'(hs_n, ())\right] \\
60-
&= \window{make\_tracks'}{adj}{\text{APA}} \isequence{hs}{\text{APA}}
60+
\isequence{ts}{\text{APA}} &= \window{make\_tracks}{adj}{label} \isequence{hs}{\text{APA}} \\
61+
&=\left[make\_tracks(hs_i, hs_{i+1})\right]_{i \in \iset{\text{APA}}'} \boldsymbol{+}\ \left[make\_tracks(hs_n, ())\right]
6162
62-
where :math:`\boldsymbol{+}` is the list-concatenation operator, and :math:`()` is the unit element.
63-
Phlex supports the function signature whose second argument is an optional type :math:`\opt{X}`; the prime following the function name (e.g. :math:`f'`) is a reminder that the second argument is an optional type.
63+
where :math:`label` returns the value of `APA`, :math:`\boldsymbol{+}` is the list-concatenation operator, and :math:`()` is the null value.
64+
Phlex supports the function signature whose second argument is an optional type :math:`\opt{X}`.
6465

6566
.. table::
6667
:widths: 12 88
6768

6869
+---------------+------------------------------------------------------------------------------------+
6970
| **Operator** | **Allowed signature** |
7071
+===============+====================================================================================+
71-
| :math:`f'` | :cpp:`return_type function_name(P1, P2*, Rm...) [quals];` |
72+
| :math:`f` | :cpp:`return_type function_name(P1, Opt<P2>, Rm...) [quals];` |
7273
+---------------+------------------------------------------------------------------------------------+
7374
| :math:`adj` | :cpp:`bool function_name(<P1 identifier>, <P2 identifier>) [quals];` |
7475
+---------------+------------------------------------------------------------------------------------+
7576
| :math:`label` | *Name of data-set category of output data products* |
7677
+---------------+------------------------------------------------------------------------------------+
7778

7879
The :cpp:`return_type` must model the created data-product type described in :numref:`ch_conceptual_design/algorithms:Return Types`.
79-
The algorithm :math:`f'` may also create multiple data products by returning a :cpp:`std::tuple<T1, ..., Tn>` where each of the types :cpp:`T1, ..., Tn` models a created data-product type.
80+
The algorithm :math:`f` may also create multiple data products by returning a :cpp:`std::tuple<T1, ..., Tn>` where each of the types :cpp:`T1, ..., Tn` models a created data-product type.
8081

81-
The second argument :cpp:`P2*` indicates that an optional type is passed to the algorithm.
82-
It is permitted to use resources (i.e. :cpp:`Rm...`) in the function :math:`f'`.
82+
The second argument :cpp:`Opt<P2>` indicates that an optional type is passed to the algorithm.
83+
It is permitted to use resources (i.e. :cpp:`Rm...`) in the function :math:`f`.
8384
The data-product set identifers of :cpp:`P1` and :cpp:`P2` are used to determine whether two data-products reside in adjacent data-product sets.
8485

8586
Registration Interface
@@ -91,15 +92,16 @@ The :math:`\textit{window(make\_tracks)}` node in :numref:`workflow` would be re
9192

9293
class hits { ... };
9394
class tracks { ... };
95+
class id { ... };
9496
tracks make_tracks(tracks const& ts, tracks const* next_ts) { ... }
95-
bool are_adjacent(phlex::id const& left, phlex::id const& right) { ... }
97+
bool are_adjacent(id const& left, id const& right) { ... }
9698

9799
PHLEX_REGISTER_ALGORITHMS(config)
98100
{
99101
products("GoodTracks") =
100102
window(
101103
"track_maker", // <= Node name for framework
102-
make_tracks, // <= Window algorithm (f')
104+
make_tracks, // <= Window algorithm (f)
103105
are_adjacent // <= Adjacency criterion
104106
"APA", // <= Output data-product category
105107
concurrency::unlimited // <= Allowed concurrency
@@ -108,7 +110,7 @@ The :math:`\textit{window(make\_tracks)}` node in :numref:`workflow` would be re
108110
}
109111

110112
Note that the second input parameter for :cpp:`make_tracks` is an optional type.
111-
The type :cpp:`phlex::id` is a putative type that enables the comparison of data-product set identifiers for establishing adjacency.
113+
The type :cpp:`id` is a metadata type (possibly defined by the experiment) that enables the comparison of data-product identifiers for establishing adjacency.
112114

113115
.. rubric:: Footnotes
114116

0 commit comments

Comments
 (0)