forked from pcdshub/tc3-table-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (31 loc) · 852 Bytes
/
main.py
File metadata and controls
38 lines (31 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import periodictable
import tc3tg
constants = []
for element in periodictable.elements:
tc3_name = f"fDensity_{element}"
constants.append(
tc3tg.Constant(
description=f"Elemental density of {element}",
name=tc3_name,
key=element,
units=element.density_units,
value=element.density,
caveat=element.density_caveat,
)
)
fn = "GVL_ElementDensity.TcGVL"
with open(fn, "wt") as fp:
print(
tc3tg.generate_constant_table(
fn.split(".")[0], constants, lookup_by_key=False
),
file=fp,
)
fn = "FB_ElementDensity.TcPOU"
with open(fn, "wt") as fp:
print(
tc3tg.generate_constant_table(
fn.split(".")[0], constants, lookup_by_key=True, lookup_input="sName"
),
file=fp,
)