Skip to content

Fix #154: Add defaults for optional params and ConfigError for mandatory#235

Open
PranjalManhgaye wants to merge 4 commits intoprecice:developfrom
PranjalManhgaye:fix-154-config-defaults-validation-clean
Open

Fix #154: Add defaults for optional params and ConfigError for mandatory#235
PranjalManhgaye wants to merge 4 commits intoprecice:developfrom
PranjalManhgaye:fix-154-config-defaults-validation-clean

Conversation

@PranjalManhgaye
Copy link
Copy Markdown
Contributor

@PranjalManhgaye PranjalManhgaye commented Mar 9, 2026

This PR addresses #154 by making configuration handling more robust and explicit.

  • Introduces a ConfigError exception and _get_required / _get_optional helpers to centralize config access and error reporting.
  • Applies the documented defaults for optional configuration parameters (e.g., memory_usage_output_*, diagnostics, adaptivity options, snapshot options).
  • Raises ConfigError with a clear path (e.g. simulation_params.micro_dt, coupling_params.precice_config_file_name) when mandatory parameters are missing or invalid, instead of generic KeyError / broad exceptions.
  • Makes the diagnostics section optional in both coupling and snapshot modes while preserving existing behavior when it is present.
  • Adds tests/unit/test_config_validation.py to cover missing mandatory parameters and default behavior for optional ones.

Testing

  • Local: python -m unittest test_config_validation test_micro_manager.TestFunctioncalls.test_config -v
image Checklist:
  • I made sure that the CI passed before I ask for a review.
  • I added a summary of the changes (compared to the last release) in the CHANGELOG.md.
  • If necessary, I made changes to the documentation and/or added new content.
  • I will remember to squash-and-merge, providing a useful summary of the changes of this PR.

… 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
@PranjalManhgaye PranjalManhgaye force-pushed the fix-154-config-defaults-validation-clean branch from 6d00f41 to 327c131 Compare March 10, 2026 08:58
@PranjalManhgaye
Copy link
Copy Markdown
Contributor Author

@IshaanDesai please let me know if you’d like any further changes or additional tests—i'm happy to adjust , thanks

@MakisH MakisH added the GSoC Contributed in the context of the Google Summer of Code label Mar 14, 2026
@PranjalManhgaye PranjalManhgaye force-pushed the fix-154-config-defaults-validation-clean branch from 8c8f229 to bd0ded6 Compare March 15, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSoC Contributed in the context of the Google Summer of Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants