Skip to content
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

Fix multiple inheritance in ComposedSampler and ComposedPolySampler #1402

Closed
randomir opened this issue Mar 20, 2025 · 0 comments · Fixed by #1403
Closed

Fix multiple inheritance in ComposedSampler and ComposedPolySampler #1402

randomir opened this issue Mar 20, 2025 · 0 comments · Fixed by #1403

Comments

@randomir
Copy link
Member

Currently, Sampler attributes override Composite attributes in ComposedSampler (and similarly in ComposedPolySampler):

class ComposedSampler(Sampler, Composite):
"""Abstract base class for dimod composed samplers.

Up until we implemented Scoped interface (.close()) on both Sampler and Composite, this was not an issue, as their methods didn't overlap.

However, now we want Composite.close() to override Sampler.close(), as it implements a meaningful behavior unlike the no-op close on sampler. Generally as well I think it makes sense for composite attributes to take precedence over sampler attrs on a composed sampler.

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 a pull request may close this issue.

1 participant