Skip to content

Simplify naming of sim_telarray configuration files written to disk for simulation production.#2318

Merged
GernotMaier merged 9 commits into
mainfrom
simtel-cfg-naming
Jul 3, 2026
Merged

Simplify naming of sim_telarray configuration files written to disk for simulation production.#2318
GernotMaier merged 9 commits into
mainfrom
simtel-cfg-naming

Conversation

@GernotMaier

@GernotMaier GernotMaier commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Simplify naming of sim_telarray configuration files written to disk for simulation production:

  • telescope configuration files are now of type CTAO-LSTS-01.cfg, CTAO-SSTS-25.cfg
  • array configuration files are of type CTAO-South-beta.cfg
  • added a run directory level to model, such that e.g. we get
tree -d simtools-output
simtools-output
├── corsika
│   ├── run000010
│   └── run000011
├── model
│   ├── run000010
│   │   └── 7.0.0
│   └── run000011
│       └── 7.0.0
├── multi_pipe
│   ├── run000010
│   └── run000011
├── sim_telarray
│   ├── run000010
│   └── run000011
└── sub

This will allow to run in future a paralellization of some applications (e.g., multi-light-level flasher simulations did overwrite configuration files).

Raises an exception if existing configuration files are overwritten by an application.

Note! Basic assumption is that configuration files are written once into the same directory by an application.

Note that this removes changes introduced in PR #2287.

Updates tests resources configuration files using tests files from simtools-tests v0.34.0

@GernotMaier GernotMaier self-assigned this Jul 3, 2026
@GernotMaier
GernotMaier requested a review from Copilot July 3, 2026 10:27
@GernotMaier
GernotMaier marked this pull request as ready for review July 3, 2026 10:27
@GernotMaier GernotMaier added the Copilot review AI-supported Copilot review label Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates sim_telarray configuration handling in simtools by simplifying on-disk config filenames (switching to CTAO-*.cfg) and introducing run-number subdirectories under model/ to prevent configuration collisions across runs, with corresponding updates to output validation and test resources.

Changes:

  • Simplify sim_telarray telescope/array configuration filenames to the CTAO-...cfg scheme and update code paths that reference these files.
  • Add a run-number directory level for model outputs (e.g., model/run000010/<model_version>/) and update output validation accordingly.
  • Add overwrite protection for array config writing and refresh unit/integration tests plus generated reference configs.

Reviewed changes

Copilot reviewed 18 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit_tests/utils/test_names.py Updates naming tests for new CTAO-*.cfg conventions.
tests/unit_tests/testing/test_validate_output.py Adjusts simtel cfg validation tests for run-number model subdirectories.
tests/unit_tests/test_simulator.py Updates simulator unit test expectations for run-specific model directory selection.
tests/unit_tests/simtel/test_simulator_ray_tracing.py Updates expected sim_telarray config path naming in ray tracing tests.
tests/unit_tests/model/test_array_model.py Adds coverage for run-specific config directories and updates expected array cfg name.
tests/unit_tests/io/test_io_handler.py Updates expected model configuration directory layout to model/<subdir>/<version>.
tests/resources/generated/sim_telarray_configurations/6.0.2/CTAO-South-beta.cfg Updates reference array cfg includes/metadata for new telescope cfg filenames.
tests/resources/generated/sim_telarray_configurations/6.0.2/CTAO-North-alpha.cfg Updates reference array cfg includes/metadata for new telescope cfg filenames.
tests/resources/generated/sim_telarray_configurations/6.0.2/CTAO-MSTS-01.cfg Updates reference telescope cfg metadata and associated file naming.
tests/resources/generated/sim_telarray_configurations/6.0.2/CTAO-MSTN-01.cfg Updates reference telescope cfg metadata and associated file naming.
tests/resources/generated/sim_telarray_configurations/6.0.2/CTAO-LSTS-01.cfg Updates reference telescope cfg metadata and associated file naming.
tests/resources/generated/sim_telarray_configurations/6.0.2/CTAO-LSTN-02.cfg Updates reference telescope cfg metadata and associated file naming.
tests/resources/generated/sim_telarray_configurations/6.0.2/CTAO-LSTN-01.cfg Updates reference telescope cfg metadata and associated file naming.
tests/resources/generated/sim_telarray_configurations/5.0.0/CTAO-North-alpha.cfg Updates reference array cfg includes/metadata for new telescope cfg filenames.
tests/resources/generated/sim_telarray_configurations/5.0.0/CTAO-MSTN-01.cfg Updates reference telescope cfg metadata and associated file naming.
tests/resources/generated/sim_telarray_configurations/5.0.0/CTAO-LSTN-02.cfg Updates reference telescope cfg metadata and associated file naming.
tests/resources/generated/sim_telarray_configurations/5.0.0/CTAO-LSTN-01.cfg Updates reference telescope cfg metadata and associated file naming.
tests/integration_tests/config/simulate_prod_proton_20_deg_north_check_output.yml Updates integration test references to new generated cfg filenames.
tests/integration_tests/config/simulate_prod_gamma_62_deg_south_check_output.yml Updates integration test references to new generated cfg filenames.
tests/integration_tests/config/simulate_prod_gamma_40_deg_south_sim_telarray_only.yml Updates integration test references to new generated cfg filenames.
src/simtools/utils/names.py Replaces simtel_config_file_name with sim_telarray_config_file_name and changes naming rules.
src/simtools/testing/validate_output.py Updates simtel cfg validation to locate files under run-specific model subdirectories.
src/simtools/simulator.py Passes a runXXXXXX model subdir into ArrayModel to avoid cross-run overwrites.
src/simtools/simtel/simulator_ray_tracing.py Switches to using telescope_model.config_file_path directly for cfg path resolution.
src/simtools/simtel/simtel_config_writer.py Adds overwrite protection for array config file writing.
src/simtools/model/model_parameter.py Updates telescope config path generation and removes the old get_config_file_path API.
src/simtools/model/array_model.py Adds support for run-specific model configuration directories and updates array cfg naming.
src/simtools/io/io_handler.py Changes model configuration directory structure to model/<subdir>/<version>.
docs/changes/2318.maintenance.md Adds a changelog fragment describing the naming/layout change.

Comment thread src/simtools/utils/names.py
Comment thread src/simtools/model/model_parameter.py
Comment thread tests/unit_tests/utils/test_names.py
Comment thread docs/changes/2318.maintenance.md
Comment thread src/simtools/utils/names.py
GernotMaier and others added 2 commits July 3, 2026 12:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ctao-sonarqube

ctao-sonarqube Bot commented Jul 3, 2026

Copy link
Copy Markdown

@GernotMaier
GernotMaier merged commit 6017d7a into main Jul 3, 2026
21 checks passed
@GernotMaier
GernotMaier deleted the simtel-cfg-naming branch July 3, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Copilot review AI-supported Copilot review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants