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

Bug in DictSet.kpoints due to operator precedence #2970

Closed
janosh opened this issue May 4, 2023 · 1 comment · Fixed by #2972
Closed

Bug in DictSet.kpoints due to operator precedence #2970

janosh opened this issue May 4, 2023 · 1 comment · Fixed by #2972
Labels

Comments

@janosh
Copy link
Member

janosh commented May 4, 2023

@shyuep I think there's a subtle operator precedence bug here:

if (
self.user_incar_settings.get("KSPACING")
or self._config_dict["INCAR"].get("KSPACING")
and self.user_kpoints_settings == {}
):
return None

and has higher precedence than or but unless I'm mistaken we actually want to evaluate the or first. The thing that throws me off is why this wasn't caught before.

if (
    self.user_incar_settings.get("KSPACING") or self._config_dict["INCAR"].get("KSPACING")
) and self.user_kpoints_settings == {}:
@janosh janosh added the bug label May 4, 2023
@shyuep
Copy link
Member

shyuep commented May 4, 2023

I agree. I did not write this though. I think the switch to KSPACING is relatively recent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants