-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Changes to saving of IterationConfigs to several files:
- Add option of using %s in file-name-format that injects algorithm name. - Make writing of iteration-info index in JSON save files optional. Default now is not to write. This is to be used when loading a single IterationConfig. ``` void ConfigJson_Save_Iterations(IterationsInfo &its_info, const std::string &fname_fmt, bool include_iter_info_preamble); ``` - Provide another version of JSON reading where a single iteration is loaded over an existing one. These are the two variants: ``` // Patch IterationsInfo from a vector of files. // Assumes patch files include iteration-info preambles, i.e., they // were saved with include_iter_info_preamble=true. // If report is non-null counts are added to existing object. void ConfigJson_Patch_Files(IterationsInfo &its_info, const std::vector<std::string> &fnames, ConfigJsonPatcher::PatchReport *report=nullptr); // Load a single iteration from JSON file. // Searches for a match between m_algorithm in its_info and in JSON file to decide // which IterationConfig it will load over. // Assumes JSON file has been saved WITHOUT iteration-info preamble. // Returns reference to the selected IterationConfig. // If report is non-null counts are added to existing object. IterationConfig& ConfigJson_Load_File(IterationsInfo &its_info, const std::string &fname, ConfigJsonPatcher::PatchReport *report=nullptr); ``` - Add new command-line options and remove 'patch' from most of the existing one: ``` JSON config patcher options: --json-load <filename> load iteration config from given JSON file (def: do not load) can be specified multiple times for several files --json-patch <filename> patch iteration config from given JSON file (def: do not patch) can be specified multiple times for several files --json-save-iterations <fname-fmt> save per iteration json files %d in fname-fmt gets replaced with iteration number %s in fname-fmt get replaced with iteration algorithm name exactly one of %d and %s must be specified --json-save-iterations-include-iter-info-preamble (def: false) --json-verbose print each patch assignment as it is being made (def: false) --json-dump-before print iteration config before patching (def: false) --json-dump-after print iteration config after patching (def: false) ``` - When counting replacements of leaf config values only count assignments where value has actually changed. - Use nlohmann::ordered_json when saving configs to JSON files and dumping to stdout. This preserves data-member definition order and makes these outputs more readable.
- Loading branch information
Showing
7 changed files
with
229 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.