Improved metrics error handling, stricter regex patterns, and better file closing#152
Open
y1zhou wants to merge 8 commits into
Open
Improved metrics error handling, stricter regex patterns, and better file closing#152y1zhou wants to merge 8 commits into
y1zhou wants to merge 8 commits into
Conversation
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.
Error handling improvements:
Added try/except blocks to catch and report errors when loading
.npzfiles in thecompute_metricsmethod ofsrc/boltzgen/task/analyze/analyze.py. This prevents crashes when files are corrupted, which is quite rare but happened to me once when a long design run was inturrupted.With this change corrupted files would be ignored and excluded from further analysis. Ideally the file should be deleted and recreated? But I haven't yet found a way to do that gracefully with the current
Tasksetup.Parsing logic corrections:
Fixed regular expression patterns in the
parse_rangefunction ofsrc/boltzgen/data/parse/schema.pyto correctly match ranges separated by... The previous regex would match any two characters between two numbers, e.g. the..would matchA0in1A023. Not a huge deal since the string is later split on..literally, but Explicit is better than implicit!File descriptors:
All other changes are around fixing opened file descriptors that were not properly closed. When running large design campaigns this could drain system resources (although many Python implementations would clean up automatically).