feat(borg_runtime): add Borg archive lifespan analysis and plot#4
Merged
Conversation
Parse Borg MOEA runtime files into archive snapshots and per-solution birth/death tables, and plot them as a survival chart with restart windows shaded. leaked_model_ids cross-references a Borg-RiverWare SolutionModels folder against snapshot history: files whose IDs appear in no snapshot were added and removed from the archive during a restart (when no runtime output is written), which is how snapshot-based model cleanup leaks files. Bundles sample runtime file, example 07, and unit tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Borg MOEA runtime analysis workflow to parasolpy: parsing runtime snapshots into per-solution lifespans, detecting “leaked” model files, and visualizing archive survival over time.
Changes:
- Introduces
parasolpy.borg_runtimewith runtime parsing, metadata extraction, lifespan reconstruction, and leaked-model detection utilities. - Adds
plot_archive_lifespansto visualize solution birth/death bars plus archive-size and restart-gap shading. - Adds an example script, sample-data-based docs wiring, changelog entry, and unit tests for the new runtime utilities.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_borg_runtime.py | Adds unit tests for parsing snapshots/metadata, lifespan conventions, and leaked model ID detection. |
| parasolpy/plotting.py | Adds plot_archive_lifespans survival-style plot for archive solutions, with restart-gap shading. |
| parasolpy/borg_runtime.py | New module implementing runtime snapshot parsing, metadata parsing, lifespan table construction, and leaked-model detection. |
| parasolpy/init.py | Exposes new borg-runtime utilities and plotting function from the package root. |
| examples/README.md | Registers the new example script in the examples index. |
| examples/07_borg_archive_lifespan.py | Adds a runnable demo producing the archive lifespan plot (optionally overlaying leaked models). |
| docs/api/index.rst | Adds parasolpy.borg_runtime to the autosummary API reference. |
| CHANGELOG.md | Documents the new module, plotting function, sample runtime file, example, and tests under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
solution_lifespans() will raise an IndexError on empty input (nfes[-1]) instead of a clear validation error. Since this is a public helper (and plot_archive_lifespans() already validates its own snapshots), it should defensively reject empty snapshots with a ValueError for clearer caller behavior. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Parse Borg MOEA runtime files into archive snapshots and per-solution birth/death tables, and plot them as a survival chart with restart windows shaded. leaked_model_ids cross-references a Borg-RiverWare SolutionModels folder against snapshot history: files whose IDs appear in no snapshot were added and removed from the archive during a restart (when no runtime output is written), which is how snapshot-based model cleanup leaks files.
Bundles sample runtime file, example 07, and unit tests.