Skip to content

Improved metrics error handling, stricter regex patterns, and better file closing#152

Open
y1zhou wants to merge 8 commits into
HannesStark:mainfrom
y1zhou:main
Open

Improved metrics error handling, stricter regex patterns, and better file closing#152
y1zhou wants to merge 8 commits into
HannesStark:mainfrom
y1zhou:main

Conversation

@y1zhou
Copy link
Copy Markdown
Contributor

@y1zhou y1zhou commented Jan 14, 2026

Error handling improvements:

Added try/except blocks to catch and report errors when loading .npz files in the compute_metrics method of src/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 Task setup.

Parsing logic corrections:

Fixed regular expression patterns in the parse_range function of src/boltzgen/data/parse/schema.py to correctly match ranges separated by ... The previous regex would match any two characters between two numbers, e.g. the .. would match A0 in 1A023. 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).

@y1zhou y1zhou changed the title Improved metrics error handling and stricter regex patterns Improved metrics error handling, stricter regex patterns, and better file closing Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant