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

Use isclose over == for overlap position check in SlabGenerator.get_slabs #3825

Merged

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented May 13, 2024

Summary

Follow up #3748.

  • Use isclose over == for overlap check in SlabGenerator.get_slabs
  • Add a new ztol arg to control the behavior of get_slabs, default to 0 to keep consistency with previous behavior

Use isclose over == for overlap check in SlabGenerator.get_slabs

Previously a z_range is neglected only when two coordinates are exactly the same.

# Neglect overlapping positions
elif z_range[0] != z_range[1]:
# TODO (@DanielYang59): use the following for equality check
# elif not isclose(z_range[0], z_range[1], abs_tol=tol):
z_ranges.append(z_range)

Need discussion

However I'm not quite sure if checking the z_range really make much sense, as it's not possible to know whether terminating at a specific z-coordinate really breaks a bond (cannot calculate bond-distance just by z-distance).

It might be good to implement a method to detect bond broken by distance?

@DanielYang59

This comment was marked as outdated.

@DanielYang59 DanielYang59 marked this pull request as ready for review May 15, 2024 10:02
@DanielYang59 DanielYang59 marked this pull request as draft May 15, 2024 11:03
@DanielYang59 DanielYang59 marked this pull request as ready for review May 16, 2024 04:12
@DanielYang59
Copy link
Contributor Author

DanielYang59 commented May 18, 2024

@janosh Would appreciate it if I could get this reviewed. Thanks!

@shyuep shyuep merged commit 0c9ff40 into materialsproject:master May 30, 2024
23 checks passed
@DanielYang59 DanielYang59 deleted the fix-position-check-in-get-slabs branch May 30, 2024 23:53
@janosh janosh added fix Bug fix PRs surfaces Surface analysis labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PRs surfaces Surface analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants