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

PDOSWorkChain - align energy range to fermi level #764

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

t-reents
Copy link

Hi,
I implemented the changes that where suggested in this comment #716 (comment).

I already talked about this PR with @mbercx. I am not familiar with pytest, so I did not include additional tests. I would be happy to get some help concerning the tests.

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @t-reents . The changes seem ok in principle, just have some suggestions.

aiida_quantumespresso/workflows/pdos.py Outdated Show resolved Hide resolved
aiida_quantumespresso/workflows/pdos.py Outdated Show resolved Hide resolved
@@ -219,14 +222,15 @@ def define(cls, spec):
help='Terminate workchain steps before submitting calculations (test purposes only).'
)
spec.input(
'align_to_fermi',
valid_type=orm.Bool,
'fermi_energy_range',
Copy link
Contributor

Choose a reason for hiding this comment

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

I might be saying something stupid because I wasn't part of the discussions, but does the name fermi_energy_range really make sense? The values define the energy window in which the DOS is computed. Does something like just energy_range or energy_window not make more sense?

Copy link
Author

Choose a reason for hiding this comment

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

I see your point. If a energy window is specified by this parameter, the DOS/PDOS is computed in this range with respect to the fermi energy. For example, the range 0 - 30 eV is specified and the fermi energy is 7 eV, then the DOS would be computed in the range 7 - 37 eV. Therefore, I think it would be useful to indicate this also by the name of the input parameter (but maybe the description in the help keyword would be already enough).

Copy link
Contributor

Choose a reason for hiding this comment

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

To me it reads a bit weird having it in the option, so I would vote to put it simply in the description that it is relative to the fermi level. I will let @mbercx have the final vote.

Copy link
Member

@mbercx mbercx Jan 7, 2022

Choose a reason for hiding this comment

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

Sorry for being later to the party! Although I agree the name isn't perfect, I still think it's better to highlight that it's an energy range around the Fermi level by adding it to the name. Maybe energy_range_fermi would give less of an impression that there is some range of Fermi levels considered?

EDIT: Or energy_range_vs_fermi, if that isn't too long?

Copy link
Author

Choose a reason for hiding this comment

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

Personally, I like the last one but I leave this up to you

Copy link
Contributor

Choose a reason for hiding this comment

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

I also vote for the latter 👍 A few more characters is almost always preferable if it adds clarity. So @t-reents please feel free to go with that one, update the PR and we can merge. Thanks!

Copy link
Author

Choose a reason for hiding this comment

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

The changes are now included

aiida_quantumespresso/workflows/pdos.py Outdated Show resolved Hide resolved
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @t-reents , just some final minor nitpicks that I noticed. Then I let @mbercx decide on the naming of the input. Once that is decided and applied we can merge this

aiida_quantumespresso/workflows/pdos.py Outdated Show resolved Hide resolved
aiida_quantumespresso/workflows/pdos.py Outdated Show resolved Hide resolved
aiida_quantumespresso/workflows/pdos.py Outdated Show resolved Hide resolved
@@ -219,14 +222,15 @@ def define(cls, spec):
help='Terminate workchain steps before submitting calculations (test purposes only).'
)
spec.input(
'align_to_fermi',
valid_type=orm.Bool,
'fermi_energy_range',
Copy link
Contributor

Choose a reason for hiding this comment

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

To me it reads a bit weird having it in the option, so I would vote to put it simply in the description that it is relative to the fermi level. I will let @mbercx have the final vote.

aiida_quantumespresso/workflows/pdos.py Outdated Show resolved Hide resolved
@t-reents
Copy link
Author

t-reents commented Jan 4, 2022

Thanks again @sphuber. I committed your suggestions.

sphuber
sphuber previously approved these changes Jan 11, 2022
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks a lot @t-reents Good to go.

@t-reents
Copy link
Author

Thanks a lot for your comments and instructions! @sphuber

@sphuber
Copy link
Contributor

sphuber commented Jan 11, 2022

The tests are failing. Apparently the validator is being called even if no value is specified. We could solve this by explicitly checking for this value in the validator and in that case just returning, but really this should not be happening. I am looking into plumpy which is the library responsible for this part of the code on why it is calling the validator regardless. It is really weird because the logic does seem to prevent this from happening and there are unit tests for it. But apparently, the test here in aiida-quantumespresso has some edge condition. Will report back once I know more.

@mbercx mbercx force-pushed the issue_716_PDOS_WorkChain_align_energy_range_to_fermi_level branch from 3f22610 to ba9716e Compare May 10, 2023 05:22
@mbercx mbercx force-pushed the issue_716_PDOS_WorkChain_align_energy_range_to_fermi_level branch from ba9716e to a88dfc7 Compare May 10, 2023 05:23
@mbercx
Copy link
Member

mbercx commented May 10, 2023

Tests pass, but maybe we should add some more to properly test the functionality with and without the energy_range_vs_fermi input?

Also: maybe we should move the long module docstring into the documentation page of the work chain? Right now it's a bit empty:

https://aiida-quantumespresso--764.org.readthedocs.build/en/764/howto/workflows/pdos.html

@t-reents
Copy link
Author

Tests pass, but maybe we should add some more to properly test the functionality with and without the energy_range_vs_fermi input?

Also: maybe we should move the long module docstring into the documentation page of the work chain? Right now it's a bit empty:

https://aiida-quantumespresso--764.org.readthedocs.build/en/764/howto/workflows/pdos.html

For sure, I will add the testst, soon.

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.

3 participants