Fix #154: Add defaults for optional params and ConfigError for mandatory#235
Open
PranjalManhgaye wants to merge 4 commits intoprecice:developfrom
Open
Conversation
… mandatory - Add ConfigError and _get_required/_get_optional helpers - Apply documented defaults for optional parameters - Raise ConfigError with clear path when mandatory params missing - Make diagnostics section optional - Add test_config_validation tests
6d00f41 to
327c131
Compare
Contributor
Author
|
@IshaanDesai please let me know if you’d like any further changes or additional tests—i'm happy to adjust , thanks |
8c8f229 to
bd0ded6
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses #154 by making configuration handling more robust and explicit.
ConfigErrorexception and_get_required/_get_optionalhelpers to centralize config access and error reporting.memory_usage_output_*,diagnostics, adaptivity options, snapshot options).ConfigErrorwith a clear path (e.g.simulation_params.micro_dt,coupling_params.precice_config_file_name) when mandatory parameters are missing or invalid, instead of genericKeyError/ broad exceptions.diagnosticssection optional in both coupling and snapshot modes while preserving existing behavior when it is present.tests/unit/test_config_validation.pyto cover missing mandatory parameters and default behavior for optional ones.Testing
python -m unittest test_config_validation test_micro_manager.TestFunctioncalls.test_config -vCHANGELOG.md.