Skip to content

chore: Add validation of parameters #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 24, 2025
Merged

chore: Add validation of parameters #136

merged 4 commits into from
Jun 24, 2025

Conversation

mhovd
Copy link
Collaborator

@mhovd mhovd commented Jun 3, 2025

Ensures that the parameter ranges are valid prior to initialization

Ensures that the parameter ranges are valid prior to initialization
@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 11:33
Copy link
Contributor

@Copilot 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 adds validation for parameter bounds before sampling and renames accessor methods in the Prior enum.

  • Renamed get_pointspoints and get_seedseed, with updated doc comments
  • Added a loop in sample_space to validate that each parameter’s bounds are finite, properly ordered, and non-zero
Comments suppressed due to low confidence (1)

src/routines/initialization/mod.rs:68

  • These new validation branches lack unit tests. Consider adding tests that exercise infinite bounds, reversed bounds, and zero‐range parameters to ensure each bail condition behaves as expected.
for param in settings.parameters().iter() {

Copy link
Contributor

github-actions bot commented Jun 3, 2025

🐰 Bencher Report

Branchparameter-validation
Testbedorion
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
seconds (s)
(Result Δ%)
Upper Boundary
seconds (s)
(Limit %)
bimodal_ke_fit📈 view plot
🚷 view threshold
9.71 s
(-40.47%)Baseline: 16.31 s
26.62 s
(36.46%)
🐰 View full continuous benchmarking report in Bencher

@mhovd mhovd requested a review from Copilot June 3, 2025 11:41
Copy link
Contributor

@Copilot 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 adds validation to ensure that parameter ranges are valid prior to initialization, preventing infinite bounds and invalid orderings. In addition, the PR refactors getter method names from get_points/get_seed to more idiomatic points/seed, while incorporating inline documentation for clarity.

Comments suppressed due to low confidence (1)

src/routines/initialization/mod.rs:68

  • Consider adding unit tests for the new parameter validation logic to ensure that the bail! calls are triggered as expected for infinite bounds and invalid ranges.
for param in settings.parameters().iter() {

@mhovd mhovd merged commit 02e9896 into main Jun 24, 2025
5 checks passed
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