Commit 081b960
authored
ParmParse: Type Hints (#4364)
## Summary
Today, we use the `ParmParse` object not only anymore to read text-based
key-value pairs from input files and CLI options, but additionally and
sometimes exclusively populate it heavily from the C++ and Python APIs
directly.
This proposes a concept to store the type of the latest `add` with each
entry, which can help to expose `ParmParse` options, e.g., when
exporting them to Python dictionaries and other file formats (YAML,
TOML, JSON, XML, etc.). When a typehint is found, we can cast to the
correct type automatically for the value, instead of returning a string.
## Additional background
AMReX-Codes/pyamrex#417 (comment)
## Checklist
The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [x] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate1 parent d6ab3a9 commit 081b960
2 files changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
1633 | 1637 | | |
1634 | 1638 | | |
1635 | 1639 | | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
1636 | 1651 | | |
1637 | 1652 | | |
1638 | 1653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
| 867 | + | |
| 868 | + | |
867 | 869 | | |
868 | 870 | | |
869 | 871 | | |
| |||
881 | 883 | | |
882 | 884 | | |
883 | 885 | | |
| 886 | + | |
| 887 | + | |
884 | 888 | | |
885 | 889 | | |
886 | 890 | | |
| |||
0 commit comments