pleiades.nuclear.isotopes.manager module
Manages access to isotope data files packaged with PLEIADES.
- class pleiades.nuclear.isotopes.manager.IsotopeManager[source]
Bases:
objectManages 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.
- 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:
FileNotFoundError – If the file doesn’t exist
ValueError – If the category is invalid or file extension is not allowed
- 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:
- 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