Skip to content

Conversation

@mhovd
Copy link
Collaborator

@mhovd mhovd commented Nov 13, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 13, 2025 20:16
Copy link
Contributor

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 updates the NPResult structure to contain pre-calculated Posterior probabilities and optional NPPredictions, improving efficiency by calculating posterior probabilities once during initialization rather than repeatedly when needed.

  • Adds posterior and predictions fields to NPResult, calculated during initialization
  • Changes NPResult::new() to return Result<Self> to handle potential posterior calculation failures
  • Introduces calculate_predictions() method to lazily compute and store predictions
  • Updates parameter passing from owned Theta to borrowed &Theta for efficiency

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/structs/theta.rs Adds write_with_weights() method to write theta with corresponding weights to CSV
src/routines/output/predictions.rs Changes parameter from owned Theta to borrowed reference for efficiency
src/routines/output/mod.rs Adds posterior and predictions fields to NPResult, implements calculate_predictions(), and updates methods to use cached posterior
src/bestdose/predictions.rs Updates call to NPPredictions::calculate() with borrowed theta reference
src/algorithms/postprob.rs Changes into_npresult() signature to return Result<NPResult<E>>
src/algorithms/npod.rs Changes into_npresult() signature to return Result<NPResult<E>>
src/algorithms/npag.rs Changes into_npresult() signature to return Result<NPResult<E>>
src/algorithms/mod.rs Updates trait definition for into_npresult() to return Result and propagates error in fit()
examples/vanco_sde/main.rs Makes result mutable to support new write_outputs() signature
examples/two_eq_lag/main.rs Makes result mutable to support new write_outputs() signature
examples/theophylline/main.rs Makes result mutable to support new write_outputs() signature
examples/new_iov/main.rs Makes result mutable to support new write_outputs() signature
examples/neely/main.rs Makes result mutable to support new write_outputs() signature
examples/meta/main.rs Makes result mutable to support new write_outputs() signature
examples/iov/main.rs Makes result mutable to support new write_outputs() signature
examples/drusano/main.rs Makes result mutable and handles error from into_npresult()
examples/bimodal_ke/main.rs Makes result mutable to support new write_outputs() signature

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 13, 2025

🐰 Bencher Report

Branchoutputs-outputs-outputs
Testbedrust-moan
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
seconds (s)
(Result Δ%)
Upper Boundary
seconds (s)
(Limit %)
bimodal_ke_npag📈 view plot
🚷 view threshold
25.20 s
(+0.07%)Baseline: 25.18 s
26.40 s
(95.47%)
bimodal_ke_npod📈 view plot
🚷 view threshold
10.45 s
(-0.24%)Baseline: 10.47 s
10.68 s
(97.86%)
bimodal_ke_postprob📈 view plot
🚷 view threshold
3.47 s
(-0.12%)Baseline: 3.47 s
3.54 s
(97.95%)
🐰 View full continuous benchmarking report in Bencher

@Siel Siel merged commit caba246 into main Nov 17, 2025
6 checks passed
@Siel Siel deleted the outputs-outputs-outputs branch November 17, 2025 13:26
@github-actions github-actions bot mentioned this pull request Nov 17, 2025
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.

3 participants