-
Notifications
You must be signed in to change notification settings - Fork 15
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
adding spin-orbit coupling to process label #954
adding spin-orbit coupling to process label #954
Conversation
AndresOrtegaGuerrero
commented
Nov 28, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #954 +/- ##
==========================================
+ Coverage 67.85% 67.87% +0.02%
==========================================
Files 110 110
Lines 6206 6210 +4
==========================================
+ Hits 4211 4215 +4
Misses 1995 1995
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
LGTM!
if soc_parameters: | ||
soc_info = ", spin-orbit coupling" | ||
else: | ||
soc_info = "" |
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.
if soc_parameters: | |
soc_info = ", spin-orbit coupling" | |
else: | |
soc_info = "" | |
soc_info = ", spin-orbit coupling" if soc_parameters else "" |
A bit more concise. If using VS Code, consider installing the Sourcery extension. It'll recommend (and optionally apply) best practices as you code.
@@ -109,7 +119,7 @@ def update_process_label(self): | |||
if workchain_data["spin_type"] != "none": | |||
protocol_and_magnetic_info += ", magnetic" | |||
properties_info = f"→ {', '.join(properties)}" if properties else "" | |||
label = f"{structure_label} [{relax_info}, {protocol_and_magnetic_info}] {properties_info}".strip() | |||
label = f"{structure_label} [{relax_info}, {protocol_and_magnetic_info}{soc_info}] {properties_info}".strip() |
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.
Consider doing
label_parts = [
relax_info,
protocol_and_magnetic_info,
soc_info,
..., # future info bits :)
]
then here
label = f"{structure_label} [{', '.join(label_parts)}] {properties_info}.strip()
Makes for easy future expansion 🙂
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.
I have updated the code , according to your suggestions , thanks!
…rtegaGuerrero/aiidalab-qe into spin_orbit_process_label