OLED / Oliynyk#
OLED = Oliynyk Elemental Data: 22 physics/chemistry properties for 76 elements, for composition featurization (ML).
from cifkit.sources.oliynyk import Oliynyk, Property
oled = Oliynyk() # not a separate package
oled.db["Si"][Property.AW] # Property is a str Enum (column key)
oled.to_csv("oled.csv")
df = oled.to_dataframe() # shape (76, 23)
Method |
Returns |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Exact Property members#
AW, ATOMIC_NUMBER, PERIOD, GROUP, MEND_NUM, VAL_TOTAL,
UNPARIED_E, GILMAN, Z_EFF, ION_ENERGY, COORD_NUM,
RATIO_CLOSEST, POLYHEDRON_DISTORT, CIF_RADIUS,
PAULING_RADIUS_CN12, PAULING_EN, MARTYNOV_BATSANOV_EN,
MELTING_POINT_K, DENSITY, SPECIFIC_HEAT, COHESIVE_ENERGY,
BULK_MODULUS.
Use UNPARIED_E (as shipped). Column for VAL_TOTAL is
valencee_total.
What each property means (definitions + ML context from the dataset paper’s Table 1): see the full table on the OLED tutorial and the short list in the API quick reference. Parent 98-feature Excel: Mendeley Data bt6gv5z6yv.
Formula → ML feature vector#
from cifkit.parsers.formula import Formula
from cifkit.sources.oliynyk import Oliynyk, Property
oled = Oliynyk()
parsed = Formula("NdSi2").parsed_formula
total = sum(c for _, c in parsed)
features = {
prop.value: sum(oled.db[el][prop] * c for el, c in parsed) / total
for prop in Property
}
Tutorial (full table + CSV): OLED
Calibrated tables: API quick reference
LLM recipes: llms.txt
Dataset paper: https://doi.org/10.1016/j.dib.2024.110178
Oliynyk#
- class cifkit.sources.oliynyk.Oliynyk#
Bases:
objectOLED (Oliynyk elemental data) — 22 properties × 76 elements.
OLED is the short name for this table. Load it only via this class:
from cifkit.sources.oliynyk import Oliynyk, Property oled = Oliynyk() oled.db["Si"][Property.AW] oled.to_csv("oled.csv")
- db#
Nested map
symbol -> {property_column: value}. Property columns matchPropertyenum.valuestrings (e.g."atomic_weight").- Type:
dict[str, dict[str, float]]
- elements#
Supported element symbols (length 76), same order as loaded from Excel.
- Type:
list[str]
Notes
Dataset paper (Data in Brief): https://doi.org/10.1016/j.dib.2024.110178 Docs: https://bobleesj.github.io/cifkit/tutorials/oled.html
- get_oliynyk_CAF_data() dict[str, dict[str, float]]#
Load the Oliynyk elemental property data from an Excel file. The data is stored in a dictionary format with element symbols as keys.
Examples
>>> oliynyk = Oliynyk() >>> data = oliynyk.get_oliynyk_CAF_data() { "Li": {"atomic_weight": 6.941, ...}, "Be": {"atomic_weight": 9.0122, ...}, ... } >>> data["Li"]["atomic_weight"] 6.941
- is_formula_supported(formula: str) bool#
Check if a formula is supported by the Oliynyk database.
Examples
>>> oliynyk = Oliynyk() >>> oliynyk.is_formula_supported("LiFePO4") True >>> oliynyk.is_formula_supported("FeH") False
- get_supported_formulas(formulas: list[str]) tuple[list[str], list[str]]#
Filter formulas to only include those with supported elements.
Examples
>>> oliynyk = Oliynyk() >>> formulas = ["FeH", "NdSi2"] >>> supported, unsupported = oliynyk.get_supported_formulas(formulas) >>> supported ["NdSi2"] >>> unsupported ["FeH"]
- list_supported_elements() list[str]#
List all elements in the Oliynyk database.
Examples
>>> oliynyk = Oliynyk() >>> elements = oliynyk.list_supported_elements() >>> elements ["Li", "Be", "B", "C", "Na", "Mg", "Al", "Si", "P", "S", ...]
- get_property_data_for_formula(formula: str, property: Property) dict[str, float]#
Get property data for individual elements in a given formula.
Examples
>>> oliynyk = Oliynyk() >>> oliynyk.get_property_data_for_formula("LiFeP", Property.AW) {"Li": 6.941, "Fe": 55.845, "O": 15.999}
- get_property_data(property: Property) dict[str, float]#
Get the given property data for all elements in the database.
Examples
>>> oliynyk = Oliynyk() >>> property_data = oliynyk.get_property_data(Property.AW) >>> property_data {"Li": 6.941, "Be": 9.0122, "B": 10.81, ...}
- to_dataframe() DataFrame#
Return the full OLED (Oliynyk elemental data) table as a
pandas.DataFrame.Rows are elements (one per supported symbol); columns are
symbolplus the 22 property keys. Sorted by atomic number.Examples
>>> oliynyk = Oliynyk() >>> df = oliynyk.to_dataframe() >>> df.shape (76, 23) >>> df.loc[df["symbol"] == "Si", "atomic_weight"].iloc[0] 28.0855
- to_csv(path: str) str#
Write the OLED table to a CSV file and return the path.
- Parameters:
path (str) – Destination file path (created or overwritten).
- Returns:
The same
path, for convenient chaining.- Return type:
str
Examples
>>> oliynyk = Oliynyk() >>> oliynyk.to_csv("oled.csv") 'oled.csv'
Property#
- class cifkit.sources.oliynyk.Property(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#
Bases:
str,EnumOLED property keys. Members are
strenums: use as dict keys.Exact member names (do not rename when generating code):
AW, ATOMIC_NUMBER, PERIOD, GROUP, MEND_NUM, VAL_TOTAL, UNPARIED_E, GILMAN, Z_EFF, ION_ENERGY, COORD_NUM, RATIO_CLOSEST, POLYHEDRON_DISTORT, CIF_RADIUS, PAULING_RADIUS_CN12, PAULING_EN, MARTYNOV_BATSANOV_EN, MELTING_POINT_K, DENSITY, SPECIFIC_HEAT, COHESIVE_ENERGY, BULK_MODULUS
Note the shipped spelling
UNPARIED_Eand columnvalencee_total.- AW = 'atomic_weight'#
- ATOMIC_NUMBER = 'atomic_number'#
- PERIOD = 'period'#
- GROUP = 'group'#
- MEND_NUM = 'Mendeleev_number'#
- VAL_TOTAL = 'valencee_total'#
- UNPARIED_E = 'unpaired_electrons'#
- GILMAN = 'Gilman'#
- Z_EFF = 'Z_eff'#
- ION_ENERGY = 'ionization_energy'#
- COORD_NUM = 'coordination_number'#
- RATIO_CLOSEST = 'ratio_closest'#
- POLYHEDRON_DISTORT = 'polyhedron_distortion'#
- CIF_RADIUS = 'CIF_radius'#
- PAULING_RADIUS_CN12 = 'Pauling_radius_CN12'#
- PAULING_EN = 'Pauling_EN'#
- MARTYNOV_BATSANOV_EN = 'Martynov_Batsanov_EN'#
- MELTING_POINT_K = 'melting_point_K'#
- DENSITY = 'density'#
- SPECIFIC_HEAT = 'specific_heat'#
- COHESIVE_ENERGY = 'cohesive_energy'#
- BULK_MODULUS = 'bulk_modulus'#
- classmethod display()#
Display the available elemental properties in a user-friendly format.
Examples
>>> Property.display() Available elemental properties: 1. AW - atomic_weight 2. ATOMIC_NUMBER - atomic_number ...
- classmethod select()#
Prompt the user to select an elemental property from the available options. Returns the selected property.
Examples
>>> selected_property = Property.select() Available elemental properties: 1. AW - atomic_weight 2. ATOMIC_NUMBER - atomic_number ...
Enter the number of the property to use: 1