CLI Only select specific variables#552
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #552 +/- ##
=====================================
Coverage 74.9% 74.9%
=====================================
Files 36 36
Lines 7156 7204 +48
Branches 1333 1344 +11
=====================================
+ Hits 5357 5394 +37
- Misses 1519 1525 +6
- Partials 280 285 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 support for running a targeted subset of variables in batch processing using a new
--variablecommand-line option. This allows users to limit a run to specific variables from the config, which is useful for debugging or partial reruns. The implementation ensures that only the specified variables are added to the tracking database and handled by the monitor and job submission scripts. Comprehensive tests are included to verify correct behavior and error handling.The most important changes are:
Feature: Subset Variable Selection
--variablecommand-line argument tomoppy-cmorisethat allows users to specify a subset of variables to process, instead of always running all variables in the config. Only these variables are inserted into the tracking database and processed for the current run (src/access_moppy/batch_cmoriser.py,docs/source/batch_processing.rst, [1] [2].MOPPY_VARIABLE_FILTER) to ensure only the selected variables are monitored and submitted (src/access_moppy/batch_cmoriser.py,src/access_moppy/templates/cmor_monitor_script.j2, [1] [2].Validation and Error Handling
--variableexist in the config file, and exits with a clear error message if any are missing, before making any changes to the database (src/access_moppy/batch_cmoriser.py, src/access_moppy/batch_cmoriser.pyL999-R1030).Integration with Existing Options
--variableoption integrates cleanly with existing options like--forceand--rerun-variable, so that resets and re-runs only affect the filtered subset, not all variables in the config (src/access_moppy/batch_cmoriser.py, [1] [2].Testing
tests/unit/test_batch_cmoriser.py, [1] [2].