Skip to content

Commit 762f2b5

Browse files
committed
handle wildcard case while loading the element
1 parent fa3441c commit 762f2b5

File tree

5 files changed

+139
-111
lines changed

5 files changed

+139
-111
lines changed

atomdb/datasets/slater/run.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@
2626
# from importlib_resources import files
2727
from atomdb.utils import DEFAULT_DATAPATH
2828
from scipy.special import factorial
29-
import tables as pt
3029
from dataclasses import dataclass, field
3130
from typing import Optional, Dict
3231

33-
34-
3532
__all__ = ["AtomicDensity", "load_slater_wfn", "run"]
3633

3734

@@ -1198,6 +1195,8 @@ def run(elem, charge, mult, nexc, dataset, datapath):
11981195

11991196

12001197

1198+
1199+
12011200
# Conceptual-DFT properties (WIP)
12021201
ip = -mo_e_up[np.sum(occs_up) - 1] # - energy of HOMO
12031202
# ea = -mo_e_dn[np.sum(occs_dn)] if np.sum(occs_dn) < np.sum(occs_up) else None # - LUMO energy

atomdb/migration/datasets/datasets_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"""
2+
running this file will recreate datasets_data.h5, that will lead to create an empty datasets folder once again
3+
"""
4+
15
from importlib_resources import files
26
import tables as pt
37

atomdb/migration/periodic/elements_data.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@
1414
hdf5_file = files("atomdb.data").joinpath("elements_data.h5")
1515

1616

17+
PROPERTY_NAME_MAP = {
18+
"atmass": "atmass",
19+
"cov_radius": "cov_radius",
20+
"vdw_radius": "vdw_radius",
21+
"at_radius": "at_radius",
22+
"polarizability": "polarizability",
23+
"dispersion_c6": "dispersion_c6",
24+
"dispersion": "dispersion_c6",
25+
"elem": "symbol",
26+
"atnum": "atnum",
27+
"name": "name",
28+
}
29+
30+
1731
# Properties of each element in the HDF5 file.
1832
PROPERTY_CONFIGS = [
1933
{
@@ -347,6 +361,21 @@ def write_data_info_to_hdf5(data_info_list):
347361
property_info_table.flush()
348362

349363

364+
365+
def map_element_symbol(ELEMENTS_H5FILE):
366+
element_symbol_map = {}
367+
for element_group in ELEMENTS_H5FILE.root.Elements:
368+
symbol = element_group.symbol[0]['value'].decode('utf-8').strip()
369+
atnum = element_group.atnum[0]['value']
370+
name = element_group.name[0]['value'].decode('utf-8').strip()
371+
element_symbol_map[symbol] = (atnum, name)
372+
373+
return element_symbol_map
374+
375+
376+
377+
378+
350379
if __name__ == "__main__":
351380
# Read the elements data from the CSV file
352381
data, unique_headers, sources_data, units_data = read_elements_data_csv(elements_data_csv)

0 commit comments

Comments
 (0)