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

Make composites scoped #151

Merged
merged 7 commits into from
Mar 25, 2025

Conversation

randomir
Copy link
Member

Also, close #150.

@randomir
Copy link
Member Author

Adding versionadded and note to all composites might be an overkill, let me know what you think, @arcondello, @JoelPasvolsky.

@arcondello
Copy link
Member

Way overkill IMO. They publicly inherit, so it suffices to just document on the base class.

@randomir randomir force-pushed the feature/make-composites-scoped branch from a02f5ba to 4761a9f Compare March 21, 2025 18:41
Copy link
Contributor

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you be adding the close() method to the docs?

@randomir
Copy link
Member Author

Ok, I removed the note from composites.

TBH, I liked having those specific examples that remind users they should use the new context manager form, but I trust our docs team will illustrate this nicer in a shared/common place.

@randomir
Copy link
Member Author

Will you be adding the close() method to the docs?

I wasn't planning to. We don't have it on dwave-system composites either. Nor we have __enter__/__exit__ (though, I'm not sure these dunder methods should be listed 🤷).

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso

Verified

This commit was signed with the committer’s verified signature.
aduh95 Antoine du Hamel

Verified

This commit was signed with the committer’s verified signature.
aduh95 Antoine du Hamel
@randomir randomir force-pushed the feature/make-composites-scoped branch from 4761a9f to 56599c8 Compare March 21, 2025 18:54
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.53%. Comparing base (1c92e37) to head (607c30c).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #151      +/-   ##
==========================================
+ Coverage   98.50%   98.53%   +0.03%     
==========================================
  Files          19       20       +1     
  Lines        1002     1026      +24     
==========================================
+ Hits          987     1011      +24     
  Misses         15       15              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted my previous comments, my misunderstanding, sorry

@JoelPasvolsky
Copy link
Contributor

Actually I'm now thinking that the composites do the context management for the user, right? So my previous comments are likely wrong.

Copy link
Member

@arcondello arcondello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code seems good! I feel ambivalent about the doc changes.

@randomir
Copy link
Member Author

Actually I'm now thinking that the composites do the context management for the user, right? So my previous comments are likely wrong.

They don't magically wrap children in runtime contexts, if that's what you mean. Users still need to use these composites as context managers in order to trigger close on resources wrapped. Examples in the deleted commit.

Verified

This commit was signed with the committer’s verified signature.
aduh95 Antoine du Hamel
Co-authored-by: Joel Pasvolsky <[email protected]>
@randomir randomir merged commit 012f054 into dwavesystems:main Mar 25, 2025
40 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.

Fix inheritance order in SpinReversalTransformComposite
3 participants