bobleesj.utils.sources package

Submodules

bobleesj.utils.sources.oliynyk module

class bobleesj.utils.sources.oliynyk.Oliynyk[source]

Bases: object

Oliynyk elemental property database interface.

get_oliynyk_CAF_data() dict[str, dict[str, float]][source]

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
get_property_data(property: Property) dict[str, float][source]

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, ...}
get_property_data_for_formula(formula: str, property: Property) dict[str, float][source]

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_supported_formulas(formulas: list[str]) tuple[list[str], list[str]][source]

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"]
is_formula_supported(formula: str) bool[source]

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
list_supported_elements() list[str][source]

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", ...]
class bobleesj.utils.sources.oliynyk.Property(*values)[source]

Bases: str, Enum

ATOMIC_NUMBER = 'atomic_number'
AW = 'atomic_weight'
BULK_MODULUS = 'bulk_modulus'
CIF_RADIUS = 'CIF_radius'
COHESIVE_ENERGY = 'cohesive_energy'
COORD_NUM = 'coordination_number'
DENSITY = 'density'
GILMAN = 'Gilman'
GROUP = 'group'
ION_ENERGY = 'ionization_energy'
MARTYNOV_BATSANOV_EN = 'Martynov_Batsanov_EN'
MELTING_POINT_K = 'melting_point_K'
MEND_NUM = 'Mendeleev_number'
PAULING_EN = 'Pauling_EN'
PAULING_RADIUS_CN12 = 'Pauling_radius_CN12'
PERIOD = 'period'
POLYHEDRON_DISTORT = 'polyhedron_distortion'
RATIO_CLOSEST = 'ratio_closest'
SPECIFIC_HEAT = 'specific_heat'
UNPARIED_E = 'unpaired_electrons'
VAL_TOTAL = 'valencee_total'
Z_EFF = 'Z_eff'
classmethod display()[source]

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()[source]

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

bobleesj.utils.sources.mendeleev module

bobleesj.utils.sources.radius module

bobleesj.utils.sources.radius.are_available(elements: list[str]) bool[source]

Check if all elements in the list are supported.

Parameters:

elements (list[str]) – A list of chemical symbols of elements.

Returns:

True if all elements are supported, False otherwise.

Return type:

bool

Examples

>>> are_all_available(["Fe", "O", "N"])
True
>>> are_all_available(["Fe", "UnknownElement"])
False
bobleesj.utils.sources.radius.data() dict[source]

Return a dictionary of element radius data.

bobleesj.utils.sources.radius.is_available(element: str) bool[source]

Check if an element is supported.

Parameters:

element (str) – The chemical symbol of the element.

Returns:

True if the element is supported, False otherwise.

Return type:

bool

Examples

>>> is_supported("Fe")
True
>>> is_supported("UnknownElement")
False
bobleesj.utils.sources.radius.supported_elements() list[str][source]

Get a list of supported elements.

Returns:

A list of chemical symbols for the elements that have radius data.

Return type:

list[str]

Examples

>>> get_supported_elements()
['Si', 'Sc', 'Fe', ...]
bobleesj.utils.sources.radius.value(element: str) dict[str, float][source]

Get the radius data for a given element.

Parameters:

element (str) – The chemical symbol of the element.

Returns:

A dictionary containing the CIF radius and Pauling radius.

Return type:

dict[str, float]

Raises:

KeyError – If the element is not found in the radius data.

Examples

>>> get_radius("Fe")
{'CIF': 1.242, 'Pauling_CN12': 1.26}

bobleesj.utils.sources.ptable module

bobleesj.utils.sources.ptable.get_data()[source]

Get the periodic table data.

Sourced from https://pubchem.ncbi.nlm.nih.gov/ptable/atomic-mass/

bobleesj.utils.sources.ptable.values_from_atomic_number(atomic_number)[source]

Get the element data by atomic number.

bobleesj.utils.sources.ptable.values_from_name(name)[source]

Get the element data by name.

bobleesj.utils.sources.ptable.values_from_symbol(symbol)[source]

Get the element data by chemical symbol.