-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
mnt: changed only= keyword arguments to what= #542
Conversation
This is to unify interfaces that has these kinds of arguments. It affects Geometry|SuperCell.rotate and some tbtrans siles. To accommodate backwards compatibility for some time I have added a function to decorate methods enabling a keyword argument and replacing the *new* keyword argument with the old keyword argument. I believe users who use the old argument are not aware of the new one and hence it makes more sense. A deprecation warning is also issued. The default for Geometry.rotate is now also changed depending on whether atoms argument is supplied. - atoms is None: what="xyz+abc" - else what="xyz" when doing sub-rotations it makes more sense to only rotate the atomic coordinates, while rotations of everything makes more sense to also rotate the lattice vectors. Signed-off-by: Nick Papior <[email protected]>
@@ -366,7 +366,7 @@ | |||
@pytest.mark.filterwarnings("ignore", message="*gridncSileSiesta.read_grid cannot determine") | |||
@pytest.mark.parametrize("sile", _my_intersect(["read_grid"], ["write_grid"])) | |||
def test_read_write_grid(self, sisl_tmp, sisl_system, sile): | |||
g = sisl_system.g.rotate(-30, sisl_system.g.cell[2, :]) | |||
g = sisl_system.g.rotate(-30, sisl_system.g.cell[2, :], what="xyz+abc") |
Check warning
Code scanning / CodeQL
Variable defined multiple times
Codecov Report
@@ Coverage Diff @@
## main #542 +/- ##
========================================
Coverage 86.25% 86.26%
========================================
Files 362 362
Lines 46289 46409 +120
========================================
+ Hits 39928 40033 +105
- Misses 6361 6376 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Looks good, thanks!
Signed-off-by: Nick Papior <[email protected]>
Signed-off-by: Nick Papior <[email protected]>
Thanks @tfrederiksen |
This is to unify interfaces that has these kinds of arguments. It affects Geometry|SuperCell.rotate and some tbtrans siles.
To accommodate backwards compatibility for some time I have added a function to decorate methods enabling a keyword argument and replacing the new keyword argument with the old keyword argument. I believe users who use the old argument are not aware of the new one and hence it makes more sense.
A deprecation warning is also issued.
The default for Geometry.rotate is now also changed depending on whether atoms argument is supplied.
only
orwhat
? #541CHANGELOG
@tfrederiksen could you please have a look whether this is ok? :)