-
Notifications
You must be signed in to change notification settings - Fork 922
Description
pymatgen/src/pymatgen/io/cp2k/sets.py
Lines 441 to 445 in c1db753
# Necessary if matching data to CP2K data files | |
if have_element_file: | |
with open(elem_file_path, encoding="utf-8") as file: | |
yaml = YAML(typ="unsafe", pure=True) | |
DATA = yaml.load(file) |
/Users/yang/developer/pymatgen/src/pymatgen/io/cp2k/sets.py:444: PendingDeprecationWarning:
you should no longer specify 'unsafe'.
For **dumping only** use yaml=YAML(typ='full')
yaml = YAML(typ="unsafe", pure=True)
https://yaml.dev/doc/ruamel.yaml/ it might be removed anytime I guess as the deadline was end of 2023:
There will be at least one more potentially breaking change in the 0.18 series: YAML(typ='unsafe') now has a pending deprecation warning and is going to be deprecated, probably before the end of 2023. If you only use it to dump, please use the new YAML(typ='full'), the result of that can be safely loaded with a default instance YAML(), as that will get you inspectable, tagged, scalars, instead of executed Python functions/classes. (You should probably add constructors for what you actually need, but I do consider adding a ruamel.yaml.unsafe package that will re-add the typ='unsafe' option. Please adjust/pin your dependencies accordingly if necessary.