-
Notifications
You must be signed in to change notification settings - Fork 12
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
Improve k point labelling when there are discontinuities in the path #51
Conversation
Combine kpoint labels when plotting the unfolded effective band structure.
WalkthroughThe changes involve updating the version number from Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Unfold
participant Plotting
User->>Unfold: Call get_kpoint_distances(hide_discontinuities=True)
Unfold->>Unfold: Check for discontinuities
Unfold->>Unfold: Calculate distances
Unfold-->>User: Return distances
User->>Plotting: Call _add_kpoint_labels()
Plotting->>Unfold: Call get_combined_kpoint_labels()
Unfold-->>Plotting: Return combined kpoint labels
Plotting-->>User: Add labels to kpoints
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- easyunfold/init.py (1 hunks)
- easyunfold/plotting.py (1 hunks)
- easyunfold/unfold.py (1 hunks)
Files skipped from review due to trivial changes (1)
- easyunfold/init.py
Additional comments not posted (3)
easyunfold/plotting.py (1)
375-375
: Verify the function usage in the codebase.The method now retrieves k-point labels using
self.unfold.get_combined_kpoint_labels()
. Ensure that all function calls to_add_kpoint_labels
are correctly updated to reflect this change.Run the following script to verify the function usage:
Verification successful
Function Usage Verified
The function
_add_kpoint_labels
is consistently used across the codebase with the updated implementation. The calls to this function are correctly aligned with the changes made to retrieve k-point labels usingself.unfold.get_combined_kpoint_labels()
.
- All occurrences of
_add_kpoint_labels
ineasyunfold/plotting.py
reflect the new implementation.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `_add_kpoint_labels` match the new implementation. # Test: Search for the function usage. Expect: Only occurrences of the new implementation. rg --type python -A 5 $'_add_kpoint_labels'Length of output: 73
Script:
#!/bin/bash # Description: Verify all function calls to `_add_kpoint_labels` match the new implementation. # Test: Search for the function usage. Expect: Only occurrences of the new implementation. rg -A 5 '_add_kpoint_labels'Length of output: 1328
easyunfold/unfold.py (2)
618-645
: Verify the logic for handling discontinuities.The function introduces a new parameter
hide_discontinuities
to handle discontinuities in the kpoint path. Ensure that the logic correctly identifies and adjusts distances for discontinuities.
- Verify that the logic correctly identifies adjacent kpoint labels and adjusts distances accordingly.
- Ensure that the function is tested with various kpoint paths to confirm the correctness of the discontinuity handling.
648-659
: Verify the logic for combining labels.The function combines adjacent kpoint labels into a single entry when they are directly connected. Ensure that the logic correctly identifies and combines adjacent labels.
- Verify that the logic correctly identifies adjacent kpoint labels and combines them into a single entry.
- Ensure that the function is tested with various kpoint labels to confirm the correctness of the label combination.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
==========================================
- Coverage 87.37% 87.32% -0.05%
==========================================
Files 10 10
Lines 2028 2044 +16
==========================================
+ Hits 1772 1785 +13
- Misses 256 259 +3 ☔ View full report in Codecov by Sentry. |
Looks good to me @zhubonan! Thanks for dealing with this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- README.md (1 hunks)
- docs/index.md (1 hunks)
Files skipped from review due to trivial changes (2)
- README.md
- docs/index.md
Combine the labels of points when there is a discontinuity. Such points are labelled by the
A|B
sytax.Example:
This fixes issue #49 where the flat bands are caused using the apparent distance between two k-point where the path was discontinuous.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation