Repository navigation
Add optional feature mask for image parameters. - #87
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by three active issues: an invalid CLI example, missing documentation for the new mask mode, and a moderate masking bug for negative telescope-ID sentinels.
3 open issues
What changed in this PR
Adds optional --mask_unused_images support for stereo regression, masking image parameters from unused telescopes while preserving historical behavior by default. The setting is persisted in model metadata and restored during inference.
Changes:
- Adds masking configuration and model metadata persistence.
- Propagates masking through telescope data flattening and model application.
- Validates compatibility between primary and high-multiplicity models.
- Adds masking behavior tests and reorganizes usage documentation.
- Documents the feature in the changelog.
This pull request requires changes.
| File | Description |
|---|---|
tests/test_stereo_inactive_telescope_mask.py |
Tests enabled masking and historical default behavior. |
src/eventdisplay_ml/models.py |
Stores the masking option in regression metadata and applies it during inference. |
src/eventdisplay_ml/data_processing.py |
Propagates the masking option through telescope flattening and applies NaN masking. |
src/eventdisplay_ml/config.py |
Adds stereo training configuration, logging, and model-setting compatibility checks. |
README.md |
Provides a concise project overview, installation instructions, and documentation links. |
docs/usage.md |
Contains the relocated training, application, and diagnostic usage guide. |
docs/changes/87.feature.md |
Documents the new stereo masking feature. |
Review effort: Lite
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 pull request adds an optional feature to mask (set to NaN) the image parameters of telescopes not used by the DispBDT reconstruction in stereo analysis. This behavior is controlled by a new
--mask_unused_imagesoption, which is stored in the model and respected during both training and application. The codebase is updated to propagate this setting throughout the relevant data processing and model application functions, and new tests have been added to verify the correct masking behavior.Feature addition and configuration:
--mask_unused_imagescommand-line option to stereo training inconfigure_training, which sets image parameters of unused telescopes to NaN. The setting is stored in the model configuration and logged for transparency. [1] [2] [3] [4]mask_unused_imagessetting is loaded from the model's training parameters, ensuring consistency between training and inference. An error is raised if primary and high-multiplicity models have conflicting settings. [1] [2]Data processing pipeline changes:
flatten_telescope_data_vectorized,flatten_feature_data, and related internal functions to accept and apply themask_unused_imagesflag, masking unused image parameters as needed. This affects both training and application workflows. [1] [2] [3] [4] [5] [6] [7] [8] [9]Testing:
tests/test_stereo_inactive_telescope_mask.pyto verify that the masking behavior works as expected, both with the option enabled (masking unused images) and with the default (historical) behavior.