Based on need of Actinides pseudopotential test, now APNS collects
SG15 pseudopotentials from version 1.0 to 1.2
PSlibrary 0.3.1 (ultrasoft and norm-conserving)
PseudoDojo 0.3 to 0.5,
PD03, PD04,
GTH-LnPP1 (transformed from CP2K),
HGH (the one routinely used in BigDFT),
might-be-collected in PseudoDojo 1.0 the Actinides and super heavy elements pseudopotentials (tested with Abinit),
GBRV (widely used in Quantum ESPRESSO community),
several Rappe prefixed pseudopotentials (generated with Opium code, tests may be needed by @pxlxingliang )
We also have DIY pseudopotentials for extreme high pressure condition generated by @Chentao168 . Other users and developers are encouraged to suggest pseudopotential suites to test.
Describe the solution you'd like
Now APNS will let user define regular expression to distinguish pseudopotentials like:
in a file named as rules.json in ./download/pseudopotentials/ folder. Then a simple function can manage all pseudopotential files, like:
def load(pseudo_dir: str):
if not os.path.exists(pseudo_dir):
raise FileNotFoundError(f"Directory {pseudo_dir} does not exist")
if not os.path.exists(os.path.join(pseudo_dir, "rules.json")):
raise FileNotFoundError(f"File rules.json does not exist in {pseudo_dir}")
with open(os.path.join(pseudo_dir, "rules.json")) as f:
rules = json.load(f)
pseudo_db = {}
for root, dirs, files in os.walk(pseudo_dir):
for file in files:
if file.endswith(".upf") or file.endswith(".UPF"):
folder = root.replace("\\", "/").split("/")[-1]
for i in range(len(rules["rules"])):
match_file = re.match(rules["rules"][i]["re.file"], file)
match_folder = re.match(rules["rules"][i]["re.folder"], folder)
if match_file and match_folder:
element = match_file.group(1).capitalize()
id = amwi.pseudopotential(kind=rules["rules"][i]["kind"],
version=rules["rules"][i]["version"],
appendix=rules["rules"][i]["appendix"])
pseudo_db.setdefault(element, {})[id] = os.path.join(root, file)
break
if match_file is None or match_folder is None:
raise ValueError(f"No rule found for file: {file} in folder: {folder}")
with open(os.path.join(pseudo_dir, "pseudo_db.json"), "w") as f:
json.dump(pseudo_db, f, indent=4)
return pseudo_db
Background
Based on need of Actinides pseudopotential test, now APNS collects
We also have DIY pseudopotentials for extreme high pressure condition generated by @Chentao168 . Other users and developers are encouraged to suggest pseudopotential suites to test.
Describe the solution you'd like
Now APNS will let user define regular expression to distinguish pseudopotentials like:
in a file named as
rules.json
in./download/pseudopotentials/
folder. Then a simple function can manage all pseudopotential files, like:The content of
pseudo_db
would be like:Task list only for developers
Notice Possible Changes of Behavior (Reminder only for developers)
No response
Notice any changes of core modules (Reminder only for developers)
No response
Notice Possible Changes of Core Modules (Reminder only for developers)
No response
Additional Context
No response
Task list for Issue attackers (only for developers)