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

Nanobind density changes #1307

Merged
merged 31 commits into from
Feb 7, 2025
Merged

Nanobind density changes #1307

merged 31 commits into from
Feb 7, 2025

Conversation

DomFijan
Copy link
Contributor

@DomFijan DomFijan commented Feb 6, 2025

This PR ports density module to nanobind.

Description

All classes have been ported using nanobind as interface instead of cython.

Motivation and Context

Part of nanobind porting initiative.

How Has This Been Tested?

All current tests pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds or improves functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation improvement (updates to user guides, docstrings, or developer docs)

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • I have updated the documentation (if relevant).
  • I have added tests that cover my changes (if relevant).
  • All new and existing tests passed.
  • I have updated the credits.
  • I have updated the Changelog.

Yvonne Amaria and others added 27 commits September 12, 2024 17:27
The implementation of `reduceAndReturn` does not allow the previous
pattern of calling `prepare` in `reduce`. In the new implemtnation,
`reduceAndReturn` will return the OLD array even after the new one is
created.

The solution is to override `reset`. In subclasses of
`BondHistogramCompute`, `reset` *must* call the base class implemtnation
which resets `m_historgram`. The subclass must then make new shared
arrays that are specific to that subclass. Lastly, the arrays must also
be initialized in the constructor to allow for the user to construct the
class and use it without calling `reset` first.
@janbridley janbridley marked this pull request as ready for review February 7, 2025 18:11
@janbridley janbridley requested a review from joaander February 7, 2025 18:11
@joaander joaander force-pushed the nanobind_density_changes branch from ae59028 to fda237d Compare February 7, 2025 21:02
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

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

Thanks!

@joaander joaander merged commit e1d69ac into nanobind Feb 7, 2025
33 checks passed
@joaander joaander deleted the nanobind_density_changes branch February 7, 2025 21:44
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.

4 participants