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

Fix selective_dyn handling issue in python>=3.12 #4097

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

kavanase
Copy link
Contributor

@kavanase kavanase commented Oct 8, 2024

Hi,
I noticed I was getting some deprecation warnings like these, when parsing vasprun.xml files with python=3.12:

[DeprecationWarning("Testing an element's truth value will always return True in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead."), DeprecationWarning("Testing an element's truth value will always return True in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.")]

I traced this down to this line (https://github.com/materialsproject/pymatgen/blob/master/src/pymatgen/io/vasp/outputs.py#L1465).
With this small update, it fixes selective_dyn handling (as mentioned in the warning, this would always be set to True with future versions) and avoids these deprecation warnings.

@shyuep shyuep merged commit 3ee17e2 into materialsproject:master Oct 23, 2024
42 checks passed
@shyuep
Copy link
Member

shyuep commented Oct 23, 2024

Thanks.

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