Repository navigation
Rename NSGAIISampler to NsgaiiSampler in Rust - #265
Merged
Merged
Conversation
The Python-visible class name `rustuna.samplers.NSGAIISampler` (pyclass name), the parent cache key prefix, and references to Optuna's sampler are kept unchanged.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The PR description incorrectly documents several renamed symbols with a nonexistent 2 suffix.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Renames the Rust NSGA-II sampler types while preserving the Python-visible API.
Changes:
- Renames
NSGAIISamplertoNsgaiiSampler. - Updates Rust benchmarks, tests, documentation, and PyO3 internals.
- Retains Python class name
NSGAIISampler.
| File | Description |
|---|---|
rustuna_sampler/src/nsgaii.rs |
Renames the sampler and references. |
rustuna_sampler/benches/nsgaii.rs |
Updates benchmark usage. |
rustuna_pyo3/src/study.rs |
Updates PyO3 sampler resolution. |
rustuna_pyo3/src/sampler/nsgaii.rs |
Renames the internal Python wrapper. |
rustuna_pyo3/src/lib.rs |
Registers the renamed wrapper. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /// } | ||
| /// ``` | ||
| pub struct NSGAIISampler { | ||
| pub struct NsgaiiSampler { |
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.

Summary
Follow-up to #212: align the sampler type name with the
NsgaiiBuildernaming (per the discussion with ozaki-san and PE baba-san).Changes
rustuna_sampler::nsgaii::NSGAIISampler→rustuna_sampler::nsgaii::NsgaiiSampler2Default,Samplerimpl,NsgaiiBuilder2::build,new,seed_from_u64signatures, and the tests innsgaii.rsPyNSGAIISampler2→PyNsgaiiSampler(src/sampler/nsgaii.rs,study.rs,lib.rs)rustuna_sampler/benches/nsgaii.rs: bench usesNsgaiiSampler::default()Unchanged (Rust-only rename):
rustuna.samplers.NSGAIISampler(#[pyclass(name = "NSGAIISampler2")]),.pyistubs,rustuna/samplers.py, Python tests, and docs"NSGAIISampler2:parent:"NSGAIISamplerin doc commentsVerification
cargo clippy --locked --workspace --lib --bins --tests --examples --all-features -- -D warnings— cleancargo test --locked --all-features— passcargo fmt --all -- --check— cleancargo +nightly bench --no-run— bench compiles (usesNsgaiiSampler::default())uv run pytest tests/— 701 passed, 18 skippedcargo test -p rustuna_storage --locked -- --ignored— 3 pass