-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter rootnames and filenames before calling the filename_parser in archive_database_update #1657
Filter rootnames and filenames before calling the filename_parser in archive_database_update #1657
Conversation
Hello @bhilbert4, Thank you for updating ! Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated at 2025-01-15 17:12:29 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhilbert4 whipping out the re dark arts here. I think this is best way to handle this problem, thanks for submitting this.
Oh! @bhilbert4 one last thing. I am trying to be better about this in my reviews... Would you mind submitting a test or two for this new function. It doesn't have to be too complex
If you want to parameterize it or do something fancy I support that too. |
New test added! It's pretty simple, but shows that the correct level 2 files are being filtered out. Let me know if you want anything more complex. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice there is a failure now, going to check on that real quick
@mfixstsci the failures have been resolved with some shuffling of the import statements in archive_database_update |
The motivation for this PR is to reduce the size of the log files from archive_database_update. After #1651 the filename_parser creates a log message for files that it cannot parse. But the relevant lines are also inside a try/except. So each time a non-parsable file is used, 4-5 lines of log messages are created. In WFSS observations, there can be thousands of filenames that can't be parsed. Plus the filename_parser is actually called twice on all the files as part of archive_database_update. This was resulting in log files that were ~350MB each, once per hour.
This PR filters out those filenames before calling the filename_parser, so we should end up not having all of those logging lines added.