-
Notifications
You must be signed in to change notification settings - Fork 28
🐍 Add Pythonic dictionary-like interfaces to operational_domain
and critical_temperature_domain
#741
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
Conversation
There was a problem hiding this 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 pull request adds Pythonic dictionary-like interfaces to the bindings for both operational and critical temperature domains, enabling users to interact with these domains using familiar Python container semantics.
- Modified the access level in the simulation domain header to allow subclassing.
- Removed an unused include in the operational domain header.
- Updated tests to verify the new getitem, setitem, contains, len, and iteration behaviors.
- Enhanced Python bindings to expose dictionary-like operations for both critical temperature and operational domains.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
include/fiction/algorithms/simulation/sidb/sidb_simulation_domain.hpp | Changed access specifier from private to protected to support subclassing. |
include/fiction/algorithms/simulation/sidb/operational_domain.hpp | Removed an unused include. |
bindings/mnt/pyfiction/test/algorithms/simulation/sidb/test_operational_domain.py | Updated tests to validate the new dictionary-like interface and adjusted key dimensions. |
bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/operational_domain.hpp | Added Pythonic interface functions (getitem, setitem, etc.) to both domain types. |
Comments suppressed due to low confidence (1)
include/fiction/algorithms/simulation/sidb/sidb_simulation_domain.hpp:96
- Changing the access modifier from 'private' to 'protected' increases member accessibility; please ensure this aligns with the intended design for subclassing without exposing internal state unintentionally.
protected:
clang-tidy review says "All clean, LGTM! 👍" |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #741 +/- ##
=======================================
Coverage 98.22% 98.22%
=======================================
Files 255 255
Lines 42778 42778
Branches 2003 2002 -1
=======================================
Hits 42018 42018
Misses 760 760
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks! That's a great change. I have adapted the failing python unit tests. Hence, the CI should pass now.
Thank you so much, Jan! 🙏 |
Description
This PR adds a dictionary-like function interface to the Python bindings of
operational_domain
andcritical_temperature_domain
.Checklist: