Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@particle_input(exclude={"neutrino", "antineutrino"})
def particle_mass(
particle: Particle, *, Z: Integral = None, mass_numb: Integral = None
) -> u.Quantity:
"""
Return the mass of a particle.
Parameters
----------
particle: `str`, `int`, or `~plasmapy.particles.Particle`
A string representing an element, isotope, ion, or special
particle; an integer representing an atomic number; or an
instance of the Particle class.
Z: `int`, optional, keyword-only
The ionization state of the ion.
@particle_input
def isotope_symbol(isotope: Particle, mass_numb: Optional[Integral] = None) -> str:
"""
Return the symbol representing an isotope.
Parameters
----------
isotope: `str`, `int`, or `~plasmapy.particles.Particle`
A `str` representing an element, isotope, or ion or an
`int` representing an atomic number
mass_numb: `int` or `str`, optional
The mass number of the isotope.
Returns
-------
symbol: `str`
@particle_input(any_of={"isotope", "baryon"})
def nuclear_binding_energy(
particle: Particle, mass_numb: Optional[int] = None
) -> u.Quantity:
"""
Return the nuclear binding energy associated with an isotope.
Parameters
----------
particle: `str`, `int`, or `~plasmapy.particles.Particle`
A Particle object, a string representing an element or isotope,
or an integer representing the atomic number of an element.
mass_numb: `int`, optional
The mass number of an isotope, which is required if and only
if the first argument can only be used to determine the
element and not the isotope.
@particle_input
def element_name(element: Particle) -> str:
"""
Return the name of an element.
Parameters
----------
argument : `str`, `int`, or `~plasmapy.particles.Particle`
A `str` representing an element, isotope, or ion or an
`int` representing an atomic number
Returns
-------
name : `str`
The name of the element.
Raises
@particle_input
def mass_energy(particle: Particle, mass_numb: Optional[int] = None) -> u.Quantity:
"""
Return a particle's mass energy. If the particle is an isotope or
nuclide, return the nuclear mass energy only.
Parameters
----------
particle: `str`, `int`, or `~plasmapy.particles.Particle`
A Particle object, a string representing an element or isotope,
or an integer representing the atomic number of an element.
mass_numb: `int` (optional)
The mass number of an isotope, which is required if and only
if the first argument can only be used to determine the
element and not the isotope.
@particle_input(exclude={"isotope", "ion"})
def standard_atomic_weight(element: Particle) -> u.Quantity:
"""Return the standard (conventional) atomic weight of an element
based on the relative abundances of isotopes in terrestrial
environments.
Parameters
----------
element: `str`, `int`, or `~plasmapy.particles.Particle`
A string representing an element or an integer representing an
atomic number, or an instance of the Particle class.
Returns
-------
atomic_weight: `~astropy.units.Quantity`
The standard atomic weight of an element based on values from
NIST.
@particle_input
def isotopic_abundance(isotope: Particle, mass_numb: Optional[Integral] = None) -> Real:
"""
Return the isotopic abundances if known, and otherwise zero.
Parameters
----------
argument: `str` or `int`
A string representing an element or isotope, or an integer
representing the atomic number of an element.
mass_numb: `int`, optional
The mass number of an isotope, which is required if and only
if the first argument can only be used.
Returns
-------
@particle_input(any_of={"stable", "unstable", "isotope"})
def half_life(particle: Particle, mass_numb: Optional[Integral] = None) -> u.Quantity:
"""
Return the half-life in seconds for unstable isotopes and particles,
and numpy.inf in seconds for stable isotopes and particles.
Parameters
----------
particle: `int`, `str`, or `~plasmapy.particles.Particle`
A string representing an isotope or particle, an integer
representing an atomic number, or an instance of the Particle
class.
mass_numb: `int`, optional
The mass number of an isotope.
Returns
@particle_input
def is_stable(particle: Particle, mass_numb: Optional[Integral] = None) -> bool:
"""
Return `True` for stable isotopes and particles and `False` for
unstable isotopes.
Parameters
----------
particle: `int`, `str`, or `~plasmapy.particles.Particle`
A string representing an isotope or particle, or an integer
representing an atomic number.
mass_numb: `int`, optional
The mass number of the isotope.
Returns
-------
@particle_input
def atomic_number(element: Particle) -> Integral:
"""
Return the number of protons in an atom, isotope, or ion.
Parameters
----------
element: `str` or `~plasmapy.particles.Particle`
A string representing an element, isotope, or ion; or an
instance of the `~plasmapy.particles.Particle` class.
Returns
-------
atomic_number: `int`
The atomic number of an element.
Raises