Simplify BZPath API with KPointSet#168
Merged
Merged
Conversation
…_reciprocal_path` Enhance the `interpolate_path` and `interpolate_reciprocal_path` functions to accept an optional `waypoint_transform` parameter, allowing for basis transformations of waypoint fractional coordinates before interpolation. Update documentation to reflect these changes and ensure proper error handling for invalid transform types and shapes. Add tests to verify the correct application of transforms and error conditions.
Consolidate multi-line function calls into single lines in the `test_interpolate_path` tests to enhance code clarity. This change simplifies the test structure while maintaining functionality and readability.
…`KPointSet` Update the `interpolate_path` and `interpolate_reciprocal_path` functions to accept a `KPointSet` for waypoint resolution, enhancing clarity and functionality. Remove support for direct fractional coordinates and associated parameters, streamlining the interface. Update documentation and tests to reflect these changes, ensuring proper error handling for invalid input types and maintaining backward compatibility where necessary.
This commit removes the `interpolate_reciprocal_path` function and its associated references from the codebase, including imports and documentation. The `interpolate_path` function has been updated to handle waypoint interpolation directly, ensuring that all relevant functionality is preserved. Tests have been adjusted accordingly to reflect these changes, enhancing clarity and maintaining functionality.
This commit consolidates multi-line list comprehensions and function calls into single lines across several files, enhancing code clarity. The changes include adjustments in `bands.py`, `ops.py`, `state_space.py`, and `test_bands.py`. These modifications aim to streamline the code structure while maintaining existing functionality and improving overall readability.
BZPath API with KPointSet
…iable This commit updates the test cases in `test_bands.py` to utilize a `waypoints` variable instead of hardcoded lists for improved readability and maintainability. The changes ensure that all instances of waypoint lists are consistently defined, enhancing clarity in the tests while preserving existing functionality.
Alphaharrius
requested changes
May 23, 2026
This commit introduces the `KPointSet` class, which encapsulates named high-symmetry momentum points associated with a reciprocal lattice. The class provides methods for creating a point set from momentum values or fractional coordinates, rebasing points in a new reciprocal lattice, and resolving momentum by name. Additionally, the `KPointSet` is imported in the `geometries` module, while its previous references in the `symbolics` module have been removed to streamline the codebase.
This commit modifies the `KPointSet` references in the `bands.py`, `spatials.py`, and `spatials.pyi` files to ensure consistency and clarity. The type annotations for the `from_points` method have been updated to use `sy.Rational` instead of `float`, enhancing type safety. Additionally, the `resolve` method has been removed from `KPointSet`, with its functionality replaced by direct access to the `points` attribute in the test cases, streamlining the code and improving readability.
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
KPointSetonly (named points + reciprocal-space context).interpolate_reciprocal_pathand consolidates path generation to a single API:interpolate_path(recip, waypoints: Sequence[str], points: KPointSet, n_points=100)KPointSet, rebases to targetrecip.qten.bands.interpolate_path.Migration
Before:
After:
Validation
tests/test_bands.pyandtests/test_plots.py.