Skip to content

Fix sim_telarray single-seed handling with instrument seed#2131

Merged
GernotMaier merged 3 commits into
mainfrom
bugfix/2125-simtel-seed-single-value
Apr 29, 2026
Merged

Fix sim_telarray single-seed handling with instrument seed#2131
GernotMaier merged 3 commits into
mainfrom
bugfix/2125-simtel-seed-single-value

Conversation

@GernotMaier
Copy link
Copy Markdown
Contributor

@GernotMaier GernotMaier commented Apr 26, 2026

Fixes #2125.

Handle a single-value sim_telarray_seed correctly when sim_telarray_instrument_seed is provided, add unit coverage, and update one integration config to exercise this path.

Two different ways of settings the instrument seeds are now working (as documented before):

  • --sim_telarray_seed 5,6 (instrument and simulation seed given at once)
  • --sim_telarray_seed 6 --sim_telarray_instrument_seed 5 (separate instrument and simulation seed)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes sim_telarray seed initialization to correctly handle the common CLI/config case where sim_telarray_seed is provided as a single value (parsed as a 1-item list) while sim_telarray_instrument_seed is provided separately, addressing issue #2125.

Changes:

  • Update SimtelSeeds.initialize_seeds() to treat a 1-item sim_telarray_seed list as a single simulation seed and to raise a clear ValueError for invalid list lengths.
  • Add unit coverage for single-item sim_telarray_seed lists and for invalid fixed-seed list lengths.
  • Update an integration test configuration to exercise the single-item sim_telarray_seed + sim_telarray_instrument_seed path, and add a changelog fragment.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/simtools/simtel/simtel_seeds.py Fixes routing/validation for list-form sim_telarray_seed, supporting 1-item lists and rejecting invalid lengths.
tests/unit_tests/simtel/test_simtel_seeds.py Adds unit tests for the new single-item-list handling and invalid list length error path.
tests/integration_tests/config/simulate_prod_gamma_40_deg_south_sim_telarray_only.yml Exercises the bugfix path by splitting instrument seed and single simulation seed across the two config keys.
docs/changes/2131.bugfix.md Documents the bugfix and added coverage.

Comment thread tests/unit_tests/simtel/test_simtel_seeds.py
@orelgueta orelgueta self-requested a review April 29, 2026 10:46
@ctao-sonarqube
Copy link
Copy Markdown

@GernotMaier GernotMaier merged commit e3a3de1 into main Apr 29, 2026
17 checks passed
@GernotMaier GernotMaier deleted the bugfix/2125-simtel-seed-single-value branch April 29, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Options for sim_tel_array seeds do not work as document

3 participants