Skip L2 processing if no good times are found#2775
Open
vmartinez-cu wants to merge 5 commits intoIMAP-Science-Operations-Center:devfrom
Open
Skip L2 processing if no good times are found#2775vmartinez-cu wants to merge 5 commits intoIMAP-Science-Operations-Center:devfrom
vmartinez-cu wants to merge 5 commits intoIMAP-Science-Operations-Center:devfrom
Conversation
…gramL2 object. Returns if no good data exists
…d so an empty list is returned
…an L1B dataset with no good times
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements early exit from L2 processing when no good times are found in the L1B input dataset, addressing issue #2372. The solution uses a factory method pattern to validate data before processing and returns an empty list instead of creating invalid output files.
Changes:
- Added a factory class method
HistogramL2.create()that checks for good times before instantiation - Refactored
HistogramL2.__init__()to accept pre-filtered data, removing validation logic from the constructor - Updated
glows_l2()to handle None return from factory method and log warnings appropriately
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| imap_processing/glows/l2/glows_l2_data.py | Added factory method create() for validation and filtering; refactored constructor to accept only good data; fixed spelling in error message |
| imap_processing/glows/l2/glows_l2.py | Updated to use factory method; added logging for no-good-times case; returns empty list when appropriate |
| imap_processing/tests/glows/test_glows_l2.py | Added test case for HistogramL2.create() returning None when no good times exist |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 PR updates L2 processing to exit processing early and return an empty list if no good times are found in the l1b input dataset.
File changes
glows_l2_data.py - added a factory class method that checks if good times exist before proceeding with creating the l2 histogram data class. If no good times are found, it returns None
glows_l2.py - updated call to the histogram data class to use new class method to create the instance
Testing
Closes #2372