Skip to content

Conversation

@curtischong
Copy link
Collaborator

@curtischong curtischong commented Oct 25, 2025

Summary

Originally I wanted to delete it because it's not used in our codebase and we already have wrap_positions which works.

I also wanted to switch pbc_wrap_general's internal implementation to just use wrap_positions but couldn't because pbc_wrap_general wraps cells of arbitrary dimension (not just 3x3). So we're just going to deprecate this for now and delete it at a later date.

I think it's fine dropping support for this function later because an unused helper function that supports periodicity for nxn cell matrices that are bigger than 3x3 probably shouldn't be in torchsim.

Checklist

Before a pull request can be merged, the following items must be checked:

  • Doc strings have been added in the Google docstring format.
  • Run ruff on your code.
  • Tests have been added for any new functionality or bug fixes.

We highly recommended installing the prek hooks running in CI locally to speedup the development process. Simply run pip install prek && prek install to install the hooks which will check your code before each commit.

@curtischong curtischong added the breaking Breaking changes label Oct 25, 2025
@curtischong curtischong marked this pull request as draft October 25, 2025 18:12
@curtischong curtischong changed the title Remove pbc_wrap_general Since it's Not Used Deprecate pbc_wrap_general Oct 25, 2025

# Calculate expected result for first atom (using original algorithm for verification)
expected1 = ft.pbc_wrap_general(positions[0:1], cell1)
expected2 = ft.pbc_wrap_general(positions[1:2], cell2)
Copy link
Collaborator Author

@curtischong curtischong Oct 25, 2025

Choose a reason for hiding this comment

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

changing this test to wrap_positions removes our last dependence on the wrap_positions function in our codebase

@curtischong curtischong removed the breaking Breaking changes label Oct 25, 2025
@curtischong curtischong marked this pull request as ready for review October 25, 2025 23:57
Copy link
Collaborator

@orionarcher orionarcher left a comment

Choose a reason for hiding this comment

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

LGTM

@curtischong curtischong merged commit 4093de8 into TorchSim:main Oct 26, 2025
95 checks passed
@curtischong curtischong deleted the rm-pbc_wrap_general branch October 26, 2025 18:24
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.

2 participants