We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e892b82 commit d2bd97fCopy full SHA for d2bd97f
1 file changed
validphys2/src/validphys/lhaindex.py
@@ -136,9 +136,12 @@ def get_lha_datapath():
136
The check for existence intends to solve problems where a previously filled `LHAPATH`
137
or `LHAPDF_DATA_PATH` environment variable is pointing to a non-existent path or shared
138
systems where LHAPDF might be compiled with hard-coded paths not available to all users.
139
+
140
+ We check whether the user is able to write to the path to skip situations in which the user
141
+ cannot save grids to the LHAPDF folder but has its own data path (e.g., nix or a cluster).
142
"""
143
for lhapath in lhapdf.paths()[::-1]:
- if Path(lhapath).exists():
144
+ if Path(lhapath).exists() and os.access(lhapath, os.W_OK):
145
return lhapath
146
return lhapdf.paths()[-1]
147
0 commit comments