Commit b33c6cf
committed
feat!: Implement 'in' operator and chunksize overide for StepParameterSpaceIterator
* The in operator and validate_containment function of the StepParameterSpaceIterator
will allow the openjd-cli to validate that input task parameters
are within the parameter space of steps that it is running. The latter
* The purpose of this change is to support chunked iteration. This
validation helps ensure the `openjd run` command only accepts
correct chunk, in addition to adding validation that was marked as
a TODO in the openjd-cli codebase. Having validate_containment
raise an exception with a message about why the task parameters are
not in the parameter space results in better error messages.
* The chunksize override lets a caller iterate over every task of a
parameter space regardless of the space's chunk size or adaptivity.
This is useful for callers to evaluate the whole task space so that
they can perform their own chunking logic later.
* Add a property chunks_parameter_name to the StepParameterSpaceIterator
so that code using it can easily access the chunked parameter and its
properties without having to perform its own loop over all of them.
* Use an IntRangeExpr instead of a string to hold the range expression
of a RangeExpressionTaskParameterDefinition, the class used to
instantiate a parameter definition template into a job.
* Found that negative steps in IntRange have bugs in corner cases. Code
that is processing the list of IntRanges includes assumptions that the
step is positive. To fix this, chose to normalize the step to be
positive instead of adjusting the code to handle persistence of
negative steps, as that is much simpler to get right.
* Note that the IntRangeExpr was already not preserving the input
order of a range expression, because it sorted all the components.
* Removed _BaseMessageError and used ValueError instead as a base class
for the exceptions. This reduces custom code and interoperates with
Pydantic better.
BREAKING CHANGE: The IntRangeExpr class now normalizes the steps of
individual range components like "3-1:-2" to be positive like "1-3:2",
so anything depending on the prior behavior needs to be updated.
Signed-off-by: Mark Wiebe <399551+mwiebe@users.noreply.github.com>1 parent 96c2b83 commit b33c6cf
8 files changed
Lines changed: 643 additions & 235 deletions
File tree
- src/openjd/model
- v2023_09
- test/openjd/model
- _internal
- v2023_09
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 13 | + | |
28 | 14 | | |
29 | 15 | | |
30 | 16 | | |
| |||
36 | 22 | | |
37 | 23 | | |
38 | 24 | | |
39 | | - | |
| 25 | + | |
40 | 26 | | |
41 | 27 | | |
42 | 28 | | |
43 | 29 | | |
44 | | - | |
45 | 30 | | |
46 | | - | |
47 | | - | |
| 31 | + | |
48 | 32 | | |
49 | 33 | | |
50 | 34 | | |
51 | 35 | | |
52 | | - | |
53 | | - | |
54 | 36 | | |
55 | | - | |
| 37 | + | |
56 | 38 | | |
57 | 39 | | |
58 | 40 | | |
59 | 41 | | |
60 | | - | |
61 | | - | |
62 | 42 | | |
63 | 43 | | |
64 | 44 | | |
| |||
68 | 48 | | |
69 | 49 | | |
70 | 50 | | |
71 | | - | |
| 51 | + | |
72 | 52 | | |
73 | 53 | | |
74 | 54 | | |
75 | | - | |
76 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
18 | | - | |
19 | | - | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | | - | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
37 | | - | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
98 | | - | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
123 | 136 | | |
124 | 137 | | |
125 | 138 | | |
126 | | - | |
| 139 | + | |
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
130 | 143 | | |
131 | | - | |
| 144 | + | |
132 | 145 | | |
133 | 146 | | |
134 | 147 | | |
| |||
137 | 150 | | |
138 | 151 | | |
139 | 152 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
| |||
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
159 | 191 | | |
160 | | - | |
161 | 192 | | |
162 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
163 | 196 | | |
164 | 197 | | |
165 | 198 | | |
166 | 199 | | |
167 | 200 | | |
168 | 201 | | |
169 | 202 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
184 | 220 | | |
185 | 221 | | |
186 | 222 | | |
| |||
204 | 240 | | |
205 | 241 | | |
206 | 242 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | 243 | | |
213 | 244 | | |
214 | 245 | | |
| |||
232 | 263 | | |
233 | 264 | | |
234 | 265 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | 266 | | |
251 | 267 | | |
252 | 268 | | |
| |||
0 commit comments