Commit 65a1446
authored
refactor: define the program database in toml (#324)
* refactor: define the program database in toml
usgsprograms.txt was a fixed width comma separated file with a header row,
which could not carry a comment describing what a field means and had to be
re-aligned by hand when a value grew. The database is now usgsprograms.toml,
where each target is a table, so a field can be documented and added.
standard_switch and double_switch are standard_precision and
double_precision, since a switch does not say what it selects. The other
field names are unchanged, srcdir in particular, which is what the rest of
pymake calls a source directory.
A target name that contains a dot, such as mfnwt1.1.4, is quoted, since a
dot separates tables in toml and the target would otherwise be read as
three nested tables.
toml is read with tomllib, which is in the standard library from python
3.11, and with tomli before that.
* refactor: remove the string to boolean conversion toml does not need
* style: mark the toml reader fallback for the analysis tools
tomli is only imported on python 3.10, which the static analysis and the
coverage report do not run, so the import is marked as one they do not
report on.
* style: name the module constants in usgsprograms for what they are
program_data_file and target_keys are constants and are named for constants,
which the static analysis reported when the file the database is read from
changed.
The import of the toml reader is no longer marked, since the analysis does
not report it.1 parent 2cadfa0 commit 65a1446
7 files changed
Lines changed: 335 additions & 129 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
| |||
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
80 | | - | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | | - | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
89 | | - | |
90 | | - | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 99 | | |
118 | 100 | | |
119 | 101 | | |
| |||
130 | 112 | | |
131 | 113 | | |
132 | 114 | | |
133 | | - | |
134 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
135 | 118 | | |
136 | 119 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
158 | 124 | | |
159 | 125 | | |
160 | | - | |
161 | | - | |
| 126 | + | |
162 | 127 | | |
163 | 128 | | |
164 | 129 | | |
| |||
287 | 252 | | |
288 | 253 | | |
289 | 254 | | |
290 | | - | |
| 255 | + | |
291 | 256 | | |
292 | | - | |
| 257 | + | |
293 | 258 | | |
294 | 259 | | |
295 | 260 | | |
| |||
393 | 358 | | |
394 | 359 | | |
395 | 360 | | |
396 | | - | |
| 361 | + | |
397 | 362 | | |
398 | 363 | | |
399 | 364 | | |
| |||
477 | 442 | | |
478 | 443 | | |
479 | 444 | | |
480 | | - | |
| 445 | + | |
481 | 446 | | |
482 | 447 | | |
483 | 448 | | |
484 | 449 | | |
485 | 450 | | |
486 | | - | |
| 451 | + | |
487 | 452 | | |
488 | 453 | | |
489 | 454 | | |
| |||
554 | 519 | | |
555 | 520 | | |
556 | 521 | | |
557 | | - | |
| 522 | + | |
558 | 523 | | |
559 | 524 | | |
560 | 525 | | |
| |||
0 commit comments