Skip to content

Database

Parquet-backed data store and protocol for nuclear data.

db

Parquet/Polars data access layer for nuclear data.

DatabaseProtocol

Bases: Protocol

Protocol for nuclear data access.

All physics modules depend on this protocol rather than a concrete database implementation. This enables dependency injection and testing with mock databases.

get_cross_sections

get_cross_sections(projectile: str, target_Z: int, target_A: int) -> list[CrossSectionData]

Get all residual production cross-sections for a given reaction.

Returns list of CrossSectionData, one per residual nuclide (Z, A, state).

get_stopping_power

get_stopping_power(source: str, target_Z: int) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]

Get stopping power table for an element.

Parameters:

Name Type Description Default
source str

'PSTAR' or 'ASTAR'

required
target_Z int

target element charge number

required

Returns:

Type Description
tuple[NDArray[float64], NDArray[float64]]

(energies_MeV, dedx_MeV_cm2_g) arrays sorted by energy

get_natural_abundances

get_natural_abundances(Z: int) -> dict[int, tuple[float, float]]

Get natural isotopic abundances for an element.

Returns:

Type Description
dict[int, tuple[float, float]]

dict mapping A -> (fractional_abundance, atomic_mass_u)

get_decay_data

get_decay_data(Z: int, A: int, state: str = '') -> DecayData | None

Get decay data for a nuclide.

Returns None if nuclide not found in database.

get_element_symbol

get_element_symbol(Z: int) -> str

Get element symbol from atomic number.

get_element_Z

get_element_Z(symbol: str) -> int

Get atomic number from element symbol.

DataStore

Parquet/Polars-backed nuclear data store implementing :class:DatabaseProtocol.

Parameters

data_dir: Path to the nucl-parquet root directory containing meta/, stopping/, and per-library {library}/xs/ subdirectories. library: Nuclear data library to use for cross-sections (e.g. "tendl-2025"). Must correspond to a subdirectory with an xs/ folder.

data_dir property

data_dir: Path

Path to the nucl-parquet data directory.

library property

library: str

The active cross-section library name.

available_libraries

available_libraries() -> list[str]

List cross-section libraries available in the data directory.

get_cross_sections

get_cross_sections(projectile: str, target_Z: int, target_A: int) -> list[CrossSectionData]

Get all residual production cross-sections for a given reaction.

get_stopping_power

get_stopping_power(source: str, target_Z: int) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]

Get stopping power table for an element (cached).

get_natural_abundances

get_natural_abundances(Z: int) -> dict[int, tuple[float, float]]

Get natural isotopic abundances for an element.

get_decay_data

get_decay_data(Z: int, A: int, state: str = '') -> DecayData | None

Get decay data for a nuclide. Returns None if not found.

get_element_symbol

get_element_symbol(Z: int) -> str

Get element symbol from atomic number.

get_element_Z

get_element_Z(symbol: str) -> int

Get atomic number from element symbol.

has_cross_sections

has_cross_sections(projectile: str, target_Z: int) -> bool

Check if cross-section data exists for a projectile+element combination.

CrossSectionData dataclass

Cross-section data for one residual nuclide from a specific reaction.

DecayData dataclass

Decay properties of a nuclide.

DecayMode dataclass

Single decay mode with daughter and branching ratio.