Skip to content

Conversation

marcelwa
Copy link
Collaborator

@marcelwa marcelwa commented May 11, 2025

Description

This PR adds a dictionary-like function interface to the Python bindings of operational_domain and critical_temperature_domain.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have added a changelog entry.
  • I have created/adjusted the Python bindings for any new or updated functionality.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@marcelwa marcelwa requested review from Drewniok and Copilot May 11, 2025 20:21
@marcelwa marcelwa self-assigned this May 11, 2025
@marcelwa marcelwa added enhancement New feature or request python Pull requests that update Python code labels May 11, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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:

@marcelwa marcelwa mentioned this pull request May 11, 2025
6 tasks
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented May 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.22%. Comparing base (c26cc54) to head (ea553d4).
⚠️ Report is 57 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           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           
Files with missing lines Coverage Δ
.../algorithms/simulation/sidb/operational_domain.hpp 94.91% <ø> (ø)
...orithms/simulation/sidb/sidb_simulation_domain.hpp 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ca8e43...ea553d4. Read the comment docs.

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

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Collaborator

@Drewniok Drewniok left a 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.

@marcelwa
Copy link
Collaborator Author

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! 🙏

@marcelwa marcelwa merged commit 5eafc53 into main May 12, 2025
49 checks passed
@marcelwa marcelwa deleted the opdom-pyfiction-features branch May 12, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants