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

Avoid unnecessary errors when launching Wannier90OptimizeWorkChain #40

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

npaulish
Copy link
Collaborator

…related to the separate_plotting input.

Replace the errors with user warnings and extend the warning messages.

@@ -76,7 +88,7 @@ class Wannier90OptimizeWorkChain(Wannier90BandsWorkChain):
# chk file by setting `restart = plot` in wannier90.win.
_WANNIER90_PLOT_INPUTS = (
"wannier_plot",
"bands_plot",
# "bands_plot",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be great if you could add some explanations before the commented bands_plot, sth like

the bands_plot is commented out since it is rather cheap to compute, and also we want to check the band distance during each iteration of optimizing dis_proj_min/max even if we set `separate_plotting = True`

.get("wannier_plot", False)
):
builder.separate_plotting = True

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe move these lines after the next conditional of if reference_bands:, so that we only separate_plotting if we are going to optimize_disproj

if builder.optimize_disproj == True:
    YOUR_LINES_HERE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Do we still want to automatically separate plotting only if wannier_plot == True or always if optimize_disproj == True? The latter will cause a warning in case no plotting inputs are specified.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I mean we auto set separate_plotting = True only if both wannier_plot = True and optimize_disproj = True

src/aiida_wannier90_workflows/workflows/optimize.py Outdated Show resolved Hide resolved
…related to `separate_plotting` input.

Replace the errors with user warnings and extend the warning messages.

1. Automatically set `separate_plotting=True` if `optimize_disproj == True` and `wannier_plot == True`
2. Replace the error with a warning if `separate_plotting == True` but no plotting input is specified
3. Throw an error if `wannier_plot == True` but `separate_plotting == False`
@qiaojunfeng qiaojunfeng merged commit cf67a03 into aiidateam:main Dec 13, 2023
6 checks passed
@npaulish npaulish deleted the develop branch December 13, 2023 14:18
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.

2 participants