andalus package

Submodules

andalus.application module

Module containing the Application and ApplicationSuite classes, which are used to represent and manage application data.

class andalus.application.Application(title: str, kind: str, c: float, dc: float, s: Sensitivity)[source]

Bases: object

An application is a calculation without an associated measurement.

title

The unique name or identifier for the application.

Type:

str

kind

The kind of the observable (e.g., “keff”, “void”).

Type:

str

c

The calculated value (Nominal).

Type:

float

dc

The uncertainty of the calculation.

Type:

float

s

The energy-dependent sensitivity profiles.

Type:

Sensitivity

c: float
dc: float
classmethod from_hdf5(file_path, title: str, kind: str = 'keff')[source]

Create an Application instance from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file containing the application data.

  • title (str) – Title of the application to load.

  • kind (str, optional) – Type of application (e.g., “keff”). Default is “keff”.

Returns:

A new Application instance with the loaded data.

Return type:

Application

classmethod from_serpent(title: str, sens0_path: str, results_path: str, kind: str = 'keff', materials=None, zailist=None, pertlist=None)[source]

Method to create an Application object from a serpent output.

Parameters:
  • title (str) – title of the application.

  • results_path (str) – path to the Serpent _res.m file.

  • sens0_path (str) – path to the Serpent _sens0.m file.

  • kind (str, optional) – kind of observable, by default “keff”.

  • materials (_type_, optional) – The material in which the sensitivity is calculated, by default None.

  • zailist (_type_, optional) – The ZAIs which have to be extracted from the sensitivity file, by default None.

  • pertlist (_type_, optional) – The perturbations which have to be extracted from the sensitivity file, by default None.

Returns:

Returns a Benchmark object with the calculated value and sensitivity data extracted from the Serpent files.

Return type:

_type_

kind: str
print_summary()[source]

Print a quick summary of an application object.

s: Sensitivity
title: str
to_hdf5(file_path='benchmarks.h5')[source]

Save the application data to an HDF5 file.

Parameters:

file_path (str, optional) –

The path to the HDF5 file where the application data will be saved.

Default is ‘benchmarks.h5’.

class andalus.application.ApplicationSuite(applications: dict[str, ~andalus.application.Application]=<factory>)[source]

Bases: object

A applicationsuite is a combined set of application objects.

applications

A dictionary of application objects, indexed by their title.

Type:

dict[str, Application]

applications: dict[str, Application]
property c: Series

Returns a pd.Series of application calculated values in the suite.

Returns:

Series of application calculated values in the suite.

Return type:

pd.Series of float

property dc: Series

Returns a pd.Series of application calculated uncertainties in the suite.

Returns:

Series of application calculated uncertainties in the suite.

Return type:

pd.Series of float

property ds: DataFrame

Returns a pd.DataFrame of sensitivity uncertainties in the suite.

Returns:

DataFrame of sensitivity uncertainties in the suite.

Return type:

pd.DataFrame

classmethod from_hdf5(file_path: str, titles: list, kind: str = 'keff')[source]

Retrieve a set of applications from a database.

Parameters:
  • file_path (str) – file path where the database is located.

  • titles (list, optional) – Titles which have to be extracted from the database, if None return all the applications available in the database, by default None.

Returns:

Returns a BenchmarkSuite object containing the imported Benchmark objects.

Return type:

BenchmarkSuite

classmethod from_yaml(path: str)[source]

Factory method to create an ApplicationSuite instance from a YAML configuration file.

Parameters:

path (str) – The path to the YAML configuration file.

Returns:

An instance of ApplicationSuite populated with data from the YAML file.

Return type:

ApplicationSuite

get(title: str) Application | None[source]

Get an application from the suite.

Parameters:

title (str) – Title of the application to be retrieved.

Returns:

Application object.

Return type:

Application

items()[source]

Return the suite’s applications as (title, Application) pairs.

Returns:

A view of the internal application dictionary items, which are of type Application.

Return type:

dict_items

keys()[source]

Return an iterator over the application titles.

property kinds: Series

Returns a pd.Series of application types in the suite.

Returns:

Series of application types in the suite.

Return type:

pd.Series of str

remove(title: str)[source]

Remove application from the suite.

Parameters:

title (str) – Title of the application to be removed.

property s: DataFrame

Returns a pd.DataFrame of sensitivity objects in the suite.

Returns:

DataFrame of sensitivity objects in the suite.

Return type:

pd.DataFrame

property titles: list

Returns a list of application titles in the suite.

Returns:

List of application titles in the suite.

Return type:

list of str

update_c(new_c: Series) ApplicationSuite[source]

Create a new ApplicationSuite with updated calculated values.

This method is typically used to generate a posterior suite after an assimilation update (e.g., GLLS).

Parameters:

new_c (pd.Series) – A series containing the updated ‘c’ values, indexed by application title.

Returns:

A new instance of the suite containing updated Application objects.

Return type:

ApplicationSuite

Raises:

KeyError – If an applicaiton title in the suite is missing from the index of new_c.

values()[source]

Return an iterator over the application objects.

property zais: list

Returns a list of unique ZAIs in the sensitivity data of the applications in the suite.

Returns:

List of unique ZAIs in the sensitivity data of the applications in the suite.

Return type:

list of int

andalus.assimilation module

Module containing the AssimilationSuite class, which is used to manage a collection of benchmark, application and covariance data for assimilation purposes.

class andalus.assimilation.AssimilationSuite(benchmarks: BenchmarkSuite, applications: ApplicationSuite, covariances: CovarianceSuite)[source]

Bases: object

Class to manage a collection of benchmark, application and covariance data for assimilation purposes. This class can be used to assemble a complete dataset for assimilation, and to perform operations on the entire suite.

applications: ApplicationSuite
benchmarks: BenchmarkSuite
property c

Concatenate calculated values from all benchmarks and applications.

This property gathers calculated values from available benchmark and application suites, aligns them by their titles, and fills missing values with zeros to create a unified calculated value vector.

Returns:

A combined Series containing calculated values, aligned by index.

Return type:

pd.Series

Raises:

ValueError – If both benchmarks and applications are None or empty.

chi_squared(nuclear_data: bool = False) float[source]

Calculate the total chi-squared for the suite.

\[\]

chi^2 = (m - c)^T C^{-1} (m - c)

Parameters:

nuclear_data (bool, optional) – Whether to include the contribution of the nuclear data uncertainty in the chi² calculation, by default False.

ck_matrix() DataFrame[source]

Generate a ck-similarity matrix for the current assimilation suite.

Returns:

A dataframe containing the similarity coefficients between all benchmarks and applications in the AssimilationSuite.

Return type:

pd.DataFrame

ck_target(target: str) Series[source]

Calculate the ck-similarity of all sensitivities in the suite with a specified target sensitivity profile.

Parameters:

target (str) – The name of the target sensitivity profile to compare against.

Returns:

A Series containing the ck-similarity values for each sensitivity profile in the suite compared to the target.

Return type:

pd.Series

covariances: CovarianceSuite
property dc

Concatenate calculated value uncertainties from all benchmarks and applications.

This property gathers calculated value uncertainties from available benchmark and application suites, aligns them by their titles, and fills missing values with zeros to create a unified calculated value uncertainty vector.

Returns:

A combined Series containing calculated value uncertainties, aligned by index.

Return type:

pd.Series

Raises:

ValueError – If both benchmarks and applications are None or empty.

property dm

Return experimental uncertainty values from the benchmark suite.

Returns:

A Series containing the experimental uncertainty values from the benchmark suite.

Return type:

pd.Series

property ds

Concatenate sensitivity uncertainties data from all benchmarks and applications.

This property gathers sensitivity uncertainty vectors from available benchmark and application suites, aligns them by their MultiIndex, and fills missing values with zeros to create a unified sensitivity uncertainty matrix.

Returns:

A combined DataFrame containing sensitivity uncertainties, aligned along the columns (axis=1).

Return type:

pd.DataFrame

Raises:

ValueError – If both benchmarks and applications are None or empty.

classmethod from_yaml(path: str = 'assimilation_suite.yaml')[source]

Factory method to create an AssimilationSuite instance from a YAML configuration file.

Parameters:

path (str, optional) – The path to the YAML configuration file, by default “assimilation_suite.yaml”.

Returns:

An instance of AssimilationSuite populated with data from the YAML file.

Return type:

AssimilationSuite

glls(include_sensitivity_uncertainty: bool = False) AssimilationSuite[source]

Perform a GLLS update [1] on the assimilation suite using the sensitivity profiles and covariance data loaded in the AssimilationSuite. This method updates the calculated response and the covariance matrices.

Returns:

A new AssimilationSuite instance with updated sensitivity profiles.

Return type:

AssimilationSuite

References

individual_chi_squared(nuclear_data: bool = False) Series[source]

Calculate individual chi-squared for each benchmark in the suite.

\[\]

chi^2 = frac{(m - c)^2}{sigma_m^2 + sigma_c^2 + s^T C s}

Parameters:

nuclear_data (bool, optional) – Whether to include the contribution of the nuclear data uncertainty in the chi² calculation, by default False.

property m

Return experimental values from the benchmark suite.

Returns:

A Series containing the experimental values from the benchmark suite.

Return type:

pd.Series

propagate_nuclear_data_uncertainty()[source]

Propagate the nuclear data uncertainty through the sensitivity profiles to calculate the contribution of the nuclear data uncertainty to the overall uncertainty in the calculated values.

Returns:

A Series containing the propagated nuclear data uncertainty for each case in the suite.

Return type:

pd.Series

property s

Concatenate sensitivity data from all benchmarks and applications.

This property gathers sensitivity vectors from available benchmark and application suites, aligns them by their MultiIndex, and fills missing values with zeros to create a unified sensitivity matrix.

Returns:

A combined DataFrame containing sensitivities, aligned along the columns (axis=1).

Return type:

pd.DataFrame

Raises:

ValueError – If both benchmarks and applications are None or empty.

property titles

Get a list of all case titles in the assimilation suite, including both benchmarks and applications.

Returns:

A list of strings representing the titles of all cases in the suite.

Return type:

list

andalus.benchmark module

Module containing the Benchmark and BenchmarkSuite classes, which are used to represent and manage benchmark data.

class andalus.benchmark.Benchmark(title: str, kind: str, m: float, dm: float, c: float, dc: float, s: Sensitivity)[source]

Bases: object

A benchmark is an application that has an associated measurement.

title

The unique name or identifier for the application.

Type:

str

kind

The kind of the observable (e.g., “keff”, “void”).

Type:

str

m

The measured value (Nominal).

Type:

float

dm

The uncertainty of the measurement.

Type:

float

c

The calculated value (Nominal).

Type:

float

dc

The uncertainty of the calculation.

Type:

float

s

The energy-dependent sensitivity profiles.

Type:

Sensitivity

c: float
dc: float
dm: float
classmethod from_hdf5(file_path, title: str, kind: str = 'keff')[source]

Create a Benchmark instance from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file containing the benchmark data.

  • title (str) – Title of the benchmark to load.

  • kind (str, optional) – Type of benchmark (e.g., “keff”). Default is “keff”.

Returns:

A new Benchmark instance with the loaded data.

Return type:

Benchmark

classmethod from_serpent(title: str, m: float, dm: float, sens0_path: str, results_path: str, kind: str = 'keff', materials=None, zailist=None, pertlist=None)[source]

Method to create a Benchmark object from a serpent output.

Parameters:
  • title (str) – title of the benchmark.

  • m (float) – measurement value.

  • dm (float) – measurement uncertainty.

  • results_path (str) – path to the Serpent _res.m file.

  • sens0_path (str) – path to the Serpent _sens0.m file.

  • kind (str, optional) – kind of observable, by default “keff”.

  • materials (_type_, optional) – The material in which the sensitivity is calculated, by default None.

  • zailist (_type_, optional) – The ZAIs which have to be extracted from the sensitivity file, by default None.

  • pertlist (_type_, optional) – The perturbations which have to be extracted from the sensitivity file, by default None.

Returns:

Returns a Benchmark object with the calculated value and sensitivity data extracted from the Serpent files.

Return type:

_type_

kind: str
m: float
print_summary()[source]

Print a quick summary of a benchmark object.

s: Sensitivity
title: str
to_hdf5(file_path='benchmarks.h5')[source]

Save the benchmark data to an HDF5 file.

Parameters:

file_path (str, optional) –

The path to the HDF5 file where the benchmark data will be saved.

Default is ‘benchmarks.h5’.

class andalus.benchmark.BenchmarkSuite(benchmarks: dict[str, ~andalus.benchmark.Benchmark]=<factory>)[source]

Bases: object

A benchmarksuite is a combined set of benchmark objects.

benchmarks

A dictionary of benchmark objects, indexed by their title.

Type:

dict[str, Benchmark]

benchmarks: dict[str, Benchmark]
property c: Series

Returns a pd.Series of benchmark calculated values in the suite.

Returns:

Series of benchmark calculated values in the suite.

Return type:

pd.Series of float

property cov_m: DataFrame

Returns a pd.DataFrame of benchmark measurement covariance in the suite.

Returns:

DataFrame of benchmark measurement covariance in the suite.

Return type:

pd.DataFrame

property dc: Series

Returns a pd.Series of benchmark calculated uncertainties in the suite.

Returns:

Series of benchmark calculated uncertainties in the suite.

Return type:

pd.Series of float

property dm: Series

Returns a pd.Series of benchmark measurement uncertainties in the suite.

Returns:

Series of benchmark measurement uncertainties in the suite.

Return type:

pd.Series of float

property ds: DataFrame

Returns a pd.DataFrame of sensitivity uncertainties in the suite.

Returns:

DataFrame of sensitivity uncertainties in the suite.

Return type:

pd.DataFrame

classmethod from_hdf5(file_path: str, titles: list, kind: str = 'keff')[source]

Retrieve a set of benchmarks from a database.

Parameters:
  • file_path (str) – file path where the database is located.

  • titles (list, optional) – Titles which have to be extracted from the database, if None return all the benchmarks available in the database, by default None.

Returns:

Returns a BenchmarkSuite object containing the imported Benchmark objects.

Return type:

BenchmarkSuite

classmethod from_yaml(path: str)[source]

Factory method to create a BenchmarkSuite instance from a YAML configuration file.

Parameters:

path (str) – The path to the YAML configuration file.

Returns:

An instance of BenchmarkSuite populated with data from the YAML file.

Return type:

BenchmarkSuite

get(title: str) Benchmark | None[source]

Get a benchmark from the suite.

Parameters:

title (str) – Title of the benchmark to be retrieved.

Returns:

Benchmark object.

Return type:

Benchmark

items()[source]

Return the suite’s benchmarks as (title, Benchmark) pairs.

Returns:

A view of the internal benchmarks dictionary items.

Return type:

dict_items

keys()[source]

Return an iterator over the benchmark titles.

property kinds: Series

Returns a pd.Series of benchmark types in the suite.

Returns:

Series of benchmark types in the suite.

Return type:

pd.Series of str

property m: Series

Returns a pd.Series of benchmark measurements in the suite.

Returns:

Series of benchmark measurements in the suite.

Return type:

pd.Series of float

remove(title: str)[source]

Remove benchmark from the suite.

Parameters:

title (str) – Title of the benchmark to be removed.

property s: DataFrame

Returns a pd.DataFrame of sensitivity objects in the suite.

Returns:

DataFrame of sensitivity objects in the suite.

Return type:

pd.DataFrame

property titles: list

Returns a list of benchmark titles in the suite.

Returns:

List of benchmark titles in the suite.

Return type:

list of str

update_c(new_c: Series) BenchmarkSuite[source]

Create a new BenchmarkSuite with updated calculated values.

This method is typically used to generate a posterior suite after an assimilation update (e.g., GLLS).

Parameters:

new_c (pd.Series) – A series containing the updated ‘c’ values, indexed by benchmark title.

Returns:

A new instance of the suite containing updated Benchmark objects.

Return type:

BenchmarkSuite

Raises:

KeyError – If a benchmark title in the suite is missing from the index of new_c.

values()[source]

Return an iterator over the benchmark objects.

property zais: list

Returns a list of unique ZAIs in the sensitivity data of the benchmarks in the suite.

Returns:

List of unique ZAIs in the sensitivity data of the benchmarks in the suite.

Return type:

list of int

andalus.cli module

Console script for andalus.

andalus.cli.main() None[source]

Console script for andalus.

andalus.constants module

Global constants and nuclear data translation mappings for the andalus package.

andalus.constants.get_mt_number(label: str) int[source]

Safely convert a Serpent reaction string to an integer MT number.

Parameters:

label (str) – The reaction string from Serpent output.

Returns:

The corresponding MT number. Returns 999 if unknown to preserve integer type for HDF5 serialization.

Return type:

int

andalus.covariance module

Module containing the Covariance class, which is used to represent and manage covariance data. Covariances inherit from pandas DataFrames. Covariance objects can be saved to a sparse HDF5 format and reconstructed from it. A covariance suite can be assembled from multiple Covariance objects, creating a block-diagonal matrix.

class andalus.covariance.Covariance(data=None, index: Axes | None = None, columns: Axes | None = None, dtype: Dtype | None = None, copy: bool | None = None)[source]

Bases: DataFrame

Subclass of pd.DataFrame for handling individual nuclide covariance data.

zai

Nuclide identifier (ZAI).

Type:

int

temperature

Temperature at which the covariance was generated.

Type:

float, optional

err

Associated error or tolerance.

Type:

float, optional

correlation() DataFrame[source]

Calculate the correlation matrix from the covariance matrix.

Returns:

Correlation matrix with values between -1 and 1.

Return type:

pd.DataFrame

classmethod from_errorr(files: dict[str, str], zai: int, mts: list[int] | None = None, temperature: float | None = None, err: float | None = None) Covariance[source]

Construct a Covariance object from NJOY errorr output files.

Parameters:
  • files (dict[str, str]) – Dictionary mapping section names (e.g., ‘errorr33’) to file paths.

  • zai (int) – Nuclide identifier (ZAI).

  • mts (list of int, optional) – Filter for specific MT numbers.

  • temperature (float, optional) – Temperature at which the covariance was generated.

  • err (float, optional) – Associated error or tolerance.

Returns:

Reconstructed covariance matrix from errorr data.

Return type:

Covariance

classmethod from_hdf5(file_path: str, zai: int, mts: list[int] | None = None) Covariance[source]

Load a covariance matrix from HDF5 and reconstruct from sparse storage.

Parameters:
  • file_path (str) – Path to the HDF5 file.

  • zai (int) – Nuclide identifier (ZAI).

  • mts (list of int, optional) – Filter for specific MT numbers.

Returns:

Reconstructed symmetric covariance matrix.

Return type:

Covariance

classmethod from_store(store: HDFStore, zai: int, mts: list[int] | None = None) Covariance[source]

Extract and reconstruct a Covariance object from an open HDFStore.

Parameters:
  • store (pd.HDFStore) – The open HDF5 store object.

  • zai (int) – Nuclide identifier (ZAI).

  • mts (list of int, optional) – Filter for specific MT numbers.

Returns:

Reconstructed symmetric covariance matrix.

Return type:

Covariance

is_unrealistic_uncertainty(threshold=10)[source]

Check if diagonal elements (variances) exceed a threshold.

property nuclide: str | None

Return a string representation of the isotope based on ZAI.

to_hdf5(file_path: str)[source]

Save the matrix to HDF5 using sparse lower-triangular storage.

Parameters:

file_path (str) – Path to save the HDF5 file.

class andalus.covariance.CovarianceSuite(matrix: DataFrame)[source]

Bases: object

Container for global nuclear data covariance systems.

This class manages the transition from independent nuclide matrices to a fully correlated global system, often used in Least Squares adjustments.

Parameters:

matrix (pd.DataFrame) – The unified global covariance matrix with a 5-level MultiIndex: (ZAI, MF, MT, E_min, E_max).

classmethod from_df(df: DataFrame) CovarianceSuite[source]

Construct a suite directly from a DataFrame. Useful for loading adjusted/correlated matrices.

Parameters:

df (pd.DataFrame) – The global covariance matrix.

Returns:

A suite wrapping the provided DataFrame.

Return type:

CovarianceSuite

classmethod from_dict(items: dict[int, Covariance]) CovarianceSuite[source]

Construct a suite from a dictionary of independent Covariance objects.

This creates a block-diagonal matrix where off-diagonal blocks (cross-nuclide correlations) are initialized to zero.

Parameters:

items (Dict[int, Covariance]) – Dictionary mapping ZAI to Covariance objects.

Returns:

A suite containing the assembled block-diagonal matrix.

Return type:

CovarianceSuite

classmethod from_hdf5(file_path: str, zais: list[int] | None = None, mts: list[int] | None = None) CovarianceSuite[source]

Load a suite from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file.

  • zais (Optional[List[int]]) – List of ZAI values to include in the suite.

  • mts (Optional[List[int]]) – List of MT values to include in the suite.

Returns:

The loaded suite.

Return type:

CovarianceSuite

classmethod from_yaml(path: str, zais: list[int], mts: list[int] | None = None) CovarianceSuite[source]

Factory method to create a CovarianceSuite instance from a YAML configuration file.

Parameters:
  • path (str) – The path to the YAML configuration file, by default “assimilation_suite.yaml”.

  • zais (list[int]) – List of ZAI values to include in the suite.

  • mts (list[int]) – List of MT values to include in the suite.

Returns:

An instance of CovarianceSuite populated with data from the YAML file.

Return type:

CovarianceSuite

get_correlation_matrix() DataFrame[source]

Calculate the correlation matrix from the current covariance matrix.

Returns:

Matrix of correlation coefficients (-1 to 1).

Return type:

pd.DataFrame

get_uncertainties() Series[source]

Return the standard deviations (sqrt of diagonal) for all bins.

Returns:

Standard deviation values.

Return type:

pd.Series

matrix: DataFrame
plot_uncertainty(zai: int, mt: int, ax=None, **kwargs)[source]

Plot the uncertainty (standard deviation) for a specific ZAI and MT.

Parameters:
  • zai (int) – The ZAI of the nuclide to plot.

  • mt (int) – The MT number to plot.

  • ax (matplotlib.axes.Axes, optional) – An existing matplotlib Axes to plot on. If None, a new figure will be created.

Returns:

The Axes object containing the plot.

Return type:

matplotlib.axes.Axes

andalus.sensitivity module

Module containing the Sensitivity class, which is used to represent and manage sensitivity data. Sensitivities inherit from pandas DataFrames, and have some additional methods for plotting and loading from Serpent output.

class andalus.sensitivity.Sensitivity(data=None, *args, **kwargs)[source]

Bases: DataFrame

Data structure for nuclear data sensitivity analysis.

Inherits from pandas.DataFrame and maintains metadata across slicing and transformation operations.

Parameters:
  • data (array-like, Iterable, dict, or scalar value) – Contains data to be stored in the DataFrame.

  • title (str, optional) – The name of the benchmark or experiment (e.g., ‘HMF001’).

  • kind (str, optional) – The response type, by default ‘keff’.

  • *args (list) – Additional positional arguments for pd.DataFrame.

  • **kwargs (dict) – Additional keyword arguments for pd.DataFrame.

title

The identifier for the sensitivity data.

Type:

str

kind

The type of observable the sensitivity relates to.

Type:

str

classmethod from_hdf5(file_path, title, kind: str = 'keff')[source]

Create a Sensitivity instance from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file containing the sensitivity data.

  • title (str) – Title of the sensitivity data to load.

  • kind (str, optional) – Type of sensitivity data (e.g., “keff”). Default is “keff”.

Returns:

Sensitivity object containing the loaded sensitivity data.

Return type:

Sensitivity

classmethod from_serpent(sens0_path: str, title: str, kind: str = 'keff', materiallist=None, zailist=None, pertlist=None)[source]

Returns a sensitivity object from a Serpent sensitivity file.

Parameters:
  • sens0_path (str) – Path to the Serpent sensitivity file.

  • title (str) – Title for the sensitivity data.

  • materiallist (list, optional) – List of materials to include. Default is [‘total’].

  • zailist (list, optional) – List of ZAIs to include. Default is None, which includes all ZAIs.

  • pertlist (list, optional) – List of perturbations to include. Default is None, which corresponds to all perturbations in the sensitivity file.

Returns:

Sensitivity object containing the sensitivity data.

Return type:

Sensitivity

Raises:

SensitivityError – If there is an error reading the sensitivity file.

property isotopes

Returns a list of human readable isotopes.

Returns:

List of human readable isotopes.

Return type:

list of str

plot_sensitivity(zais, perts, ax=None, **kwargs)[source]

Return a plot of the sensitivity profile normalized by unit lethargy

Parameters:
  • zais (list) – List of zais to be included in the plot.

  • perts (list) – List of perts to be included in the plot.

  • ax (plt.Axes, optional) – Ax for the plot to be displayed. If None, a new figure and axis will be created.

  • **kwargs – Additional keyword arguments to be passed to the plotting function.

rename_sensitivity(new_title: str) Sensitivity[source]

Rename the benchmark columns and update the title metadata.

Parameters:

new_title (str) – The new identifier for the benchmark columns.

Returns:

A new Sensitivity object with updated columns and title metadata.

Return type:

Sensitivity

to_hdf5(file_path)[source]

Save the Sensitivity instance to an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file where the sensitivity data will be saved.

  • title (str) – Title of the sensitivity data to save.

  • kind (str, optional) – Type of sensitivity data (e.g., “keff”). Default is “keff”.

andalus.utils module

andalus.utils.read_serpent(path)[source]

Read a Serpent file while suppressing a known upstream NumPy deprecation warning.

andalus.utils.safe_sandwich(s1, cov, s2)[source]

Perform the sandwich formula to propagate uncertainties using first-order Taylor expansion while reporting any missing indices.

Parameters:
  • s1 (pd.DataFrame or pd.Series) – First sensitivity matrix or vector.

  • cov (pd.DataFrame) – Covariance matrix.

  • s2 (pd.DataFrame or pd.Series) – Second sensitivity matrix or vector.

Returns:

Result of the sandwich formula.

Return type:

pd.DataFrame, pd.Series, or float

Notes

This function automatically aligns indices by intersection. Any indices present in one input but missing in others are reported to stdout.

andalus.utils.sandwich(s1, cov, s2)[source]

Perform the sandwich formula to propagate uncertainties using first-order Taylor expansion.

Parameters:
  • s1 (pd.DataFrame or pd.Series) – First sensitivity matrix or vector.

  • cov (pd.DataFrame) – Covariance matrix.

  • s2 (pd.DataFrame or pd.Series) – Second sensitivity matrix or vector.

Returns:

Result of the sandwich formula.

Return type:

pd.DataFrame or pd.Series

Module contents

Top-level package for ANDALUS.

class andalus.Application(title: str, kind: str, c: float, dc: float, s: Sensitivity)[source]

Bases: object

An application is a calculation without an associated measurement.

title

The unique name or identifier for the application.

Type:

str

kind

The kind of the observable (e.g., “keff”, “void”).

Type:

str

c

The calculated value (Nominal).

Type:

float

dc

The uncertainty of the calculation.

Type:

float

s

The energy-dependent sensitivity profiles.

Type:

Sensitivity

c: float
dc: float
classmethod from_hdf5(file_path, title: str, kind: str = 'keff')[source]

Create an Application instance from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file containing the application data.

  • title (str) – Title of the application to load.

  • kind (str, optional) – Type of application (e.g., “keff”). Default is “keff”.

Returns:

A new Application instance with the loaded data.

Return type:

Application

classmethod from_serpent(title: str, sens0_path: str, results_path: str, kind: str = 'keff', materials=None, zailist=None, pertlist=None)[source]

Method to create an Application object from a serpent output.

Parameters:
  • title (str) – title of the application.

  • results_path (str) – path to the Serpent _res.m file.

  • sens0_path (str) – path to the Serpent _sens0.m file.

  • kind (str, optional) – kind of observable, by default “keff”.

  • materials (_type_, optional) – The material in which the sensitivity is calculated, by default None.

  • zailist (_type_, optional) – The ZAIs which have to be extracted from the sensitivity file, by default None.

  • pertlist (_type_, optional) – The perturbations which have to be extracted from the sensitivity file, by default None.

Returns:

Returns a Benchmark object with the calculated value and sensitivity data extracted from the Serpent files.

Return type:

_type_

kind: str
print_summary()[source]

Print a quick summary of an application object.

s: Sensitivity
title: str
to_hdf5(file_path='benchmarks.h5')[source]

Save the application data to an HDF5 file.

Parameters:

file_path (str, optional) –

The path to the HDF5 file where the application data will be saved.

Default is ‘benchmarks.h5’.

class andalus.ApplicationSuite(applications: dict[str, ~andalus.application.Application]=<factory>)[source]

Bases: object

A applicationsuite is a combined set of application objects.

applications

A dictionary of application objects, indexed by their title.

Type:

dict[str, Application]

applications: dict[str, Application]
property c: Series

Returns a pd.Series of application calculated values in the suite.

Returns:

Series of application calculated values in the suite.

Return type:

pd.Series of float

property dc: Series

Returns a pd.Series of application calculated uncertainties in the suite.

Returns:

Series of application calculated uncertainties in the suite.

Return type:

pd.Series of float

property ds: DataFrame

Returns a pd.DataFrame of sensitivity uncertainties in the suite.

Returns:

DataFrame of sensitivity uncertainties in the suite.

Return type:

pd.DataFrame

classmethod from_hdf5(file_path: str, titles: list, kind: str = 'keff')[source]

Retrieve a set of applications from a database.

Parameters:
  • file_path (str) – file path where the database is located.

  • titles (list, optional) – Titles which have to be extracted from the database, if None return all the applications available in the database, by default None.

Returns:

Returns a BenchmarkSuite object containing the imported Benchmark objects.

Return type:

BenchmarkSuite

classmethod from_yaml(path: str)[source]

Factory method to create an ApplicationSuite instance from a YAML configuration file.

Parameters:

path (str) – The path to the YAML configuration file.

Returns:

An instance of ApplicationSuite populated with data from the YAML file.

Return type:

ApplicationSuite

get(title: str) Application | None[source]

Get an application from the suite.

Parameters:

title (str) – Title of the application to be retrieved.

Returns:

Application object.

Return type:

Application

items()[source]

Return the suite’s applications as (title, Application) pairs.

Returns:

A view of the internal application dictionary items, which are of type Application.

Return type:

dict_items

keys()[source]

Return an iterator over the application titles.

property kinds: Series

Returns a pd.Series of application types in the suite.

Returns:

Series of application types in the suite.

Return type:

pd.Series of str

remove(title: str)[source]

Remove application from the suite.

Parameters:

title (str) – Title of the application to be removed.

property s: DataFrame

Returns a pd.DataFrame of sensitivity objects in the suite.

Returns:

DataFrame of sensitivity objects in the suite.

Return type:

pd.DataFrame

property titles: list

Returns a list of application titles in the suite.

Returns:

List of application titles in the suite.

Return type:

list of str

update_c(new_c: Series) ApplicationSuite[source]

Create a new ApplicationSuite with updated calculated values.

This method is typically used to generate a posterior suite after an assimilation update (e.g., GLLS).

Parameters:

new_c (pd.Series) – A series containing the updated ‘c’ values, indexed by application title.

Returns:

A new instance of the suite containing updated Application objects.

Return type:

ApplicationSuite

Raises:

KeyError – If an applicaiton title in the suite is missing from the index of new_c.

values()[source]

Return an iterator over the application objects.

property zais: list

Returns a list of unique ZAIs in the sensitivity data of the applications in the suite.

Returns:

List of unique ZAIs in the sensitivity data of the applications in the suite.

Return type:

list of int

class andalus.AssimilationSuite(benchmarks: BenchmarkSuite, applications: ApplicationSuite, covariances: CovarianceSuite)[source]

Bases: object

Class to manage a collection of benchmark, application and covariance data for assimilation purposes. This class can be used to assemble a complete dataset for assimilation, and to perform operations on the entire suite.

applications: ApplicationSuite
benchmarks: BenchmarkSuite
property c

Concatenate calculated values from all benchmarks and applications.

This property gathers calculated values from available benchmark and application suites, aligns them by their titles, and fills missing values with zeros to create a unified calculated value vector.

Returns:

A combined Series containing calculated values, aligned by index.

Return type:

pd.Series

Raises:

ValueError – If both benchmarks and applications are None or empty.

chi_squared(nuclear_data: bool = False) float[source]

Calculate the total chi-squared for the suite.

\[\]

chi^2 = (m - c)^T C^{-1} (m - c)

Parameters:

nuclear_data (bool, optional) – Whether to include the contribution of the nuclear data uncertainty in the chi² calculation, by default False.

ck_matrix() DataFrame[source]

Generate a ck-similarity matrix for the current assimilation suite.

Returns:

A dataframe containing the similarity coefficients between all benchmarks and applications in the AssimilationSuite.

Return type:

pd.DataFrame

ck_target(target: str) Series[source]

Calculate the ck-similarity of all sensitivities in the suite with a specified target sensitivity profile.

Parameters:

target (str) – The name of the target sensitivity profile to compare against.

Returns:

A Series containing the ck-similarity values for each sensitivity profile in the suite compared to the target.

Return type:

pd.Series

covariances: CovarianceSuite
property dc

Concatenate calculated value uncertainties from all benchmarks and applications.

This property gathers calculated value uncertainties from available benchmark and application suites, aligns them by their titles, and fills missing values with zeros to create a unified calculated value uncertainty vector.

Returns:

A combined Series containing calculated value uncertainties, aligned by index.

Return type:

pd.Series

Raises:

ValueError – If both benchmarks and applications are None or empty.

property dm

Return experimental uncertainty values from the benchmark suite.

Returns:

A Series containing the experimental uncertainty values from the benchmark suite.

Return type:

pd.Series

property ds

Concatenate sensitivity uncertainties data from all benchmarks and applications.

This property gathers sensitivity uncertainty vectors from available benchmark and application suites, aligns them by their MultiIndex, and fills missing values with zeros to create a unified sensitivity uncertainty matrix.

Returns:

A combined DataFrame containing sensitivity uncertainties, aligned along the columns (axis=1).

Return type:

pd.DataFrame

Raises:

ValueError – If both benchmarks and applications are None or empty.

classmethod from_yaml(path: str = 'assimilation_suite.yaml')[source]

Factory method to create an AssimilationSuite instance from a YAML configuration file.

Parameters:

path (str, optional) – The path to the YAML configuration file, by default “assimilation_suite.yaml”.

Returns:

An instance of AssimilationSuite populated with data from the YAML file.

Return type:

AssimilationSuite

glls(include_sensitivity_uncertainty: bool = False) AssimilationSuite[source]

Perform a GLLS update [1] on the assimilation suite using the sensitivity profiles and covariance data loaded in the AssimilationSuite. This method updates the calculated response and the covariance matrices.

Returns:

A new AssimilationSuite instance with updated sensitivity profiles.

Return type:

AssimilationSuite

References

individual_chi_squared(nuclear_data: bool = False) Series[source]

Calculate individual chi-squared for each benchmark in the suite.

\[\]

chi^2 = frac{(m - c)^2}{sigma_m^2 + sigma_c^2 + s^T C s}

Parameters:

nuclear_data (bool, optional) – Whether to include the contribution of the nuclear data uncertainty in the chi² calculation, by default False.

property m

Return experimental values from the benchmark suite.

Returns:

A Series containing the experimental values from the benchmark suite.

Return type:

pd.Series

propagate_nuclear_data_uncertainty()[source]

Propagate the nuclear data uncertainty through the sensitivity profiles to calculate the contribution of the nuclear data uncertainty to the overall uncertainty in the calculated values.

Returns:

A Series containing the propagated nuclear data uncertainty for each case in the suite.

Return type:

pd.Series

property s

Concatenate sensitivity data from all benchmarks and applications.

This property gathers sensitivity vectors from available benchmark and application suites, aligns them by their MultiIndex, and fills missing values with zeros to create a unified sensitivity matrix.

Returns:

A combined DataFrame containing sensitivities, aligned along the columns (axis=1).

Return type:

pd.DataFrame

Raises:

ValueError – If both benchmarks and applications are None or empty.

property titles

Get a list of all case titles in the assimilation suite, including both benchmarks and applications.

Returns:

A list of strings representing the titles of all cases in the suite.

Return type:

list

class andalus.Benchmark(title: str, kind: str, m: float, dm: float, c: float, dc: float, s: Sensitivity)[source]

Bases: object

A benchmark is an application that has an associated measurement.

title

The unique name or identifier for the application.

Type:

str

kind

The kind of the observable (e.g., “keff”, “void”).

Type:

str

m

The measured value (Nominal).

Type:

float

dm

The uncertainty of the measurement.

Type:

float

c

The calculated value (Nominal).

Type:

float

dc

The uncertainty of the calculation.

Type:

float

s

The energy-dependent sensitivity profiles.

Type:

Sensitivity

c: float
dc: float
dm: float
classmethod from_hdf5(file_path, title: str, kind: str = 'keff')[source]

Create a Benchmark instance from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file containing the benchmark data.

  • title (str) – Title of the benchmark to load.

  • kind (str, optional) – Type of benchmark (e.g., “keff”). Default is “keff”.

Returns:

A new Benchmark instance with the loaded data.

Return type:

Benchmark

classmethod from_serpent(title: str, m: float, dm: float, sens0_path: str, results_path: str, kind: str = 'keff', materials=None, zailist=None, pertlist=None)[source]

Method to create a Benchmark object from a serpent output.

Parameters:
  • title (str) – title of the benchmark.

  • m (float) – measurement value.

  • dm (float) – measurement uncertainty.

  • results_path (str) – path to the Serpent _res.m file.

  • sens0_path (str) – path to the Serpent _sens0.m file.

  • kind (str, optional) – kind of observable, by default “keff”.

  • materials (_type_, optional) – The material in which the sensitivity is calculated, by default None.

  • zailist (_type_, optional) – The ZAIs which have to be extracted from the sensitivity file, by default None.

  • pertlist (_type_, optional) – The perturbations which have to be extracted from the sensitivity file, by default None.

Returns:

Returns a Benchmark object with the calculated value and sensitivity data extracted from the Serpent files.

Return type:

_type_

kind: str
m: float
print_summary()[source]

Print a quick summary of a benchmark object.

s: Sensitivity
title: str
to_hdf5(file_path='benchmarks.h5')[source]

Save the benchmark data to an HDF5 file.

Parameters:

file_path (str, optional) –

The path to the HDF5 file where the benchmark data will be saved.

Default is ‘benchmarks.h5’.

class andalus.BenchmarkSuite(benchmarks: dict[str, ~andalus.benchmark.Benchmark]=<factory>)[source]

Bases: object

A benchmarksuite is a combined set of benchmark objects.

benchmarks

A dictionary of benchmark objects, indexed by their title.

Type:

dict[str, Benchmark]

benchmarks: dict[str, Benchmark]
property c: Series

Returns a pd.Series of benchmark calculated values in the suite.

Returns:

Series of benchmark calculated values in the suite.

Return type:

pd.Series of float

property cov_m: DataFrame

Returns a pd.DataFrame of benchmark measurement covariance in the suite.

Returns:

DataFrame of benchmark measurement covariance in the suite.

Return type:

pd.DataFrame

property dc: Series

Returns a pd.Series of benchmark calculated uncertainties in the suite.

Returns:

Series of benchmark calculated uncertainties in the suite.

Return type:

pd.Series of float

property dm: Series

Returns a pd.Series of benchmark measurement uncertainties in the suite.

Returns:

Series of benchmark measurement uncertainties in the suite.

Return type:

pd.Series of float

property ds: DataFrame

Returns a pd.DataFrame of sensitivity uncertainties in the suite.

Returns:

DataFrame of sensitivity uncertainties in the suite.

Return type:

pd.DataFrame

classmethod from_hdf5(file_path: str, titles: list, kind: str = 'keff')[source]

Retrieve a set of benchmarks from a database.

Parameters:
  • file_path (str) – file path where the database is located.

  • titles (list, optional) – Titles which have to be extracted from the database, if None return all the benchmarks available in the database, by default None.

Returns:

Returns a BenchmarkSuite object containing the imported Benchmark objects.

Return type:

BenchmarkSuite

classmethod from_yaml(path: str)[source]

Factory method to create a BenchmarkSuite instance from a YAML configuration file.

Parameters:

path (str) – The path to the YAML configuration file.

Returns:

An instance of BenchmarkSuite populated with data from the YAML file.

Return type:

BenchmarkSuite

get(title: str) Benchmark | None[source]

Get a benchmark from the suite.

Parameters:

title (str) – Title of the benchmark to be retrieved.

Returns:

Benchmark object.

Return type:

Benchmark

items()[source]

Return the suite’s benchmarks as (title, Benchmark) pairs.

Returns:

A view of the internal benchmarks dictionary items.

Return type:

dict_items

keys()[source]

Return an iterator over the benchmark titles.

property kinds: Series

Returns a pd.Series of benchmark types in the suite.

Returns:

Series of benchmark types in the suite.

Return type:

pd.Series of str

property m: Series

Returns a pd.Series of benchmark measurements in the suite.

Returns:

Series of benchmark measurements in the suite.

Return type:

pd.Series of float

remove(title: str)[source]

Remove benchmark from the suite.

Parameters:

title (str) – Title of the benchmark to be removed.

property s: DataFrame

Returns a pd.DataFrame of sensitivity objects in the suite.

Returns:

DataFrame of sensitivity objects in the suite.

Return type:

pd.DataFrame

property titles: list

Returns a list of benchmark titles in the suite.

Returns:

List of benchmark titles in the suite.

Return type:

list of str

update_c(new_c: Series) BenchmarkSuite[source]

Create a new BenchmarkSuite with updated calculated values.

This method is typically used to generate a posterior suite after an assimilation update (e.g., GLLS).

Parameters:

new_c (pd.Series) – A series containing the updated ‘c’ values, indexed by benchmark title.

Returns:

A new instance of the suite containing updated Benchmark objects.

Return type:

BenchmarkSuite

Raises:

KeyError – If a benchmark title in the suite is missing from the index of new_c.

values()[source]

Return an iterator over the benchmark objects.

property zais: list

Returns a list of unique ZAIs in the sensitivity data of the benchmarks in the suite.

Returns:

List of unique ZAIs in the sensitivity data of the benchmarks in the suite.

Return type:

list of int

class andalus.Covariance(data=None, index: Axes | None = None, columns: Axes | None = None, dtype: Dtype | None = None, copy: bool | None = None)[source]

Bases: DataFrame

Subclass of pd.DataFrame for handling individual nuclide covariance data.

zai

Nuclide identifier (ZAI).

Type:

int

temperature

Temperature at which the covariance was generated.

Type:

float, optional

err

Associated error or tolerance.

Type:

float, optional

correlation() DataFrame[source]

Calculate the correlation matrix from the covariance matrix.

Returns:

Correlation matrix with values between -1 and 1.

Return type:

pd.DataFrame

classmethod from_errorr(files: dict[str, str], zai: int, mts: list[int] | None = None, temperature: float | None = None, err: float | None = None) Covariance[source]

Construct a Covariance object from NJOY errorr output files.

Parameters:
  • files (dict[str, str]) – Dictionary mapping section names (e.g., ‘errorr33’) to file paths.

  • zai (int) – Nuclide identifier (ZAI).

  • mts (list of int, optional) – Filter for specific MT numbers.

  • temperature (float, optional) – Temperature at which the covariance was generated.

  • err (float, optional) – Associated error or tolerance.

Returns:

Reconstructed covariance matrix from errorr data.

Return type:

Covariance

classmethod from_hdf5(file_path: str, zai: int, mts: list[int] | None = None) Covariance[source]

Load a covariance matrix from HDF5 and reconstruct from sparse storage.

Parameters:
  • file_path (str) – Path to the HDF5 file.

  • zai (int) – Nuclide identifier (ZAI).

  • mts (list of int, optional) – Filter for specific MT numbers.

Returns:

Reconstructed symmetric covariance matrix.

Return type:

Covariance

classmethod from_store(store: HDFStore, zai: int, mts: list[int] | None = None) Covariance[source]

Extract and reconstruct a Covariance object from an open HDFStore.

Parameters:
  • store (pd.HDFStore) – The open HDF5 store object.

  • zai (int) – Nuclide identifier (ZAI).

  • mts (list of int, optional) – Filter for specific MT numbers.

Returns:

Reconstructed symmetric covariance matrix.

Return type:

Covariance

is_unrealistic_uncertainty(threshold=10)[source]

Check if diagonal elements (variances) exceed a threshold.

property nuclide: str | None

Return a string representation of the isotope based on ZAI.

to_hdf5(file_path: str)[source]

Save the matrix to HDF5 using sparse lower-triangular storage.

Parameters:

file_path (str) – Path to save the HDF5 file.

class andalus.CovarianceSuite(matrix: DataFrame)[source]

Bases: object

Container for global nuclear data covariance systems.

This class manages the transition from independent nuclide matrices to a fully correlated global system, often used in Least Squares adjustments.

Parameters:

matrix (pd.DataFrame) – The unified global covariance matrix with a 5-level MultiIndex: (ZAI, MF, MT, E_min, E_max).

classmethod from_df(df: DataFrame) CovarianceSuite[source]

Construct a suite directly from a DataFrame. Useful for loading adjusted/correlated matrices.

Parameters:

df (pd.DataFrame) – The global covariance matrix.

Returns:

A suite wrapping the provided DataFrame.

Return type:

CovarianceSuite

classmethod from_dict(items: dict[int, Covariance]) CovarianceSuite[source]

Construct a suite from a dictionary of independent Covariance objects.

This creates a block-diagonal matrix where off-diagonal blocks (cross-nuclide correlations) are initialized to zero.

Parameters:

items (Dict[int, Covariance]) – Dictionary mapping ZAI to Covariance objects.

Returns:

A suite containing the assembled block-diagonal matrix.

Return type:

CovarianceSuite

classmethod from_hdf5(file_path: str, zais: list[int] | None = None, mts: list[int] | None = None) CovarianceSuite[source]

Load a suite from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file.

  • zais (Optional[List[int]]) – List of ZAI values to include in the suite.

  • mts (Optional[List[int]]) – List of MT values to include in the suite.

Returns:

The loaded suite.

Return type:

CovarianceSuite

classmethod from_yaml(path: str, zais: list[int], mts: list[int] | None = None) CovarianceSuite[source]

Factory method to create a CovarianceSuite instance from a YAML configuration file.

Parameters:
  • path (str) – The path to the YAML configuration file, by default “assimilation_suite.yaml”.

  • zais (list[int]) – List of ZAI values to include in the suite.

  • mts (list[int]) – List of MT values to include in the suite.

Returns:

An instance of CovarianceSuite populated with data from the YAML file.

Return type:

CovarianceSuite

get_correlation_matrix() DataFrame[source]

Calculate the correlation matrix from the current covariance matrix.

Returns:

Matrix of correlation coefficients (-1 to 1).

Return type:

pd.DataFrame

get_uncertainties() Series[source]

Return the standard deviations (sqrt of diagonal) for all bins.

Returns:

Standard deviation values.

Return type:

pd.Series

matrix: DataFrame
plot_uncertainty(zai: int, mt: int, ax=None, **kwargs)[source]

Plot the uncertainty (standard deviation) for a specific ZAI and MT.

Parameters:
  • zai (int) – The ZAI of the nuclide to plot.

  • mt (int) – The MT number to plot.

  • ax (matplotlib.axes.Axes, optional) – An existing matplotlib Axes to plot on. If None, a new figure will be created.

Returns:

The Axes object containing the plot.

Return type:

matplotlib.axes.Axes

class andalus.Sensitivity(data=None, *args, **kwargs)[source]

Bases: DataFrame

Data structure for nuclear data sensitivity analysis.

Inherits from pandas.DataFrame and maintains metadata across slicing and transformation operations.

Parameters:
  • data (array-like, Iterable, dict, or scalar value) – Contains data to be stored in the DataFrame.

  • title (str, optional) – The name of the benchmark or experiment (e.g., ‘HMF001’).

  • kind (str, optional) – The response type, by default ‘keff’.

  • *args (list) – Additional positional arguments for pd.DataFrame.

  • **kwargs (dict) – Additional keyword arguments for pd.DataFrame.

title

The identifier for the sensitivity data.

Type:

str

kind

The type of observable the sensitivity relates to.

Type:

str

classmethod from_hdf5(file_path, title, kind: str = 'keff')[source]

Create a Sensitivity instance from an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file containing the sensitivity data.

  • title (str) – Title of the sensitivity data to load.

  • kind (str, optional) – Type of sensitivity data (e.g., “keff”). Default is “keff”.

Returns:

Sensitivity object containing the loaded sensitivity data.

Return type:

Sensitivity

classmethod from_serpent(sens0_path: str, title: str, kind: str = 'keff', materiallist=None, zailist=None, pertlist=None)[source]

Returns a sensitivity object from a Serpent sensitivity file.

Parameters:
  • sens0_path (str) – Path to the Serpent sensitivity file.

  • title (str) – Title for the sensitivity data.

  • materiallist (list, optional) – List of materials to include. Default is [‘total’].

  • zailist (list, optional) – List of ZAIs to include. Default is None, which includes all ZAIs.

  • pertlist (list, optional) – List of perturbations to include. Default is None, which corresponds to all perturbations in the sensitivity file.

Returns:

Sensitivity object containing the sensitivity data.

Return type:

Sensitivity

Raises:

SensitivityError – If there is an error reading the sensitivity file.

property isotopes

Returns a list of human readable isotopes.

Returns:

List of human readable isotopes.

Return type:

list of str

plot_sensitivity(zais, perts, ax=None, **kwargs)[source]

Return a plot of the sensitivity profile normalized by unit lethargy

Parameters:
  • zais (list) – List of zais to be included in the plot.

  • perts (list) – List of perts to be included in the plot.

  • ax (plt.Axes, optional) – Ax for the plot to be displayed. If None, a new figure and axis will be created.

  • **kwargs – Additional keyword arguments to be passed to the plotting function.

rename_sensitivity(new_title: str) Sensitivity[source]

Rename the benchmark columns and update the title metadata.

Parameters:

new_title (str) – The new identifier for the benchmark columns.

Returns:

A new Sensitivity object with updated columns and title metadata.

Return type:

Sensitivity

to_hdf5(file_path)[source]

Save the Sensitivity instance to an HDF5 file.

Parameters:
  • file_path (str) – Path to the HDF5 file where the sensitivity data will be saved.

  • title (str) – Title of the sensitivity data to save.

  • kind (str, optional) – Type of sensitivity data (e.g., “keff”). Default is “keff”.

andalus.sandwich(s1, cov, s2)[source]

Perform the sandwich formula to propagate uncertainties using first-order Taylor expansion.

Parameters:
  • s1 (pd.DataFrame or pd.Series) – First sensitivity matrix or vector.

  • cov (pd.DataFrame) – Covariance matrix.

  • s2 (pd.DataFrame or pd.Series) – Second sensitivity matrix or vector.

Returns:

Result of the sandwich formula.

Return type:

pd.DataFrame or pd.Series