Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 17 variants EmptyTally, LengthMismatch { expected: usize, got: usize, }, ZeroMaxFlux { energy_group: usize, }, EmptyPdf, NegativePdf { index: usize, value: f64, }, NonFinitePdf { index: usize, }, ZeroSumPdf, NegativeTally { index: usize, value: f64, }, NonFiniteTally { field: &'static str, index: usize, }, ZeroVarianceDim { dim: usize, }, BadDraw { value: f64, }, NegativeWindow { index: usize, value: f64, }, NonFiniteWindow { index: usize, }, BadEnergyBounds { index: usize, }, BadMeshBounds { axis: usize, index: usize, }, BadEmissionOption { option: &'static str, value: String, detail: &'static str, }, Wwinp(String),
}
Expand description

Errors raised by variance-reduction tools.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

EmptyTally

Tally carries no volume elements.

§

LengthMismatch

A requested array has the wrong length.

Fields

§expected: usize

Expected element count.

§got: usize

Actual element count.

§

ZeroMaxFlux

Every flux value feeding one energy bin is non-positive, so the MAGIC normalization value / (2 * max) would divide by zero. (Rather than silently emitting inf/nan, this is an error.)

Fields

§energy_group: usize

Index of the energy bin with no positive flux.

§

EmptyPdf

PDF input is empty.

§

NegativePdf

PDF contains a negative entry.

Fields

§index: usize

Index of the negative entry.

§value: f64

The offending value.

§

NonFinitePdf

PDF contains a non-finite (NaN/infinite) entry.

Fields

§index: usize

Index of the non-finite entry.

§

ZeroSumPdf

PDF sums to zero (or negatively); cannot normalize.

§

NegativeTally

Tally or user density contains a negative value.

Fields

§index: usize

Index of the negative value.

§value: f64

The offending value.

§

NonFiniteTally

Tally array contains a non-finite (NaN/infinite) value.

Fields

§field: &'static str

Name of the tally field holding the value.

§index: usize

Index of the non-finite entry.

§

ZeroVarianceDim

A KDE Silverman dimension has zero variance (a zero bandwidth is a delta spike, never a density); use an explicit fixed width instead.

Fields

§dim: usize

Index of the zero-variance dimension.

§

BadDraw

A KDE draw uniform falls outside [0, 1).

Fields

§value: f64

The offending uniform value.

§

NegativeWindow

A weight-window lower bound is negative and has no spelling in either target format (non-positive windows are inert; negative never is).

Fields

§index: usize

Flat index into MagicOutput::lower_bounds_ww.

§value: f64

The offending value.

§

NonFiniteWindow

A weight-window lower bound is NaN or infinite.

Fields

§index: usize

Flat index into MagicOutput::lower_bounds_ww.

§

BadEnergyBounds

Energy upper bounds are empty, non-finite, non-positive, or not strictly increasing, so the window energy grid is ill-defined.

Fields

§index: usize

Index of the offending bound.

§

BadMeshBounds

Mesh bounds have fewer than two entries, are non-finite, or are not strictly increasing.

Fields

§axis: usize

Axis index (0 = x, 1 = y, 2 = z).

§index: usize

Index of the offending bound.

§

BadEmissionOption

An emission tuning parameter or card token falls outside the range the target code enforces when reading the file, or cannot be interpolated into the emitted card safely.

Fields

§option: &'static str

Parameter name (upper_bound_ratio, survival_ratio, max_split, weight_cutoff, name, file, energy_bounds, upper_ww_bounds).

§value: String

The offending value.

§detail: &'static str

Why it was rejected.

§

Wwinp(String)

The WWINP writer in nucleide-mcnp-io refused the assembled file.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Error) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.