Open
Conversation
4 tasks
Collaborator
Author
|
Maybe we should merge sth like this before merging #591 |
54ca82f to
769616e
Compare
Adds benchmarks/ directory with pytest-benchmark for timing and pytest-memray for peak memory measurement across problem sizes. Models: basic (dense N*N), knapsack (N binary vars), expression arithmetic (broadcasting/scaling), sparse network (ring topology), and pypsa_scigrid (real power system). Timing phases: build (test_build.py), LP write (test_lp_write.py), matrix generation (test_matrices.py). Memory benchmarks (memory.py) measure the build phase only — memray tracks all allocations within a test including setup, so other phases would conflate build and phase-specific memory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
769616e to
ad43736
Compare
Benchmarks are not run in CI and should not affect coverage metrics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents false failures from minor coverage fluctuations when adding non-library files like benchmarks or config changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The codecov/project failure is a pre-existing repo-wide issue (multiple open PRs fail the same check), not caused by this PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Internal performance benchmarks
Adds a
benchmarks/directory for tracking linopy's own build time, LP write speed, matrix generation, and peak memory across problem sizes.Tools
Models
basicknapsackexpression_arithmeticsparse_networkpypsa_scigridpypsa)Timing phases
test_build.pytest_lp_write.pytest_matrices.pyMemory benchmarks
memory.pyruns each test in a separate process with pytest-memray for accurate per-test peak memory. Results are saved as JSON for cross-branch comparison.Quick start
See
benchmarks/README.mdfor full details.Checklist
doc/release_notes.rstis included