Repository navigation
Use dimension-aware default origins for model transformations - #244
Open
davrens101 wants to merge 3 commits into
Open
davrens101 wants to merge 3 commits into
davrens101 wants to merge 3 commits into
Conversation
Author
|
CI currently stops during runner preparation, before checkout or tests: GitHub rejects the workflow's retired |
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.
Problem
Model.change_unit_cellandModel.fold_modeldefault their origin arguments to(0, 0, 0)regardless ofmodel.dim. Consequently, otherwise valid 1D and 2D models fail when callers omit the origin:change_unit_cell()fails while solving a dim×dim system with the three-component default.fold_model(new_unit_cell=..., orbital_labels=...)fails when applying that default to lower-dimensional unit-cell vertices.I reproduced both failures for 1D and 2D models, including a supercell/folding roundtrip. The same calls work when an explicit dimension-sized zero vector is supplied.
Change
Noneand resolve it tonp.zeros(self.dim).Executed validation
Python 3.11.18, NumPy 1.26.4, SciPy 1.17.1 on Windows; imports explicitly checked to resolve to this worktree.
pytest tests/test_change_unit_cell.py tests/test_folding.py tests/test_equivalent_operations.py tests/test_supercell.py -q: 260 passed.NamedTemporaryFileon Windows and raisePermissionError; four CLI tests pass the removedmix_stderrargument to the installed Click'sCliRunner. These tests were not modified or suppressed.This contribution was prepared with AI assistance. The runtime reproductions, physical-invariance checks, and test commands above were executed, not inferred.
GitHub CI
The original setup failure from retired cache/artifact actions is resolved. Both the generated workflow and its source template now use supported action versions.
Latest head
e7e2ebe298eebc02abc0001c7057e1cffb7f39b3: all seven checks passed, including documentation, pre-commit, the Python test matrix, and version consistency.