mckit_nuclides package¶
Subpackages¶
Submodules¶
mckit_nuclides.abundance module¶
Methods to change nuclide abundance in compositions.
- mckit_nuclides.abundance.MOLAR_MASS_TABLE = shape: (3_539, 3) ┌───────────────┬─────────────┬────────────┐ │ atomic_number ┆ mass_number ┆ molar_mass │ │ --- ┆ --- ┆ --- │ │ u8 ┆ u16 ┆ f32 │ ╞═══════════════╪═════════════╪════════════╡ │ 1 ┆ 0 ┆ 1.008 │ │ 1 ┆ 1 ┆ 1.007825 │ │ 1 ┆ 2 ┆ 2.014102 │ │ 1 ┆ 3 ┆ 3.016049 │ │ 1 ┆ 4 ┆ 4.02643 │ │ … ┆ … ┆ … │ │ 117 ┆ 294 ┆ 294.210449 │ │ 118 ┆ 0 ┆ 295.216003 │ │ 118 ┆ 293 ┆ 293.213562 │ │ 118 ┆ 294 ┆ 294.213928 │ │ 118 ┆ 295 ┆ 295.216248 │ └───────────────┴─────────────┴────────────┘¶
The table contains molar masses for nuclides with specified and not specified mass numbers.
- mckit_nuclides.abundance.convert_to_atomic_fraction(composition, fraction_column='fraction')[source]¶
Change fractions by mass to fractions by atoms.
- Parameters:
composition (
DataFrame) – DataFrame with columns atomic_number, mass_numberfraction_column (
str) – name of column presenting fraction
- Returns:
df with modified column “fraction”
- Return type:
DataFrame
- mckit_nuclides.abundance.expand_df_natural_presence(composition, fraction_column='fraction')[source]¶
Expand ‘natural’ presence in composition presented as a DataFrame.
- Parameters:
composition (
DataFrame) – table with columns atomic_number, mass_number (may be 0), fractionfraction_column (
str) – exact ‘fraction’ column name
- Return type:
DataFrame- Returns:
Expanded composition as a DataFrame.
mckit_nuclides.elements module¶
Module elements provides access to information on chemical element level.
- mckit_nuclides.elements.atomic_mass(z_or_symbol)[source]¶
Get standard atomic mass for and Element by atomic number.
- mckit_nuclides.elements.from_molecular_formula(formula, *, mass_fraction=False)[source]¶
Create dataframe for material from chemical formula.
Minimalistic parser for chemical formula to define compositions on the fly.
Symbols of elements are to be in capitalized form: Ge, Si…
- Parameters:
- Return type:
DataFrame
Examples
>>> print(from_molecular_formula("H2O")) shape: (2, 2) ┌───────────────┬──────────┐ │ atomic_number ┆ fraction │ │ --- ┆ --- │ │ u8 ┆ f64 │ ╞═══════════════╪══════════╡ │ 1 ┆ 0.666667 │ │ 8 ┆ 0.333333 │ └───────────────┴──────────┘ >>> print(from_molecular_formula("C2H5OH")) shape: (3, 2) ┌───────────────┬──────────┐ │ atomic_number ┆ fraction │ │ --- ┆ --- │ │ u8 ┆ f64 │ ╞═══════════════╪══════════╡ │ 1 ┆ 0.666667 │ │ 6 ┆ 0.222222 │ │ 8 ┆ 0.111111 │ └───────────────┴──────────┘ >>> print(from_molecular_formula("H2O", mass_fraction=True)) shape: (2, 2) ┌───────────────┬──────────┐ │ atomic_number ┆ fraction │ │ --- ┆ --- │ │ u8 ┆ f64 │ ╞═══════════════╪══════════╡ │ 1 ┆ 0.111907 │ │ 8 ┆ 0.888093 │ └───────────────┴──────────┘
- mckit_nuclides.elements.get_property(z_or_symbol, column)[source]¶
Get column value for an element specified with atomic number or symbol.
mckit_nuclides.nuclides module¶
Information on nuclides: masses, natural presence and more.
- mckit_nuclides.nuclides.get_nuclide_mass(z_or_symbol, mass_number)[source]¶
Retrieve mass of a nuclide by atomic and mass numbers, a.u.
Module contents¶
The mckit_nuclides package.
Provides information on chemical elements and nuclides as Polars tables.
- mckit_nuclides.atomic_mass(z_or_symbol)[source]¶
Get standard atomic mass for and Element by atomic number.
- mckit_nuclides.convert_to_atomic_fraction(composition, fraction_column='fraction')[source]¶
Change fractions by mass to fractions by atoms.
- Parameters:
composition (
DataFrame) – DataFrame with columns atomic_number, mass_numberfraction_column (
str) – name of column presenting fraction
- Returns:
df with modified column “fraction”
- Return type:
DataFrame
- mckit_nuclides.expand_df_natural_presence(composition, fraction_column='fraction')[source]¶
Expand ‘natural’ presence in composition presented as a DataFrame.
- Parameters:
composition (
DataFrame) – table with columns atomic_number, mass_number (may be 0), fractionfraction_column (
str) – exact ‘fraction’ column name
- Return type:
DataFrame- Returns:
Expanded composition as a DataFrame.
- mckit_nuclides.expand_natural_presence(zaf)[source]¶
Convert sequence of nuclide-fraction specification with natural presence.
Substitute a sequence of nuclides when mass number is specified as 0. This means natural presence.
- mckit_nuclides.from_molecular_formula(formula, *, mass_fraction=False)[source]¶
Create dataframe for material from chemical formula.
Minimalistic parser for chemical formula to define compositions on the fly.
Symbols of elements are to be in capitalized form: Ge, Si…
- Parameters:
- Return type:
DataFrame
Examples
>>> print(from_molecular_formula("H2O")) shape: (2, 2) ┌───────────────┬──────────┐ │ atomic_number ┆ fraction │ │ --- ┆ --- │ │ u8 ┆ f64 │ ╞═══════════════╪══════════╡ │ 1 ┆ 0.666667 │ │ 8 ┆ 0.333333 │ └───────────────┴──────────┘ >>> print(from_molecular_formula("C2H5OH")) shape: (3, 2) ┌───────────────┬──────────┐ │ atomic_number ┆ fraction │ │ --- ┆ --- │ │ u8 ┆ f64 │ ╞═══════════════╪══════════╡ │ 1 ┆ 0.666667 │ │ 6 ┆ 0.222222 │ │ 8 ┆ 0.111111 │ └───────────────┴──────────┘ >>> print(from_molecular_formula("H2O", mass_fraction=True)) shape: (2, 2) ┌───────────────┬──────────┐ │ atomic_number ┆ fraction │ │ --- ┆ --- │ │ u8 ┆ f64 │ ╞═══════════════╪══════════╡ │ 1 ┆ 0.111907 │ │ 8 ┆ 0.888093 │ └───────────────┴──────────┘
- mckit_nuclides.get_element_property(z_or_symbol, column)¶
Get column value for an element specified with atomic number or symbol.
- mckit_nuclides.get_nuclide_mass(z_or_symbol, mass_number)[source]¶
Retrieve mass of a nuclide by atomic and mass numbers, a.u.
- mckit_nuclides.get_nuclide_property(z_or_symbol, mass_number, column)¶
Retrieve mass of a nuclide by atomic and mass numbers, a.u.
- mckit_nuclides.normalize_column(table, column='fraction')[source]¶
Normalize the values in a column to have sum() == 1.0 over the column.
- Parameters:
table (
DataFrame) – … to normalizecolumn (
str) – … over this column
- Return type:
DataFrame- Returns:
Result of normalization