user [email protected]
usertags 1145147 python3.15
tags 1145147 patch
thanks
Hi!
While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS [1].
To solve this issue, I created a patch to normalize the file path to an
absolute path when caching VASP outputs. This patch should likely be
sent upstream as well.
I've applied this fix in the sandbox [2] to verify that it builds
successfully, these should be applied in Debian to get the package back
to a healthy state.
Happy hacking,
[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4651640/
[2]: https://debusine.debian.net/debian/r-python-python3.15/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Normalize file path to absolute path when caching VASP outputs
Avoids cache collisions with relative paths when changing directories.
Index: custodian/src/custodian/vasp/io.py
===================================================================
--- custodian.orig/src/custodian/vasp/io.py
+++ custodian/src/custodian/vasp/io.py
@@ -1,11 +1,16 @@
"""Helper functions for dealing with vasp files."""
+import os
from pymatgen.io.vasp.outputs import Outcar, Vasprun
from custodian.utils import tracked_lru_cache
@tracked_lru_cache
+def _load_vasprun(filepath, **vasprun_kwargs):
+ return Vasprun(filepath, **vasprun_kwargs)
+
+
def load_vasprun(filepath, **vasprun_kwargs):
"""
Load Vasprun object from file path.
@@ -18,10 +23,14 @@ def load_vasprun(filepath, **vasprun_kwa
Returns:
The Vasprun object
"""
- return Vasprun(filepath, **vasprun_kwargs)
+ return _load_vasprun(os.path.abspath(filepath), **vasprun_kwargs)
@tracked_lru_cache
+def _load_outcar(filepath):
+ return Outcar(filepath)
+
+
def load_outcar(filepath):
"""
Load Outcar object from file path.
@@ -33,4 +42,4 @@ def load_outcar(filepath):
Returns:
The Vasprun object
"""
- return Outcar(filepath)
+ return _load_outcar(os.path.abspath(filepath))