Skip to content
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

Conversation

AndresOrtegaGuerrero
Copy link
Member

image

@AndresOrtegaGuerrero AndresOrtegaGuerrero linked an issue Nov 28, 2024 that may be closed by this pull request
2 tasks
@AndresOrtegaGuerrero
Copy link
Member Author

image

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.87%. Comparing base (92b8299) to head (fc8dca3).
Report is 1 commits behind head on main.

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              
Flag Coverage Δ
python-3.11 67.85% <100.00%> (+<0.01%) ⬆️
python-3.9 67.89% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@edan-bainglass edan-bainglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines 106 to 109
if soc_parameters:
soc_info = ", spin-orbit coupling"
else:
soc_info = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()
Copy link
Member

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 🙂

Copy link
Member Author

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!

@AndresOrtegaGuerrero AndresOrtegaGuerrero merged commit 3720501 into aiidalab:main Nov 28, 2024
8 checks passed
@AndresOrtegaGuerrero AndresOrtegaGuerrero deleted the spin_orbit_process_label branch November 28, 2024 16:13
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.

Add information on spin-orbit coupling in the default label
2 participants