Skip to content

changed default trs for spin >=non-collinear to be false #927

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

Merged
merged 2 commits into from
Jun 3, 2025
Merged

Conversation

zerothi
Copy link
Owner

@zerothi zerothi commented Jun 3, 2025

This should make life simpler for end-users.

This should make life simpler for end-users.

Signed-off-by: Nick Papior <[email protected]>
trs = True
try:
trs = parent.spin <= Spin("polarized")
except AttributeError:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.

Copilot Autofix

AI about 1 month ago

To fix the issue, we should handle the AttributeError in a meaningful way or, if it is safe to ignore, add a comment explaining why the exception is being ignored. In this case, we will assume that the exception is safe to ignore but will add a comment to clarify the intent. This ensures that future developers understand the reasoning behind the empty except block.


Suggested changeset 1
src/sisl/physics/brillouinzone.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/sisl/physics/brillouinzone.py b/src/sisl/physics/brillouinzone.py
--- a/src/sisl/physics/brillouinzone.py
+++ b/src/sisl/physics/brillouinzone.py
@@ -800,2 +800,3 @@
             except AttributeError:
+                # If the parent object does not have a 'spin' attribute, assume TRS is True.
                 pass
EOF
@@ -800,2 +800,3 @@
except AttributeError:
# If the parent object does not have a 'spin' attribute, assume TRS is True.
pass
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.86%. Comparing base (cb429c1) to head (4b80e65).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #927   +/-   ##
=======================================
  Coverage   86.86%   86.86%           
=======================================
  Files         412      412           
  Lines       54286    54296   +10     
=======================================
+ Hits        47155    47165   +10     
  Misses       7131     7131           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zerothi zerothi merged commit f942154 into main Jun 3, 2025
17 checks passed
@zerothi zerothi deleted the 926-trs-mp branch June 3, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change default trs for Monkhorst pack
1 participant