Add periodic bond wrapping support in plotting functions#149
Closed
eyjafjallac wants to merge 5 commits into
Closed
Add periodic bond wrapping support in plotting functions#149eyjafjallac wants to merge 5 commits into
eyjafjallac wants to merge 5 commits into
Conversation
- Introduced `show_periodic_wrap_bonds` parameter in both `plot_structure_mpl` and `plot_structure` functions to control the visualization of bonds that cross periodic boundaries. - Updated `compute_bonds` function to handle periodic boundary conditions more effectively, allowing for accurate bond representation in periodic lattices. - Enhanced documentation and tests to cover the new functionality and ensure correct behavior in various scenarios.
…eadability - Reformatted the assignment of `boundary_basis` in the `compute_bonds` function to enhance code clarity by breaking it into multiple lines. - This change aims to maintain consistency in code style and improve maintainability.
2 tasks
- Introduced `show_periodic_wrap_bonds` and `periodic_image_opacity` parameters in `plot_structure_mpl` and `plot_structure` functions to enhance visualization of bonds in periodic lattices. - Updated the `compute_bonds` function to improve handling of periodic boundary conditions, ensuring accurate bond representation. - Enhanced documentation to reflect these new features and their usage.
- Added notes for `show_periodic_wrap_bonds` and `periodic_image_opacity` parameters in the documentation to clarify their effects on bond connectivity and periodic-image visibility in plotting functions. - Enhanced the clarity of the documentation to ensure users understand the usage of these new features.
…ions - Introduced `bond_mode` parameter in `plot_structure_mpl` and `plot_structure` functions to allow users to specify bond-neighbor selection modes: `auto`, `nearest`, or `periodic`. - Updated the `compute_bonds` function to validate the `bond_mode` and ensure proper handling of periodic boundary conditions. - Enhanced documentation to clarify the usage of the new `bond_mode` parameter and its implications for bond visualization. - Added tests to verify the correct behavior of the new functionality and to ensure that invalid bond modes are properly rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compute_bondsinext/plots/src/qten_plots/_utils.pyto make periodic bond selection more robust and deterministic._plotly_impl.py,_mpl_impl.py) to pass lattice/offset metadata into bond computation.show_periodic_wrap_bonds(defaultFalse) to structure plotting so users can hide wrap-around seam bonds for cleaner finite-cell visuals, while still allowing torus-style wrap bonds when needed.Why
TODO
kagome.plot("structure")shows clean nearest-neighbor bonds without seam-wrap artifacts.kagome.plot("structure")no longer shows spurious extra-looking bonds in default mode.backend="plotly"backend="matplotlib"shape=(12, 12)honeycombandkagomeremains acceptable.