chore: Suggestions for BestDose#218
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the BestDoseResult API by making its fields private and providing getter methods for controlled access. This improves encapsulation and API design.
Key Changes:
- Made
BestDoseResultfields private (pub(crate)) - Added public getter methods for accessing result data
- Introduced a new
doses()convenience method to extract dose amounts - Added
SerializeandDeserializederives toBestDoseResult
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bestdose/types.rs | Made BestDoseResult fields private and added public getter methods; added doses() helper method; added serialization support |
| tests/bestdose_tests.rs | Updated test code to use new getter methods instead of direct field access; replaced repetitive dose extraction code with doses() method |
| examples/bestdose_bounds.rs | Updated to use optimal_subject() and objf() getter methods |
| examples/bestdose_auc.rs | Updated to use new getter methods and doses() helper method |
| examples/bestdose.rs | Updated to use getter methods for accessing result fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Siel
approved these changes
Nov 5, 2025
Contributor
|
| Branch | bestdose-more-suggestions |
| Testbed | rust-moan |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | seconds (s) |
|---|---|---|
| bimodal_ke_npag | 📈 view plot | 24.03 s |
| bimodal_ke_npod | 📈 view plot | 10.51 s |
| bimodal_ke_postprob | 📈 view plot | 3.45 s |
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.
No description provided.