Fix: syntax errors and broken file classification logic #102
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.
Description
This PR fixes critical issues in the file classification debug script: syntax errors caused by some characters and logic errors in the pattern matching algorithm that led to misclassification of data products.
Changes
Logic Improvements
fnmatch: Replaced the manual string hacking logic (removing*and checking for substrings) with Python's built-infnmatchlibrary.*and.fitsfrom*.fitsresulted in an empty string, causing the logic to returnTruefor every file.pattern_orderlist to ensure more specific patterns are checked first.srcwas previously checked beforedeepCoadd_src. BecausedeepCoadd_srccontains the substringsrc, these files were being misclassified.deepCoadd_srcis now checked before genericsrcpatterns.Testing
deepCoadd_srcfiles are no longer misclassified assrc.rawfiles are correctly identified via the fallback logic.