Add CORSIKA CLI path and interaction arguments#2137
Merged
Conversation
…v-var precedence in settings
…copilot instructions
Contributor
There was a problem hiding this comment.
Pull request overview
Adds explicit CLI/configuration support for CORSIKA runtime paths and interaction models, and centralizes simulation-software defaults in a single module.
Changes:
- Introduce
simtools.configuration.defaultsas the centralized source for simulation defaults (CORSIKA paths/models, simulation-software choices, curved-atmosphere threshold). - Update CLI parsing and settings resolution to use centralized defaults and improve precedence handling for unset CLI args.
- Update simulator wiring plus integration-test configs/docs/CI templates to reflect the new configuration surface.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/simtools/configuration/defaults.py |
Adds centralized default constants for CORSIKA and simulation configuration. |
src/simtools/configuration/commandline_parser.py |
Adds CORSIKA path + interaction CLI args and replaces inline literals with defaults. |
src/simtools/settings.py |
Uses defaults, fixes config precedence for None args, and guards CORSIKA path resolution. |
src/simtools/simulator.py |
Switches simulation-software defaults/choices and curved-atmosphere threshold to defaults. |
tests/unit_tests/test_settings.py |
Adds unit coverage for default CORSIKA paths and default interaction-model-based executable naming. |
tests/integration_tests/config/simulate_prod_proton_20_deg_north_check_output.yml |
Adds explicit corsika_*_interaction fields to integration config. |
tests/integration_tests/config/simulate_prod_htcondor_generator_gamma_20_deg_north.yml |
Adds explicit corsika_*_interaction fields to integration config. |
tests/integration_tests/config/simulate_prod_gamma_62_deg_south_check_output.yml |
Adds explicit corsika_*_interaction fields to integration config. |
tests/integration_tests/config/simulate_prod_gamma_40_deg_south_sim_telarray_only.yml |
Adds explicit corsika_*_interaction fields to integration config. |
tests/integration_tests/config/simulate_prod_gamma_40_deg_south_corsika_only.yml |
Adds explicit corsika_*_interaction fields to integration config. |
tests/integration_tests/config/simulate_prod_gamma_40_deg_south_check_output.yml |
Adds explicit corsika_*_interaction fields to integration config. |
tests/integration_tests/config/simulate_prod_gamma_40_deg_north_check_output.yml |
Adds explicit corsika_*_interaction fields to integration config. |
tests/integration_tests/config/simulate_prod_gamma_20_deg_south_multiple_model_versions.yml |
Adds explicit corsika_*_interaction fields to integration config. |
docs/source/api-reference/configuration_module.md |
Adds API-reference entry for the new defaults module. |
docs/changes/2137.feature.md |
Adds changelog fragment for the new CLI options. |
.github/workflows/CI-integrationtests.yml |
Stops echoing unset CORSIKA interaction env vars into .env during CI. |
.github/copilot-instructions.md |
Documents requirement to add new modules to API reference. |
.env_template |
Removes interaction-model env vars from template (defaults now provided in code). |
|
orelgueta
approved these changes
Apr 29, 2026
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.




Summary
Add explicit CORSIKA CLI options for runtime paths and interaction models, and centralize all simulation software defaults into a single module.
What changed
New
configuration/defaults.pymodule — single source of truth for configurable fallback values:CORSIKA_PATH,CORSIKA_INTERACTION_TABLE_PATHCORSIKA_HE_INTERACTION(epos),CORSIKA_LE_INTERACTION(urqmd)SIMULATION_SOFTWARE_CHOICES,SIMULATION_SOFTWARE_DEFAULTCURVED_ATMOSPHERE_MIN_ZENITH_ANGLE_DEGCLI (
commandline_parser.py):--corsika_pathand--corsika_interaction_table_pathto thepathsargument group (no parser-level defaults; resolved viasettings.pyso env vars work)corsika configurationargument group with--corsika_he_interactionand--corsika_le_interactiondefaultsconstantsSettings (
settings.py):_get_config_valueto skipNonearg values, so environment variables are not shadowed by unset CLI argsdefaultsconstants for CORSIKA path and interaction fallbacksPath.is_dir()to avoid errors on non-existent default pathssimulator.py: replace literal simulation-software default and choices list withdefaultsconstantsIntegration test configs (
simulate_prod_*.yml): addcorsika_he_interactionandcorsika_le_interactionto all 8 configsCI (
CI-integrationtests.yml): removeSIMTOOLS_CORSIKA_HE_INTERACTION/SIMTOOLS_CORSIKA_LE_INTERACTIONecho lines — these variables were never set in the template, so they wrote empty strings that silently shadowed the built-in defaultsDocs: add
defaultsmodule todocs/source/api-reference/configuration_module.mdValidation
203 tests pass.