Skip to main content

Module codata

Module codata 

Source
Expand description

The CODATA 2022 recommended values of the fundamental physical constants, looked up by name with their units and standard uncertainties (SciPy’s scipy.constants.physical_constants, value, unit, precision and find).

The table holds SciPy’s 445 entries: the 355 constants of CODATA 2022 and 90 names kept from earlier adjustments (with their older values), which are flagged PhysicalConstant::obsolete and left out of find.

use lib_jsl_core::codata::{find, physical_constant, value};

let me = physical_constant("electron mass").unwrap();
assert_eq!(me.value, 9.1093837139e-31);
assert_eq!(me.unit, "kg");
assert_eq!(me.uncertainty, 2.8e-40);
assert_eq!(value("speed of light in vacuum"), Some(299792458.0));
assert!(find("Bohr radius").contains(&"Bohr radius"));

See the book entry Shared types, constants and utilities.

Structs§

PhysicalConstant
One entry of the CODATA table: SciPy’s physical_constants[name] as a record.

Functions§

all
Every entry of the table, current and obsolete, in SciPy’s order.
find
The names of the current (CODATA 2022) constants that contain sub, ignoring case, in sorted order (SciPy’s find). An empty sub lists them all.
physical_constant
The constant called name (exact, case-sensitive match), or None.
precision
The relative uncertainty of the constant called name.
unit
The unit of the constant called name (SciPy’s unit).
value
The value of the constant called name (SciPy’s value).