refactor(edm): invert ownership between AF3EDMSampler and EDMSamplerConfig#170
refactor(edm): invert ownership between AF3EDMSampler and EDMSamplerConfig#170marcuscollins merged 3 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRefactors AF3EDMSampler to be config-driven: EDMSamplerConfig is introduced/used as the single initializer argument for AF3EDMSampler, the EDMSamplerConfig.create_sampler() factory was removed, and all internal sampler accesses were migrated to use Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/sampleworks/core/samplers/edm.py (1)
156-157: Document the new config-driven constructor.
AF3EDMSamplernow accepts a singleEDMSamplerConfig, but__init__has no NumPy-style docstring and the class docstring still reads like the sampler knobs are passed directly to the constructor. Please documentconfighere or update the class docstring to match the new API.As per coding guidelines,
**/*.py: Always include NumPy-style docstrings for every function and class.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/sampleworks/core/samplers/edm.py` around lines 156 - 157, The constructor __init__(self, config: EDMSamplerConfig) lacks a NumPy-style docstring and the AF3EDMSampler class docstring still implies individual sampler knobs are passed; update either the AF3EDMSampler class docstring or add a NumPy-style docstring to __init__ that clearly documents the single parameter config (type EDMSamplerConfig), its fields/purpose, and any defaults/side-effects so the public API matches the new config-driven initialization; reference the AF3EDMSampler class and its __init__ method and ensure the new docstring follows the project's NumPy-style docstring conventions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/conftest.py`:
- Around line 249-256: The code in the config_class_path branch constructs a
config from info.default_kwargs and then calls create_component_from_info while
create_component_from_info rebuilds kwargs from info.default_kwargs again, which
re-applies defaults and can override config-backed constructor defaults; fix by
passing the constructed config directly to create_component_from_info (use the
existing variable config and do not rebuild or pass
info.default_kwargs/extra_kwargs into create_component_from_info) so
instantiation uses the config object's values; locate the branch referencing
config_class_path, config_cls, config_kwargs, and the call to
create_component_from_info and remove the redundant reconstruction of
default_kwargs before instantiation.
---
Nitpick comments:
In `@src/sampleworks/core/samplers/edm.py`:
- Around line 156-157: The constructor __init__(self, config: EDMSamplerConfig)
lacks a NumPy-style docstring and the AF3EDMSampler class docstring still
implies individual sampler knobs are passed; update either the AF3EDMSampler
class docstring or add a NumPy-style docstring to __init__ that clearly
documents the single parameter config (type EDMSamplerConfig), its
fields/purpose, and any defaults/side-effects so the public API matches the new
config-driven initialization; reference the AF3EDMSampler class and its __init__
method and ensure the new docstring follows the project's NumPy-style docstring
conventions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fe38ca3b-5cf0-45b3-a42c-a461ee1f4254
📒 Files selected for processing (5)
src/sampleworks/core/samplers/edm.pysrc/sampleworks/utils/guidance_script_utils.pytests/conftest.pytests/integration/test_mismatch_integration.pytests/integration/test_pipeline_integration.py
Address issue #79
Changes that might benefit from extra attention is in
conftest.py, where I made changes toclass ComponentInfo,SAMPLER_REGISTRYandcreate_sampler_from_typeto handle this refactor.Summary by CodeRabbit