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 ProjwfcBandWorkchain #787

Merged
merged 28 commits into from
Oct 4, 2024
Merged

adding ProjwfcBandWorkchain #787

merged 28 commits into from
Oct 4, 2024

Conversation

AndresOrtegaGuerrero
Copy link
Member

This PR includes the ProjwfcBandWorkChain from aiida-wannier90-workflows to add fat band calculation option in the Bands plugin

@AndresOrtegaGuerrero AndresOrtegaGuerrero marked this pull request as draft July 31, 2024 07:31
@AndresOrtegaGuerrero
Copy link
Member Author

AndresOrtegaGuerrero commented Sep 25, 2024

This PR introduces the Fat bands feature to the app. #826 #819

I propose to do a new workchain BandsWorkChain, to select between PwBands vs ProjwfcBands, I was wondering if we can debate about this , first if you guys agree and/or if you have other suggestions.

@superstar54 @mikibonacci , @edan-bainglass

@superstar54 (I was wondering if you could help me the pytest failing?
I havent been able to find the error, I think is because the code doesn't get set (projwfc).
And somehow it appears even if 'bands' property is checked

image

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 72.28261% with 51 lines in your changes missing coverage. Please review.

Project coverage is 67.95%. Comparing base (fc8d0a5) to head (4b6c9c3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/aiidalab_qe/plugins/bands/bands_workchain.py 72.72% 39 Missing ⚠️
src/aiidalab_qe/plugins/bands/workchain.py 68.42% 6 Missing ⚠️
src/aiidalab_qe/plugins/bands/result.py 62.50% 3 Missing ⚠️
...aiidalab_qe/plugins/electronic_structure/result.py 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #787      +/-   ##
==========================================
- Coverage   67.98%   67.95%   -0.04%     
==========================================
  Files          49       50       +1     
  Lines        4389     4475      +86     
==========================================
+ Hits         2984     3041      +57     
- Misses       1405     1434      +29     
Flag Coverage Δ
python-3.11 67.95% <72.28%> (-0.04%) ⬇️
python-3.9 67.98% <72.28%> (-0.04%) ⬇️

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.

@AndresOrtegaGuerrero AndresOrtegaGuerrero marked this pull request as ready for review September 26, 2024 09:17
@superstar54 superstar54 linked an issue Sep 26, 2024 that may be closed by this pull request
@AndresOrtegaGuerrero
Copy link
Member Author

There is a new release of aiida-wannier90-workflows , so we can evaluate this PR for merging it with aiidalab-qe

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.

Generally looks okay. See my comments, but no changes required, just clarification.

Comment on lines +64 to +66
aiida.workflows =
aiidalab_qe.bands_workchain = aiidalab_qe.plugins.bands.bands_workchain:BandsWorkChain

Copy link
Member

Choose a reason for hiding this comment

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

We already had bands calculation via the built-in bands plugin. I'm surprised there wasn't already an associated workflow.

Copy link
Member Author

Choose a reason for hiding this comment

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

No , because , we were calling a workflow from aiida-quantumespresso plugin, therefore that workchain is already present. Here I did a new one to be able to switch between the from aiida-quantumespresso and the one from aiida-wannier90-workflows (capable of the fat bands)

@@ -0,0 +1,382 @@
import math
Copy link
Member

Choose a reason for hiding this comment

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

Conceptually, what's the difference between workchain.py and bands_workchain.py? The latter breaks from the plugin template a bit, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, the workchain.py, is that one used within the "architecture" of the plugin system within aiidalab-qe. While this bands_workchain is the actual aiida workflow, that workchain.py (is more like a controller that calls the workflow builder) passes the builder for the app.

Copy link
Member

Choose a reason for hiding this comment

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

Why not migrate this new workflow to aiida-quantumespresso?

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, I should have read the comment above first 😅 So it is because it combines workflows from two plugins, correct?

Comment on lines 19 to 22
if "bands" in self.node.outputs.bands:
bands_node = self.node.outputs.bands.bands
elif "bands_projwfc" in self.node.outputs.bands:
bands_node = self.node.outputs.bands.bands_projwfc
Copy link
Member

Choose a reason for hiding this comment

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

So it's regular of fat? Am I understanding it correctly? Not possible to combine the mechanics? I guess it's a different code, so no.

Copy link
Member Author

@AndresOrtegaGuerrero AndresOrtegaGuerrero Oct 2, 2024

Choose a reason for hiding this comment

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

yeah, the feature somehow are in different aiida plugins, the "regular" is from aiida-quantumespresso, while the "fat bands" from the wannier90-workflows

src/aiidalab_qe/plugins/bands/setting.py Outdated Show resolved Hide resolved
Copy link
Member

@mikibonacci mikibonacci left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @AndresOrtegaGuerrero, I added few comments on something that is unclear to me

],
value="hexagonal",
self.projwfc_bands = ipw.Checkbox(
description="Fat bands calculation",
Copy link
Member

Choose a reason for hiding this comment

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

Hi @AndresOrtegaGuerrero, could you add some more description here? maybe is not clear what "fat bands" mean, for a non expert user (I am thinking about experimentalists). Thanks!

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 added a description let me know what you think

Copy link
Member

Choose a reason for hiding this comment

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

Hi @AndresOrtegaGuerrero, for me it is good! thanks!

@@ -20,7 +20,10 @@ def _update_view(self):
pdos_node = None

try:
bands_node = self.node.outputs.bands
if "bands" in self.node.outputs.bands:
Copy link
Member

Choose a reason for hiding this comment

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

Hi @AndresOrtegaGuerrero, I don't understand why we need to put this block of code, as it it already in plugins/bands/result.py

Copy link
Member Author

Choose a reason for hiding this comment

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

This is because now we have a BandWorkChain, that selects between the one from aiida-quantumespresso or the one from aiida-wannier90-workflows (for doing fat bands)

Copy link
Member

Choose a reason for hiding this comment

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

I see. thanks!

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 will modify this code , because , if we merge it like this , it wont be compatible with previous versions that contain Bands calculations

@AndresOrtegaGuerrero
Copy link
Member Author

AndresOrtegaGuerrero commented Oct 2, 2024

image

Copy link
Member

@mikibonacci mikibonacci left a comment

Choose a reason for hiding this comment

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

Hi @AndresOrtegaGuerrero, LGTM! We can merge the PR

@AndresOrtegaGuerrero
Copy link
Member Author

@mikibonacci @edan-bainglass , I modify the result.py part from the bands plugin. With this change there is backwards compatibility of bands calculations using previous versions of the app.

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! Thanks

@AndresOrtegaGuerrero AndresOrtegaGuerrero linked an issue Oct 3, 2024 that may be closed by this pull request
Copy link
Member

@mikibonacci mikibonacci left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@AndresOrtegaGuerrero AndresOrtegaGuerrero merged commit 2b3963a into main Oct 4, 2024
12 checks passed
@AndresOrtegaGuerrero AndresOrtegaGuerrero deleted the bands_projwfn branch October 4, 2024 08:47
edan-bainglass added a commit to edan-bainglass/aiidalab-qe that referenced this pull request Oct 24, 2024
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 Fat bands Improve the band structure advanced tab
4 participants