Skip to content

Add benchmarks, assert sorted breakpoints, harden integrals#19

Open
cgarling wants to merge 12 commits into
mainfrom
refac-1
Open

Add benchmarks, assert sorted breakpoints, harden integrals#19
cgarling wants to merge 12 commits into
mainfrom
refac-1

Conversation

@cgarling
Copy link
Copy Markdown
Owner

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.44%. Comparing base (2b30248) to head (a7801d6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   91.78%   93.44%   +1.66%     
==========================================
  Files           4        4              
  Lines         292      305      +13     
==========================================
+ Hits          268      285      +17     
+ Misses         24       20       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR strengthens the robustness and performance of the IMF distributions (notably BrokenPowerLaw and LogNormalBPL) by enforcing sorted breakpoints (required for binary search), hardening cumulative integral normalization used by quantile/rand, and adding a benchmarking setup to track performance over time.

Changes:

  • Enforce sorted breakpoints in BrokenPowerLaw and LogNormalBPL, and switch several index lookups from findfirst to searchsortedfirst.
  • Harden cumulative integrals by forcing the final cumulative value to 1 and add tests asserting normalization and boundary quantile behavior.
  • Add a benchmark project + suite + GitHub Actions workflow to run PR benchmarks.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/powerlaw.jl Require sorted breakpoints; use searchsortedfirst; force integrals[end] = 1 for robustness.
src/lognormal.jl Require sorted breakpoints; optimize pdf/logpdf indexing; force integrals[end] = 1; use first/last for min/max.
test/runtests.jl Add tests for sorted breakpoint assertions, integral normalization, and quantile boundary behavior.
test/allocations_tests.jl Remove @test_nowarn wrappers around allocation checks.
Project.toml Add a workspace definition including benchmark.
benchmark/Project.toml Add benchmark environment dependencies.
benchmark/benchmarks.jl Add benchmark suite for BrokenPowerLaw and LogNormalBPL + pretty summary output.
.github/workflows/benchmark.yml Add PR benchmark workflow using AirspeedVelocity.jl action.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread benchmark/benchmarks.jl Outdated
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.

2 participants