pleiades.nuclear.isotopes.manager module

Manages access to isotope data files packaged with PLEIADES.

class pleiades.nuclear.isotopes.manager.IsotopeManager[source]

Bases: object

Manages access to isotope data files packaged with PLEIADES.

This class provides a centralized interface for accessing isotope data files that are distributed with the PLEIADES package. It handles path resolution, validates file existence, and caches results for improved performance.

__init__()[source]

Initialize the IsotopeManager.

get_file_path(category: FileCategory, filename: str) Path[source]

Get the path to a specific data file.

Parameters:
  • category – The category of the data file

  • filename – The name of the file to retrieve

Returns:

Path to the requested file

Raises:
list_files(category: FileCategory | None = None) Dict[FileCategory, List[str]][source]

List available data files.

Parameters:

category – Optional specific category to list files for

Returns:

Dictionary mapping categories to lists of available filenames

Raises:

ValueError – If specified category is invalid

validate_file(category: FileCategory, filename: str) bool[source]

Validate that a file exists and has the correct extension.

Parameters:
  • category – The category of the file

  • filename – The name of the file to validate

Returns:

True if the file is valid, False otherwise

get_istotpe_info_from_mass(mass: float) IsotopeInfo | None[source]

Extract isotope information from the mass.mas20 file based on the given mass and return the corresponding IsotopeInfo object.

NOTE: This function is not used in the current implementation but is provided for future use or testing purposes. We will need to figure out how to use masses provided by SAMMY to look up the exact isotope in the mass.mas20 file.

Parameters:

mass – The mass of the isotope

Returns:

IsotopeInfo object containing isotope details if found, None otherwise

get_isotope_info(isotope_str: str) IsotopeInfo | None[source]

Extract isotope information from the isotopes.info file.

Parameters:

isotope_str – String representation of the isotope (e.g., “U-238”)

Returns:

IsotopeInfo containing isotope details if found, None otherwise

check_and_get_mass_data(element: str, mass_number: int) IsotopeMassData | None[source]

Extract mass data for an isotope from the mass.mas20 file.

Parameters:
  • element (str) – Element symbol

  • mass_number (int) – Mass number

Returns:

IsotopeMassData containing atomic mass, mass uncertainty

Raises:

ValueError – If data cannot be parsed

check_and_set_abundance_and_spins(isotope_info: IsotopeInfo) None[source]

Set the abundance and spin of an isotope from the isotopes.info file.

Parameters:

isotope_info – IsotopeInfo object to modify

get_mat_number(isotope: IsotopeInfo) int | None[source]

Get ENDF MAT number for an isotope.

Parameters:

isotope – IsotopeInfo instance

Returns:

ENDF MAT number if found, None otherwise

Raises:

ValueError – If isotope format is invalid

get_isotope_parameters_from_isotope_string(isotope_str: str) IsotopeParameters | None[source]

Get isotope parameters from an isotope string.

Parameters:

isotope_str – String representation of the isotope (e.g., “U-238”)

Returns:

IsotopeParameters containing nuclear data if found, None otherwise

get_isotopes_by_element(element: str) List[str][source]

Get all naturally occurring isotopes for a given element.

Reads isotopes.info to find all isotopes of the specified element that have non-zero natural abundance.

Parameters:

element – Element symbol (e.g., “Hf”, “U”, “Au”). Case-insensitive.

Returns:

List of isotope strings sorted by mass number (e.g., [“Hf-174”, “Hf-176”, …]). Returns empty list if element not found or has no natural isotopes.

get_natural_composition(element: str) Dict[str, float][source]

Get natural isotopic composition for a given element.

Reads isotopes.info to get all naturally occurring isotopes and their abundances, returned as fractions (0-1) rather than percentages.

Note: The isotopes.info file stores abundances as PERCENTAGES (0-100). This method converts them to fractions (0-1) and validates that the sum is approximately 1.0 (within 1% tolerance).

Parameters:

element – Element symbol (e.g., “Hf”, “U”, “Au”). Case-insensitive.

Returns:

Dict mapping isotope strings to abundance fractions. E.g., {“Hf-174”: 0.0016, “Hf-176”: 0.0526, …} Returns empty dict if element not found or has no natural isotopes.