-
-
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
fixed pbc usage across sisl, fixes #764 #767
Conversation
There are some failing tests, but I don't know if they are related to this PR. Apart from that, could we set |
Thanks! This actually uncovered a bit more problematic issues, I'll ask for another review once completed. Thanks! |
periodic = list(periodic) | ||
try: | ||
periodic = map(direction, listify(periodic)) | listify | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException' Note
"""Allow piping of function calls""" | ||
return self(arg) | ||
|
||
def __getattr__(self, attr): |
Check notice
Code scanning / CodeQL
Non-standard exception raised in special method Note
builtin-class RuntimeError
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #767 +/- ##
==========================================
+ Coverage 87.25% 87.28% +0.03%
==========================================
Files 393 393
Lines 50177 50264 +87
==========================================
+ Hits 43783 43875 +92
+ Misses 6394 6389 -5 ☔ View full report in Codecov by Sentry. |
Ok, it got complicated, but the pbc was never really copied over, and this might have inflected problems here and there. I think it should be done now.! |
Now pbc usage has been moved across the code base (I hope everything is managed). I have added a setter for pbc to enable fast setting pbc. It will silently ignore any dimensions not specified. This may be used as a shorthand for lattice.set_boundary_condition(...) Signed-off-by: Nick Papior <[email protected]>
Signed-off-by: Nick Papior <[email protected]>
The boundary conditions were rarely properly shipped together with the Lattice methods. Basically it boiled down to the copy method which did not take all variables into account. This commit also addes a Listify|listify class|object that can be used to ensures arguments are converted to a list. It can be quite handy as it allows "piping". Enabled a setter for pbc to fast changing stuff. One can pass *none* to not change it. Signed-off-by: Nick Papior <[email protected]>
Signed-off-by: Nick Papior <[email protected]>
Now pbc usage has been moved across the
code base (I hope everything is managed).
I have added a setter for pbc to enable
fast setting pbc. It will silently ignore
any dimensions not specified.
This may be used as a shorthand for
lattice.set_boundary_condition(...)
@pfebrer could you please review this? I hope it fixes the issue!
translate2uc
should use boundary conditions (?) #764isort .
andblack .
[24.2.0] at top-leveldocs/
CHANGELOG.md