Repository navigation
v492 XGB tests. - #178
Merged
Merged
v492 XGB tests.#178
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Approval is blocked by active critical and moderate issues that can publish failed outputs, silently produce partial IRFs, or point shared environment settings at the wrong checkout.
4 open issues
What changed in this PR
This pull request strengthens XGB training, application, and IRF production workflows with centralized validation, explicit failure handling, named variant support, and improved output management.
Changes:
- Added shared XGB result checks and variant configuration utilities.
- Updated training, prediction, and effective-area workflows with variant-aware paths, locking, output validation, and failure propagation.
- Adjusted environment configuration, run-information extraction, XGB output naming, anasum discovery, and AP cut selection.
| File | Description |
|---|---|
| scripts/set_environment.sh | Updates project, data, EventDisplay, ML, and Apptainer environment configuration. |
| scripts/IRF.trainXGBforAngularReconstruction.sh | Adds variant validation and variant-specific training output configuration. |
| scripts/IRF.production.sh | Adds variant orchestration and improved XGB production job handling. |
| scripts/IRF.generate_effective_area_parts.sh | Adds variant-aware XGB effective-area inputs and validation. |
| scripts/IRF.dispXGB.sh | Passes variant, smearing, and model configuration into XGB prediction jobs. |
| scripts/IRF.combine_effective_area_parts.sh | Uses variant-specific effective-area inputs, directories, and output names. |
| scripts/helper_scripts/UTILITY.xgb_variant.sh | Provides centralized variant validation, configuration freezing, and model-root handling. |
| scripts/helper_scripts/UTILITY.xgb_checks.sh | Provides shared checks for XGB application and training results. |
| scripts/helper_scripts/IRF.trainXGBforGammaHadronSeparation_sub.sh | Adds validation of gamma/hadron XGB training results. |
| scripts/helper_scripts/IRF.trainXGBforAngularReconstruction_sub.sh | Adds smearing support, locking, variant handling, and training-result validation. |
| scripts/helper_scripts/IRF.mscw_energy_MC_sub.sh | Runs XGB prediction once per MSCW file and skips unsupported three-telescope XGB IRFs. |
| scripts/helper_scripts/IRF.effective_area_parallel_sub.sh | Adds variant output isolation, locking, and effective-area result handling. |
| scripts/helper_scripts/IRF.effective_area_combine_sub.sh | Adds variant locking and effective-area combination input and output checks. |
| scripts/helper_scripts/IRF.dispXGB_sub.sh | Adds variant model and smearing support, output locking, and apply-result validation. |
| scripts/helper_scripts/ANALYSIS.dispXGB_sub.sh | Adds explicit XGB apply status handling and updated run-information extraction. |
| scripts/ANALYSIS.anasum_combine.sh | Searches additional preprocessing directory levels for anasum outputs. |
| scripts/ANALYSIS.anasum_allcuts.sh | Restricts AP analysis processing to the NTel2ModerateXGBPre cut. |
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 introduces significant improvements to the robustness and reliability of the Eventdisplay-ML (XGB) analysis and training scripts. The changes focus on consistent error handling, explicit exit statuses, improved logging, and the introduction of centralized utility functions for checking XGB job results. Additionally, there are some adjustments to how XGB output files are handled and to the logic for running XGB predictions in IRF scripts.
Error Handling and Robustness Improvements:
UTILITY.xgb_checks.shcontainingevndisp_ml_check_applyandevndisp_ml_check_trainfunctions for standardized validation of XGB apply and train steps, including output file checks and error reporting.ANALYSIS.dispXGB_sub.sh,IRF.dispXGB_sub.sh,IRF.trainXGBforAngularReconstruction_sub.sh,IRF.trainXGBforGammaHadronSeparation_sub.sh) to sourceUTILITY.xgb_checks.shand use these functions to check for errors and exit with status 1 on failure. [1] [2] [3] [4] [5] [6] [7] [8]exitstatements on error toexit 1for explicit nonzero exit status. [1] [2] [3] [4] [5] [6] [7] [8] [9]Refactoring and Code Cleanliness:
set -ein the scripts, noting that ML exit statuses are now checked explicitly. [1] [2] [3] [4]XGB Output Handling and IRF Logic:
IRF.mscw_energy_MC_sub.sh, changed the naming and logic for XGB output files to remove the image selection suffix, ensuring that XGB predictions are calculated only once per MSCW file and used only for 4-telescope IRFs. Added logic to skip unsupported 3-telescope XGB IRFs and improved error checking for the XGB apply step. [1] [2] [3] [4] [5] [6]NTel2ModerateXGBPrecut for AP analysis types, removing redundant assignments.Other Notable Changes:
printRunParametertool witheventdisplay-ml-print-run-infofor extracting run information, making the scripts less dependent on compiled binaries. [1] [2]These changes collectively improve the maintainability, clarity, and reliability of the analysis pipeline, especially for machine learning steps involving XGB models.