Skip to content

Add check_potcar: bool = True to MaterialsProject2020Compatibility, MaterialsProjectDFTMixingScheme and PotcarCorrection #3143

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

Merged
merged 9 commits into from
Jul 12, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Jul 11, 2023

Closes #2499, closes #2952 (and #3142).

07f9730 add check_potcar: bool = True to PotcarCorrection
c008776 add check_potcar: bool = True to MaterialsProject2020Compatibility
19f88c0 add check_potcar: bool = True to MaterialsProjectDFTMixingScheme
0209a5a fix broken test due to modified error msg

@Andrew-S-Rosen
Copy link
Member

You are the hero we don't deserve.

@Andrew-S-Rosen
Copy link
Member

Closes #2952 as well?

@shyuep
Copy link
Member

shyuep commented Jul 11, 2023

Pls do not merge this. I have a different fix.

@janosh
Copy link
Member Author

janosh commented Jul 11, 2023

@arosen93 Re #2952 not 100% sure since there was talk of a ComputedEntry.from_settings method in that issue. Not sure if anyone still wants that if you can set MaterialsProject2020Compatibility(check_potcar=False).

@shyuep
Copy link
Member

shyuep commented Jul 11, 2023

I just pushed a fix. A global .pmgrc.yaml setting called DISABLE_POTCAR_CHECKS would skip all potcar checking in compatibility.

@shyuep shyuep closed this Jul 11, 2023
@janosh
Copy link
Member Author

janosh commented Jul 11, 2023

I don't think this needs to be closed. Having the option to disable check_potcar on a case-by-case basis is still useful. Plus not every user knows about .pmgrc.yaml.

@janosh janosh reopened this Jul 11, 2023
@bowen-bd
Copy link

Thanks a lot for implementing this!

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Jul 12, 2023

I agree that there is still value for a kwarg (although the global setting is nice too).

@janosh
Copy link
Member Author

janosh commented Jul 12, 2023

@shyuep Forgot to mention this morning I think it'd be better to call the .pmgrc flag POTCAR_CHECKS: true | false rather than DISABLE_POTCAR_CHECKS: false | true. Easier to read:

- if SETTINGS.get("DISABLE_POTCAR_CHECKS", False):
+ if not SETTINGS.get("POTCAR_CHECKS"):
    return ufloat(0.0, 0.0)

@shyuep
Copy link
Member

shyuep commented Jul 12, 2023

Sure. Go ahead and make the change, including the new documentation on global config variables that I added this morning. I don't have a strong opinion on this.

@janosh
Copy link
Member Author

janosh commented Jul 12, 2023

Will do. Just added tests for check_potcar in MaterialsProjectDFTMixingScheme and MaterialsProjectCompatibility2020. I think this is ready to go.

@janosh janosh added enhancement A new feature or improvement to an existing one ux User experience mixing-schemes About mixing energies from different DFT functionals labels Jul 12, 2023
@janosh janosh enabled auto-merge (squash) July 12, 2023 22:19
@janosh janosh changed the title Add check_potcar: bool = True to MaterialsProjectDFTMixingScheme Add check_potcar: bool = True to MaterialsProject2020Compatibility, MaterialsProjectDFTMixingScheme and PotcarCorrection Jul 12, 2023
@janosh janosh merged commit 15b0b8e into master Jul 12, 2023
@janosh janosh deleted the check_potcar-flag-MaterialsProjectDFTMixingScheme branch July 12, 2023 23:03
@janosh
Copy link
Member Author

janosh commented Jul 12, 2023

@shyuep One more thing (bringing this up just to make sure I'm not missing something). It seems you can't actually set booleans (or any type other than str like floats, ints, None for that matter) using the pmg CLI atm.

pmg config --add PMG_POTCAR_CHECKS False

will be stored as

PMG_POTCAR_CHECKS: 'False'

which is truthy and so the opposite of expected behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement to an existing one mixing-schemes About mixing energies from different DFT functionals ux User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MP2020Compability Add a kwarg to avoid POTCAR checking in correction scheme
4 participants