Repository: PlasmaPy/PlasmaPy (python)

Issue:
Should we rename the charge_state function?
The `charge_state` function in the atomic subpackage current returns the integer electric charge (e.g., `-1` for `'e-'`, `1` for `'p'`, `16` for `'Fe 16+'`, and so on).  The name `charge_state` is appropriate for ions where it also means the ionization state.  However, it makes less sense to talk about the charge state of electrons, muons, and neutrons, so I'm wondering if we should change it to something else.  

I have been thinking `integer_charge` is intuitive and easy to understand, though it would not be as appropriate for describing quarks if we were to extend the atomic subpackage further.  Are there any other good alternatives?

Pull request description:
Rename charge_state to _integer_charge
This pull request goes throughout the code and replaces `charge_state` with `integer_charge`, and makes a few other minor/formatting changes.  Closes #236.

Patch:
diff --git a/plasmapy/atomic/__init__.py b/plasmapy/atomic/__init__.py
index 6c7b5762..bf053c42 100644
--- a/plasmapy/atomic/__init__.py
+++ b/plasmapy/atomic/__init__.py
@@ -18,7 +18,7 @@
     common_isotopes,
     stable_isotopes,
     isotopic_abundance,
-    charge_state,
+    integer_charge,
     electric_charge,
 )
 
diff --git a/plasmapy/atomic/atomic.py b/plasmapy/atomic/atomic.py
index d97c7302..bc103071 100644
--- a/plasmapy/atomic/atomic.py
+++ b/plasmapy/atomic/atomic.py
@@ -24,7 +24,7 @@
 from .names import (
     atomic_symbol,
     isotope_symbol,
-    _extract_charge_state,
+    _extract_integer_charge,
     _is_proton,
     _is_positron,
     _is_antineutron,
@@ -262,7 +262,7 @@ def standard_atomic_weight(argument: Union[str, int]) -> Quantity:
                                   "standard_atomic_weight.")
 
     try:
-        charge_state(argument)
+        integer_charge(argument)
     except ChargeError:
         pass
     else:
@@ -349,9 +349,9 @@ def isotope_mass(argument: Union[str, int],
 
     """
 
-    argument, charge_state = _extract_charge_state(argument)
+    argument, Z = _extract_integer_charge(argument)
 
-    if charge_state is not None and charge_state != 0:
+    if Z is not None and Z != 0:
         raise AtomicError("Use ion_mass instead of isotope_mass for masses of "
                           "charged particles.")
 
@@ -503,14 +503,14 @@ def ion_mass(argument: Union[str, int, Quantity], Z: int = None,
         raise InvalidIonError("Use isotope_mass or m_n to get mass of neutron")
 
     if isinstance(argument, str):
-        argument, Z_from_arg = _extract_charge_state(argument)
+        argument, Z_from_arg = _extract_integer_charge(argument)
     else:
         Z_from_arg = None
 
     if Z is None and Z_from_arg is None:
         Z = 1
     elif Z is not None and Z_from_arg is not None and Z != Z_from_arg:
-        raise InvalidIonError("Inconsistent charge state information in"
+        raise InvalidIonError("Inconsistent charge information in"
                               "ion_mass.")
     elif Z is None and Z_from_arg is not None:
         Z = Z_from_arg
@@ -642,8 +642,8 @@ def isotopic_abundance(argument: Union[str, int],
     return iso_comp
 
 
-def charge_state(particle: str) -> int:
-    r"""Returns the charge state of an ion or other particle.
+def integer_charge(particle: str) -> int:
+    r"""Returns the integer charge of an ion or other particle.
 
     Parameters
     ----------
@@ -655,7 +655,7 @@ def charge_state(particle: str) -> int:
     -------
 
     Z : integer
-        The charge state, or None if it is not available.
+        The integer charge, or None if it is not available.
 
     Raises
     ------
@@ -668,18 +668,17 @@ def charge_state(particle: str) -> int:
         If charge information for the particle is not available.
 
     AtomicWarning
-        If the input represents an ion with a charge state that is
+        If the input represents an ion with an integer charge that is
         below -3.
 
     Notes
     -----
 
-    This function supports two formats for the charge state
-    information.
+    This function supports two formats for integer charge information.
 
     The first format is a string that has information for the element
-    or isotope at the beginning, a space in between, and the charge
-    state information in the form of an integer followed by a plus or
+    or isotope at the beginning, a space in between, and the integer
+    charge information in the form of an integer followed by a plus or
     minus sign, or a plus or minus sign followed by an integer.
 
     The second format is a string containing element information at
@@ -691,13 +690,13 @@ def charge_state(particle: str) -> int:
     Examples
     --------
 
-    >>> charge_state('Fe-56 2+')
+    >>> integer_charge('Fe-56 2+')
     2
-    >>> charge_state('He -2')
+    >>> integer_charge('He -2')
     -2
-    >>> charge_state('H+')
+    >>> integer_charge('H+')
     1
-    >>> charge_state('N-14++')
+    >>> integer_charge('N-14++')
     2
 
     """
@@ -709,12 +708,12 @@ def charge_state(particle: str) -> int:
     elif _is_neutron(particle) or _is_antineutron(particle):
         return 0
 
-    particle, Z = _extract_charge_state(particle)
+    particle, Z = _extract_integer_charge(particle)
 
     try:
         atomic_symbol(particle)
     except InvalidParticleError:
-        raise InvalidParticleError("Invalid particle in charge_state")
+        raise InvalidParticleError("Invalid particle in integer_charge")
 
     if Z is None:
         raise ChargeError(f"Unable to find charge of {particle}.")
@@ -723,7 +722,7 @@ def charge_state(particle: str) -> int:
 
     if Z > atomic_numb:
         raise InvalidParticleError("The integer charge cannot be greater than "
-                                   "the atomic number in charge_state.")
+                                   "the atomic number in integer_charge.")
 
     if Z < -atomic_numb - 1 or Z < -3:
         warnings.warn(f"Element {atomic_symbol(particle)} has a charge of {Z}"
@@ -740,8 +739,8 @@ def electric_charge(particle: str) -> Quantity:
     ----------
 
     particle : string
-        String representing an element or isotope followed by charge
-        state information.
+        String representing an element or isotope followed by integer
+        charge information.
 
     Returns
     -------
@@ -760,18 +759,17 @@ def electric_charge(particle: str) -> Quantity:
         If charge information for the particle is not available.
 
     AtomicWarning
-        If the input represents an ion with a charge state that is
+        If the input represents an ion with an integer charge that is
         below -3.
 
     Notes
     -----
 
-    This function supports two formats for the charge state
-    information.
+    This function supports two formats for integer charge information.
 
     The first format is a string that has information for the element
-    or isotope at the beginning, a space in between, and the charge
-    state information in the form of an integer followed by a plus or
+    or isotope at the beginning, a space in between, and the integer
+    charge information in the form of an integer followed by a plus or
     minus sign, or a plus or minus sign followed by an integer.
 
     The second format is a string containing element information at
@@ -791,7 +789,7 @@ def electric_charge(particle: str) -> Quantity:
     """
 
     try:
-        charge = charge_state(particle) * const.e.to('C')
+        charge = integer_charge(particle) * const.e.to('C')
     except InvalidParticleError:
         raise InvalidParticleError("Invalid particle in electric_charge.")
     except ChargeError:
diff --git a/plasmapy/atomic/names.py b/plasmapy/atomic/names.py
index a103c73e..1fc89da0 100644
--- a/plasmapy/atomic/names.py
+++ b/plasmapy/atomic/names.py
@@ -99,7 +99,7 @@ def atomic_symbol(argument: Union[str, int]) -> str:
         raise InvalidElementError(f"{argument} is not a valid element.")
 
     try:
-        argument, Z = _extract_charge_state(argument)
+        argument, Z = _extract_integer_charge(argument)
     except InvalidParticleError:
         raise InvalidParticleError("Invalid charge in atomic_symbol")
 
@@ -257,7 +257,7 @@ def isotope_symbol(argument: Union[str, int], mass_numb: int = None) -> str:
         return argument
 
     if isinstance(argument, str):
-        argument, Z = _extract_charge_state(argument)
+        argument, Z = _extract_integer_charge(argument)
 
     if isinstance(argument, str) and argument.isdigit():
         argument = int(argument)
@@ -403,7 +403,7 @@ def element_name(argument: Union[str, int]) -> str:
     return name
 
 
-def _extract_charge_state(argument: str) -> Tuple[str, int]:
+def _extract_integer_charge(argument: str) -> Tuple[str, int]:
     r"""Splits strings containing element or isotope and charge state
     information into a string without the charge state information and
     the charge state as an integer (or None if no charge state
@@ -444,12 +444,12 @@ def _extract_charge_state(argument: str) -> Tuple[str, int]:
     Examples
     --------
 
-    >>> isotope, Z = _extract_charge_state('Fe-56+++')
+    >>> isotope, Z = _extract_integer_charge('Fe-56+++')
     >>> print(isotope)
     Fe-56
     >>> print(Z)
     3
-    >>> _extract_charge_state('D +1')
+    >>> _extract_integer_charge('D +1')
     ('D', 1)
 
     """
@@ -490,7 +490,7 @@ def _extract_charge_state(argument: str) -> Tuple[str, int]:
             charge = ion_info.replace('+', '')
 
         try:
-            charge_state = sign * int(charge)
+            Z = sign * int(charge)
             check3 = True
         except Exception:
             check3 = False
@@ -505,10 +505,10 @@ def _extract_charge_state(argument: str) -> Tuple[str, int]:
         char = argument[-1]
         match = re.match(r"["+char+"]*", argument[::-1])
 
-        charge_state = match.span()[1]
+        Z = match.span()[1]
 
         if char == '-':
-            charge_state = -charge_state
+            Z = -Z
 
         argument = argument[0:len(argument)-match.span()[1]]
 
@@ -516,14 +516,14 @@ def _extract_charge_state(argument: str) -> Tuple[str, int]:
             raise InvalidParticleError("Invalid charge state information")
 
     else:
-        charge_state = None
+        Z = None
 
-    if charge_state is not None and charge_state < -3:
+    if Z is not None and Z < -3:
         warnings.warn(f"Element {atomic_symbol(argument)} has a charge of "
-                      f"{charge_state} which is unlikely to occur in nature.",
+                      f"{Z} which is unlikely to occur in nature.",
                       AtomicWarning)
 
-    return argument, charge_state
+    return argument, Z
 
 
 def _is_neutron(argument: Any, mass_numb: int = None) -> bool:
@@ -557,7 +557,7 @@ def _is_hydrogen(argument: Any,
 
     if isinstance(argument, str):
 
-        argument, Z = _extract_charge_state(argument)
+        argument, Z = _extract_integer_charge(argument)
 
         if argument in case_sensitive_aliases:
             is_hydrogen = True
@@ -620,7 +620,7 @@ def _is_proton(arg: Any, Z: int = None, mass_numb: int = None) -> bool:
     False otherwise.  This function returns False for 'H-1' if no
     charge state is given."""
 
-    argument, Z_from_arg = _extract_charge_state(arg)
+    argument, Z_from_arg = _extract_integer_charge(arg)
 
     if (Z is None) == (Z_from_arg is None):
         return False
@@ -649,7 +649,7 @@ def _is_alpha(arg: Any) -> bool:
         raise InvalidParticleError(
             f"{arg} is an invalid representation of an alpha particle")
     else:
-        arg, Z = _extract_charge_state(arg)
+        arg, Z = _extract_integer_charge(arg)
 
         if Z != 2 or arg[-2:] != '-4':
             return False
diff --git a/plasmapy/atomic/nuclear.py b/plasmapy/atomic/nuclear.py
index 8d7c51e6..313c24c4 100644
--- a/plasmapy/atomic/nuclear.py
+++ b/plasmapy/atomic/nuclear.py
@@ -7,7 +7,7 @@
                      isotope_mass,
                      ion_mass,
                      atomic_number,
-                     charge_state)
+                     integer_charge)
 
 from .names import (isotope_symbol,
                     _is_neutron,
@@ -242,7 +242,7 @@ def _total_charge(particles):
             try:
                 total_charge += atomic_number(particle)
             except InvalidElementError:
-                total_charge += charge_state(particle)
+                total_charge += integer_charge(particle)
 
         return total_charge
 
diff --git a/plasmapy/classes/species.py b/plasmapy/classes/species.py
index b1049460..aba2ef8c 100644
--- a/plasmapy/classes/species.py
+++ b/plasmapy/classes/species.py
@@ -63,7 +63,7 @@ def __init__(self, plasma, particle_type='p', n_particles=1, scaling=1,
         if np.isinf(dt) and np.isinf(nt):  # coveralls: ignore
             raise ValueError("Both dt and nt are infinite.")
 
-        self.q = atomic.charge_state(particle_type) * constants.e.si
+        self.q = atomic.integer_charge(particle_type) * constants.e.si
         self.m = atomic.ion_mass(particle_type)
         self.N = int(n_particles)
         self.scaling = scaling
diff --git a/plasmapy/diagnostics/langmuir.py b/plasmapy/diagnostics/langmuir.py
index dcfcf30e..8a53af45 100644
--- a/plasmapy/diagnostics/langmuir.py
+++ b/plasmapy/diagnostics/langmuir.py
@@ -28,12 +28,12 @@ def __init__(self, area=u.m**2, config='single'):
         self.config = config
 
 
-def swept_probe_analysis(potential_sweep, 
-                         measured_current, 
-                         probe, 
+def swept_probe_analysis(potential_sweep,
+                         measured_current,
+                         probe,
                          ion='H',
-                         method='maxwellian', 
-                         smoothing=None, 
+                         method='maxwellian',
+                         smoothing=None,
                          polyorder=3):
     r"""Performs a Langmuir analysis of a given probe V-I profile in order to
     obtain various plasma parameters.
@@ -41,7 +41,8 @@ def swept_probe_analysis(potential_sweep,
     Parameters
     ----------
     potential_sweep : Quantity
-        The swept electric potential applied to the probe in units convertible to V.
+        The swept electric potential applied to the probe in units
+        convertible to V.
 
     measured_current : Quantity
         The corresponding measured current in units convertible to A.
@@ -59,7 +60,7 @@ def swept_probe_analysis(potential_sweep,
     smoothing : string, optional
         The smoothing method applied to the measured current in order to
         obtain clean derivatives. Options are None (default) and 'savgol',
-        which uses scipy.signal.savgol_filter. When `smoothing` is 'savgol', 
+        which uses scipy.signal.savgol_filter. When `smoothing` is 'savgol',
         the polynomial order is given by polyorder.
 
     polyorder : int
@@ -100,7 +101,8 @@ def obtain_EEDF(potential_sweep, measured_current, probe):
     Parameters
     ----------
     potential_sweep : Quantity
-        The swept electric potential applied to the probe in units convertible to V.
+        The swept electric potential applied to the probe in units
+        convertible to V.
 
     measured_current : Quantity
         The corresponding measured current in units convertible to A.
@@ -125,7 +127,8 @@ def obtain_EEPF(potential_sweep, measured_current, probe):
     Parameters
     ----------
     potential_sweep : Quantity
-        The swept electric potential applied to the probe in units convertible to V.
+        The swept electric potential applied to the probe in units
+        convertible to V.
 
     measured_current : Quantity
         The corresponding measured current in units convertible to A.
diff --git a/plasmapy/mathematics/mathematics.py b/plasmapy/mathematics/mathematics.py
index 58c10e5f..f51027f6 100644
--- a/plasmapy/mathematics/mathematics.py
+++ b/plasmapy/mathematics/mathematics.py
@@ -38,7 +38,8 @@ def plasma_dispersion_func(zeta):
     The plasma dispersion function is defined as:
 
     .. math::
-        Z(\zeta) = \pi^{-0.5} \int_{-\infty}^{+\infty} \frac{e^{-x^2}}{x-\zeta} dx
+        Z(\zeta) = \pi^{-0.5} \int_{-\infty}^{+\infty}
+        \frac{e^{-x^2}}{x-\zeta} dx
 
     where the argument is a complex number [fried.conte-1961]_.
 
@@ -116,7 +117,8 @@ def plasma_dispersion_func_deriv(zeta):
     The derivative of the plasma dispersion function is defined as:
 
     .. math::
-        Z'(\zeta) = \pi^{-0.5} \int_{-\infty}^{+\infty} \frac{e^{-x^2}}{(x-\zeta)^2} dx
+        Z'(\zeta) = \pi^{-0.5} \int_{-\infty}^{+\infty}
+        \frac{e^{-x^2}}{(x-\zeta)^2} dx
 
     where the argument is a complex number [fried.conte-1961]_.
 
diff --git a/plasmapy/physics/__init__.py b/plasmapy/physics/__init__.py
index de2f04da..781435dd 100644
--- a/plasmapy/physics/__init__.py
+++ b/plasmapy/physics/__init__.py
@@ -1,9 +1,23 @@
 # 'physics' is a tentative name for this subpackage.  Another
 # possibility is 'plasma'.  The organization is to be decided by v0.1.
 
-from .parameters import Alfven_speed, ion_sound_speed, thermal_speed, kappa_thermal_speed, gyrofrequency, gyroradius, plasma_frequency, Debye_length, Debye_number, inertial_length, magnetic_pressure, magnetic_energy_density, upper_hybrid_frequency, lower_hybrid_frequency
-from .quantum import deBroglie_wavelength, thermal_deBroglie_wavelength, Fermi_energy, Thomas_Fermi_length
+from .dielectric import (
+    cold_plasma_permittivity_LRP, cold_plasma_permittivity_SDP)
+
+from .distribution import (
+    Maxwellian_1D, Maxwellian_velocity_3D, Maxwellian_speed_1D,
+    Maxwellian_speed_3D, kappa_velocity_3D, kappa_velocity_1D)
+
+from .parameters import (
+    Alfven_speed, ion_sound_speed, thermal_speed, kappa_thermal_speed,
+    gyrofrequency, gyroradius, plasma_frequency, Debye_length, Debye_number,
+    inertial_length, magnetic_pressure, magnetic_energy_density,
+    upper_hybrid_frequency, lower_hybrid_frequency)
+
+from .quantum import (
+    deBroglie_wavelength, thermal_deBroglie_wavelength, Fermi_energy,
+    Thomas_Fermi_length)
+
 from .relativity import Lorentz_factor
-from .transport import Coulomb_logarithm, classical_transport
-from .distribution import Maxwellian_1D, Maxwellian_velocity_3D, Maxwellian_speed_1D, Maxwellian_speed_3D, kappa_velocity_3D, kappa_velocity_1D
-from .dielectric import cold_plasma_permittivity_LRP, cold_plasma_permittivity_SDP
+
+from .transport import (Coulomb_logarithm, classical_transport)
diff --git a/plasmapy/physics/distribution.py b/plasmapy/physics/distribution.py
index f0c5fd45..632075e0 100644
--- a/plasmapy/physics/distribution.py
+++ b/plasmapy/physics/distribution.py
@@ -483,7 +483,8 @@ def Maxwellian_speed_3D(vx,
 
     .. math::
 
-       f = 4 \pi \vec{v}^2 (\pi * v_Th^2)^{-3/2} \exp(-(\vec{v} - \vec{V_{drift}})^2 / v_Th^2)
+       f = 4 \pi \vec{v}^2 (\pi * v_Th^2)^{-3/2} \exp(-(\vec{v} -
+       \vec{V_{drift}})^2 / v_Th^2)
 
     where :math:`v_Th = \sqrt(2 k_B T / m)` is the thermal speed.
 
@@ -643,10 +644,12 @@ def kappa_velocity_1D(v,
 
     .. math::
 
-       f = A_\kappa \left(1 + \frac{(\vec{v} - \vec{V_{drift}})^2}{\kappa v_Th,\kappa^2}\right)^{-\kappa}
+       f = A_\kappa \left(1 + \frac{(\vec{v} -
+       \vec{V_{drift}})^2}{\kappa v_Th,\kappa^2}\right)^{-\kappa}
 
     where :math:`v_Th,\kappa` is the kappa thermal speed
-    and :math:`A_\kappa = \frac{1}{\sqrt{\pi} \kappa^{3/2} v_Th,\kappa^2 \frac{\Gamma(\kappa + 1)}{\Gamma(\kappa - 1/2)}}`
+    and :math:`A_\kappa = \frac{1}{\sqrt{\pi} \kappa^{3/2} v_Th,\kappa^2
+    \frac{\Gamma(\kappa + 1)}{\Gamma(\kappa - 1/2)}}`
     is the normalization constant
 
     As kappa approaches infinity, the kappa distribution function converges
@@ -743,8 +746,8 @@ def kappa_velocity_3D(vx,
 
     particle: string, optional
         Representation of the particle species(e.g., 'p' for protons, 'D+'
-        for deuterium, or 'He-4 +1' for :math:`He_4^{+1}` : singly ionized helium-4),
-        which defaults to electrons.
+        for deuterium, or 'He-4 +1' for :math:`He_4^{+1}` : singly ionized
+        helium-4), which defaults to electrons.
 
     Vx_drift: Quantity, optional
         The drift velocity in x-direction units convertible to m/s.
@@ -793,10 +796,13 @@ def kappa_velocity_3D(vx,
 
     .. math::
 
-       f = A_\kappa \left(1 + \frac{(\vec{v} - \vec{V_{drift}})^2}{\kappa v_Th,\kappa^2}\right)^{-(\kappa + 1)}
+       f = A_\kappa \left(1 + \frac{(\vec{v} -
+       \vec{V_{drift}})^2}{\kappa v_Th,\kappa^2}\right)^{-(\kappa + 1)}
 
     where :math:`v_Th,\kappa` is the kappa thermal speed
-    and :math:`A_\kappa = \frac{1}{2 \pi (\kappa v_Th,\kappa^2)^{3/2}} \frac{\Gamma(\kappa + 1)}{\Gamma(\kappa - 1/2) \Gamma(3/2)}` is the normalization constant
+    and :math:`A_\kappa = \frac{1}{2 \pi (\kappa v_Th,\kappa^2)^{3/2}}
+    \frac{\Gamma(\kappa + 1)}{\Gamma(\kappa - 1/2) \Gamma(3/2)}` is the
+    normalization constant.
 
     As kappa approaches infinity, the kappa distribution function converges
     to the Maxwellian distribution function.
diff --git a/plasmapy/physics/parameters.py b/plasmapy/physics/parameters.py
index 955295f7..886606ed 100644
--- a/plasmapy/physics/parameters.py
+++ b/plasmapy/physics/parameters.py
@@ -2,7 +2,7 @@
 
 from astropy import units
 
-# from plasmapy.atomic import ion_mass, charge_state
+# from plasmapy.atomic import ion_mass, integer_charge
 
 import numpy as np
 # import warnings
@@ -13,7 +13,7 @@
 # TODO for future: change these into decorators.  _check_quantity does a
 # bit more than @quantity_input as it can allow
 from plasmapy.utils.checks import _check_quantity
-from plasmapy.utils.exceptions import PhysicsError, AtomicError  # , PhysicsWarning
+from plasmapy.utils.exceptions import (PhysicsError, AtomicError)
 
 
 r"""
@@ -180,7 +180,7 @@ def Alfven_speed(B, density, ion="p", z_mean=None):
                 # warnings.warn("No z_mean given, defaulting to atomic charge",
                 #               PhysicsWarning)
                 try:
-                    Z = atomic.charge_state(ion)
+                    Z = atomic.integer_charge(ion)
                 except AtomicError:
                     Z = 1
             else:
@@ -328,7 +328,7 @@ def ion_sound_speed(*ignore,
             # warnings.warn("No z_mean given, defaulting to atomic charge",
             #               PhysicsWarning)
             try:
-                Z = atomic.charge_state(ion)
+                Z = atomic.integer_charge(ion)
             except AtomicError:
                 Z = 1
         else:
@@ -615,7 +615,7 @@ def collision_rate_electron_ion(T_e,
     else:
         particles = ['e', ion_particle]
         coulomb_log_val = Coulomb_logarithm(T_e, n_e, particles, V)
-    Z_i = atomic.charge_state(ion_particle)
+    Z_i = atomic.integer_charge(ion_particle)
     nu_e = 4 / 3 * np.sqrt(2 * np.pi / m_e) / (4 * np.pi * eps0) ** 2 * \
         e ** 4 * n_e * Z_i * coulomb_log_val / (k_B * T_e) ** 1.5
     return nu_e.to(1 / units.s)
@@ -680,7 +680,7 @@ def collision_rate_ion_ion(T_i, n_i, ion_particle,
     else:
         particles = [ion_particle, ion_particle]
         coulomb_log_val = Coulomb_logarithm(T_i, n_i, particles, V)
-    Z_i = atomic.charge_state(ion_particle)
+    Z_i = atomic.integer_charge(ion_particle)
     m_i = atomic.ion_mass(ion_particle)
     nu_i = 4 / 3 * np.sqrt(np.pi / m_i) / (4 * np.pi * eps0)**2 * e**4 * \
         n_i * Z_i**4 * coulomb_log_val / (k_B * T_i)**1.5
@@ -810,7 +810,7 @@ def gyrofrequency(B, particle='e', signed=False, z_mean=None):
             # warnings.warn("No z_mean given, defaulting to atomic charge",
             #               PhysicsWarning)
             try:
-                Z = atomic.charge_state(particle)
+                Z = atomic.integer_charge(particle)
             except AtomicError:
                 Z = 1
         else:
@@ -1028,7 +1028,7 @@ def plasma_frequency(n, particle='e', z_mean=None):
             # warnings.warn("No z_mean given, defaulting to atomic charge",
             #               PhysicsWarning)
             try:
-                Z = atomic.charge_state(particle)
+                Z = atomic.integer_charge(particle)
             except Exception:
                 Z = 1
         else:
@@ -1239,7 +1239,7 @@ def inertial_length(n, particle='e'):
     """
 
     try:
-        Z = atomic.charge_state(particle)
+        Z = atomic.integer_charge(particle)
     except AtomicError:
         raise ValueError(f"Invalid particle {particle} in inertial_length.")
     if Z:
@@ -1506,7 +1506,7 @@ def lower_hybrid_frequency(B, n_i, ion='p'):
     # We do not need a charge state here, so the sole intent is to
     # catch invalid ions.
     try:
-        atomic.charge_state(ion)
+        atomic.integer_charge(ion)
     except Exception:
         raise ValueError("Invalid ion in lower_hybrid_frequency.")
 
diff --git a/plasmapy/physics/quantum.py b/plasmapy/physics/quantum.py
index 2b69af02..f65b053a 100644
--- a/plasmapy/physics/quantum.py
+++ b/plasmapy/physics/quantum.py
@@ -199,7 +199,8 @@ def Fermi_energy(n_e):
 
     .. math::
 
-       E_F = \frac{\pi^2 \hbar^2}{2 m_{e}} \left( \frac{3 n_{e}}{\pi} \right )^{2/3}
+       E_F = \frac{\pi^2 \hbar^2}{2 m_{e}}
+       \left( \frac{3 n_{e}}{\pi} \right )^{2/3}
 
     This quantity is often used in place of thermal energy for analysis
     of cold, dense plasmas (e.g. warm dense matter, condensed matter).
diff --git a/plasmapy/physics/transport.py b/plasmapy/physics/transport.py
index 0f4c2148..5e9ce5ff 100644
--- a/plasmapy/physics/transport.py
+++ b/plasmapy/physics/transport.py
@@ -8,7 +8,7 @@
 from plasmapy.utils.checks import check_quantity, _check_relativistic
 from plasmapy.utils.exceptions import PhysicsError, PhysicsWarning
 from plasmapy.constants import (m_p, m_e, c, mu0, k_B, e, eps0, pi, h, hbar)
-from ..atomic import (ion_mass, charge_state)
+from ..atomic import (ion_mass, integer_charge)
 from plasmapy.atomic.atomic import _is_electron
 from .parameters import (Debye_length, Hall_parameter,
                          collision_rate_electron_ion, collision_rate_ion_ion)
@@ -137,7 +137,7 @@ def Coulomb_logarithm(T, n_e, particles, V=None):
                              f" in Coulomb_logarithm.")
 
         try:
-            charges[i] = np.abs(e * atomic.charge_state(particles[i]))
+            charges[i] = np.abs(e * atomic.integer_charge(particles[i]))
         except Exception:
             raise ValueError(f"Unable to find charge of particle: "
                              f"{particles[i]} in Coulomb_logarithm.")
@@ -463,7 +463,7 @@ def __init__(self, T_e, n_e, T_i, n_i, ion_particle, m_i=None, Z=None,
             self.m_i = m_i.to(units.kg)
         if Z is None:
             try:
-                self.Z = atomic.charge_state(ion_particle)
+                self.Z = atomic.integer_charge(ion_particle)
             except Exception:
                 raise ValueError(f"Unable to find charge of particle: "
                                  f"{ion_particle} in classical_transport.")
@@ -713,11 +713,13 @@ def all_variables(self) -> dict:
         """
         d = {'resistivity': self.resistivity(),
              'thermoelectric_conductivity': self.thermoelectric_conductivity(),
-             'electron_thermal_conductivity': self.electron_thermal_conductivity(),
+             'electron_thermal_conductivity':
+                 self.electron_thermal_conductivity(),
              'electron_viscosity': self.electron_viscosity()}
         if self.model != "spitzer":
-            d = dict(d, **{'ion_thermal_conductivity': self.ion_thermal_conductivity(),
-                  'ion_viscosity': self.ion_viscosity()})
+            d = dict(d, **{'ion_thermal_conductivity':
+                           self.ion_thermal_conductivity(),
+                           'ion_viscosity': self.ion_viscosity()})
         return d
 
 
@@ -1663,7 +1665,8 @@ def Delta_perp_i2(r, zeta, Delta_par_i2):
 
         def f_eta_2(r, zeta, Delta_perp_i2):
             eta_2_i = ((3 / 5 * np.sqrt(2) + 2 * zeta) * r ** 4 +
-                       (2.680 + 25.98 * zeta + 90.71 * zeta**2 + 104 * zeta**3) * r ** 2 +
+                       (2.680 + 25.98 * zeta + 90.71 * zeta**2 + 104 * zeta**3)
+                       * r ** 2 +
                        0.4483 * eta_0_i * Delta_par_i2 ** 2
                        ) / Delta_perp_i2
             return eta_2_i


Test patch:
diff --git a/plasmapy/atomic/tests/test_atomic.py b/plasmapy/atomic/tests/test_atomic.py
index e99b8054..7ee9a731 100644
--- a/plasmapy/atomic/tests/test_atomic.py
+++ b/plasmapy/atomic/tests/test_atomic.py
@@ -15,7 +15,7 @@
                      _is_alpha,
                      _is_proton,
                      _is_antineutron,
-                     _extract_charge_state)
+                     _extract_integer_charge)
 
 from ..isotopes import _Isotopes
 
@@ -30,7 +30,7 @@
                       common_isotopes,
                       stable_isotopes,
                       isotopic_abundance,
-                      charge_state,
+                      integer_charge,
                       electric_charge)
 
 from ..nuclear import (nuclear_binding_energy, nuclear_reaction_energy)
@@ -824,7 +824,7 @@ def test_atomic_TypeErrors(func, argument):
     stable_isotopes,
     common_isotopes,
     isotopic_abundance,
-    charge_state,
+    integer_charge,
     electric_charge,
 ]
 
@@ -952,7 +952,7 @@ def test_isotopic_abundances_sum(element, isotopes):
 
 
 # (argument, expected)
-charge_state_table = [
+integer_charge_table = [
     ('H+', 1),
     ('D +1', 1),
     ('tritium 1+', 1),
@@ -976,16 +976,16 @@ def test_isotopic_abundances_sum(element, isotopes):
 ]
 
 
-@pytest.mark.parametrize("argument, expected", charge_state_table)
-def test_charge_state(argument, expected):
-    """Test that charge_state returns the expected results."""
-    assert charge_state(argument) == expected, \
-        (f"charge_state({argument}) is returning {charge_state(argument)} "
-         f"which differs from the expected result of {expected}.")
+@pytest.mark.parametrize("argument, expected", integer_charge_table)
+def test_integer_charge(argument, expected):
+    """Test that integer_charge returns the expected results."""
+    assert integer_charge(argument) == expected, \
+        (f"integer_charge({argument}) is returning {integer_charge(argument)}"
+         f" which differs from the expected result of {expected}.")
 
 
 # (argument, expected_error)
-charge_state_error_table = [
+integer_charge_error_table = [
     ('fads', InvalidParticleError),
     ('H++', InvalidParticleError),
     ('h+', InvalidParticleError),
@@ -996,28 +996,29 @@ def test_charge_state(argument, expected):
 ]
 
 
-@pytest.mark.parametrize("argument, expected_error", charge_state_error_table)
-def test_charge_state_error(argument, expected_error):
-    """Test that charge_state raises the expected exceptions."""
+@pytest.mark.parametrize("argument, expected_error",
+                         integer_charge_error_table)
+def test_integer_charge_error(argument, expected_error):
+    """Test that integer_charge raises the expected exceptions."""
     with pytest.raises(expected_error, message=(
-            f"charge_state({argument} is not raising a {expected_error}.")):
-        charge_state(argument)
+            f"integer_charge({argument} is not raising a {expected_error}.")):
+        integer_charge(argument)
 
 
 # (argument, expected_warning)
-charge_state_warning_table = [
+integer_charge_warning_table = [
     ('H---', AtomicWarning),
     ('Fe -26', AtomicWarning),
     ('Og 10-', AtomicWarning)]
 
 
 @pytest.mark.parametrize("argument, expected_warning",
-                         charge_state_warning_table)
-def test_charge_state_warnings(argument, expected_warning):
-    """Test that charge_state issues appropriate warnings."""
+                         integer_charge_warning_table)
+def test_integer_charge_warnings(argument, expected_warning):
+    """Test that integer_charge issues appropriate warnings."""
     with pytest.warns(expected_warning, message=(
-            f"charge_state({argument}) is not issuing a {expected_warning}")):
-        charge_state(argument)
+            f"integer_charge({argument}) is not issuing {expected_warning}")):
+        integer_charge(argument)
 
 
 def test_electric_charge():
@@ -1254,14 +1255,14 @@ def test_is_alpha(test_input, expected):
                           ('N-7+++', 'N-7', 3),
                           ('H-1-', 'H-1', -1),
                           ('He-4-', 'He-4', -1)])
-def test_extract_charge_state(test_input, expected_newarg, expected_Z):
-    """Test that _extract_charge_state returns the expected values."""
-    new_symbol, new_Z = _extract_charge_state(test_input)
+def test_extract_integer_charge(test_input, expected_newarg, expected_Z):
+    """Test that _extract_integer_charge returns the expected values."""
+    new_symbol, new_Z = _extract_integer_charge(test_input)
     assert new_symbol == expected_newarg, \
-        (f"_extract_charge_state should return {expected_newarg} as "
+        (f"_extract_integer_charge should return {expected_newarg} as "
          f" its first argument, but is instead returning {new_symbol}")
     assert new_Z == expected_Z, \
-        (f"_extract_charge_state should return {expected_Z} as its second"
+        (f"_extract_integer_charge should return {expected_Z} as its second"
          f"argument, but is instead returning {new_Z}.")
 
 
@@ -1269,17 +1270,17 @@ def test_extract_charge_state(test_input, expected_newarg, expected_Z):
                          [('H-1-+-+', InvalidParticleError),
                           ('H ++', InvalidParticleError),
                           ('Fe +21+', InvalidParticleError)])
-def test_extract_charge_state_errors(test_input, expected_error):
-    """Test that _extract_charge_state raises the expected exceptions."""
+def test_extract_integer_charge_errors(test_input, expected_error):
+    """Test that _extract_integer_charge raises the expected exceptions."""
     with pytest.raises(expected_error):
-        _extract_charge_state(test_input)
+        _extract_integer_charge(test_input)
 
 
 @pytest.mark.parametrize("test_input,expected_warning",
                          [('H-1----', AtomicWarning),
                           ('Fe -4', AtomicWarning),
                           ('lead 4-', AtomicWarning)])
-def test_extract_charge_state_warnings(test_input, expected_warning):
-    """Test that _extract_charge_state issues the expected warnings."""
+def test_extract_integer_charge_warnings(test_input, expected_warning):
+    """Test that _extract_integer_charge issues the expected warnings."""
     with pytest.warns(expected_warning):
-        _extract_charge_state(test_input)
+        _extract_integer_charge(test_input)
diff --git a/plasmapy/diagnostics/tests/test_langmuir.py b/plasmapy/diagnostics/tests/test_langmuir.py
index 0ff8881e..ad960d48 100644
--- a/plasmapy/diagnostics/tests/test_langmuir.py
+++ b/plasmapy/diagnostics/tests/test_langmuir.py
@@ -3,8 +3,9 @@
 import numpy as np
 
 from plasmapy.diagnostics.langmuir import (swept_probe_analysis,
-                               obtain_EEDF,
-                               obtain_EEPF)
+                                           obtain_EEDF,
+                                           obtain_EEPF)
+
 
 class Test_swept_probe_analysis():
     def test_no_signal(self):
@@ -16,6 +17,7 @@ def test_no_signal(self):
                   "when zero signal is passed, but doesn't.")
         assert True, errStr
 
+
 class Test_obtain_EEDF():
     def test_no_signal(self):
         """
@@ -26,6 +28,7 @@ def test_no_signal(self):
                   "zero signal is passed, but doesn't.")
         assert True, errStr
 
+
 class Test_obtain_EEPF():
     def test_no_signal(self):
         """
diff --git a/plasmapy/physics/tests/test_dielectric.py b/plasmapy/physics/tests/test_dielectric.py
index f1e0f512..623650df 100644
--- a/plasmapy/physics/tests/test_dielectric.py
+++ b/plasmapy/physics/tests/test_dielectric.py
@@ -21,7 +21,7 @@
 class Test_ColdPlasmaPermittivity(object):
     def test_proton_electron_plasma(self):
         """
-        Test proton-electron plasma against the (approximate) 
+        Test proton-electron plasma against the (approximate)
         analytical formulas
         """
         B = 1*u.T
diff --git a/plasmapy/physics/tests/test_distribution.py b/plasmapy/physics/tests/test_distribution.py
index b63d1358..6073ae43 100644
--- a/plasmapy/physics/tests/test_distribution.py
+++ b/plasmapy/physics/tests/test_distribution.py
@@ -96,9 +96,9 @@ def test_std(self):
         """
         Tests standard deviation of function?
         """
-        std = (Maxwellian_1D(self.v_vect,
-                             T=self.T_e,
-                             particle=self.particle) * self.v_vect**2 * self.dv).sum()
+        std = (Maxwellian_1D(
+            self.v_vect, T=self.T_e, particle=self.particle) *
+               self.v_vect**2 * self.dv).sum()
         std = np.sqrt(std)
         T_distri = (std**2 / k_B * m_e).to(u.K)
         assert np.isclose(T_distri.value, self.T_e.value)
@@ -698,7 +698,7 @@ def test_value_drift_units(self):
                           atol=0.0), errStr
 
 
-#%% kappa
+# kappa
 
 # test class for kappa_velocity_1D function:
 class Test_kappa_velocity_1D(object):
@@ -722,6 +722,7 @@ def setup_method(self):
                                        kappa=self.kappa,
                                        particle=self.particle)
         self.distFuncTrue = 6.637935187755855e-07
+
     def test_invalid_kappa(self):
         """
         Checks if function raises error when kappa <= 3/2 is passed as an
@@ -729,10 +730,11 @@ def test_invalid_kappa(self):
         """
         with pytest.raises(ValueError):
             kappa_velocity_1D(v=self.v,
-                                     T=self.T_e,
-                                     kappa=self.kappaInvalid,
-                                     particle=self.particle,
-                                     units="units")
+                              T=self.T_e,
+                              kappa=self.kappaInvalid,
+                              particle=self.particle,
+                              units="units")
+
     def test_max_noDrift(self):
         """
         Checks maximum value of distribution function is in expected place,
@@ -799,10 +801,9 @@ def test_std(self):
         """
         Tests standard deviation of function?
         """
-        std = (kappa_velocity_1D(self.v_vect,
-                                 T=self.T_e,
-                                 kappa=self.kappa,
-                                 particle=self.particle) * self.v_vect**2 * self.dv).sum()
+        std = (kappa_velocity_1D(
+            self.v_vect, T=self.T_e, kappa=self.kappa,
+            particle=self.particle) * self.v_vect**2 * self.dv).sum()
         std = np.sqrt(std)
         T_distri = (std**2 / k_B * m_e).to(u.K)
         assert np.isclose(T_distri.value, self.T_e.value)
@@ -949,6 +950,7 @@ def setup_method(self):
         self.Vy_drift2 = 1e5 * u.m / u.s
         self.Vz_drift2 = 1e5 * u.m / u.s
         self.distFuncTrue = 1.1847914288918793e-22
+
     def test_invalid_kappa(self):
         """
         Checks if function raises error when kappa <= 3/2 is passed as an
@@ -956,12 +958,13 @@ def test_invalid_kappa(self):
         """
         with pytest.raises(ValueError):
             kappa_velocity_3D(vx=self.vx,
-                                     vy=self.vy,
-                                     vz=self.vz,
-                                     T=self.T,
-                                     kappa=self.kappaInvalid,
-                                     particle=self.particle,
-                                     units="units")
+                              vy=self.vy,
+                              vz=self.vz,
+                              T=self.T,
+                              kappa=self.kappaInvalid,
+                              particle=self.particle,
+                              units="units")
+
 #    def test_maxwellian_limit(self):
 #        """
 #        Tests the limit of large kappa to see if kappa distribution function
@@ -996,6 +999,7 @@ def test_invalid_kappa(self):
 #                          atol=0.0), errStr
 #
 #        return
+
     def test_norm(self):
         """
         Tests whether distribution function is normalized, and integrates to 1.
diff --git a/plasmapy/physics/tests/test_parameters.py b/plasmapy/physics/tests/test_parameters.py
index 2b7c4900..291f7c64 100644
--- a/plasmapy/physics/tests/test_parameters.py
+++ b/plasmapy/physics/tests/test_parameters.py
@@ -158,9 +158,9 @@ def test_ion_sound_speed():
                                       ion='p', gamma_e=1, gamma_i=3).value,
                       218816.06086407552)
 
-    assert np.isclose(ion_sound_speed(T_i=0.88 * u.MK, T_e=1.28 * u.MK, ion='p',
-                                      gamma_e=1.2, gamma_i=3.4).value,
-                      193328.52857788358)
+    assert np.isclose(ion_sound_speed(
+        T_i=0.88 * u.MK, T_e=1.28 * u.MK, ion='p', gamma_e=1.2,
+        gamma_i=3.4).value, 193328.52857788358)
 
     # case when Z=1 is assumed
     assert ion_sound_speed(T_i=T_i, T_e=T_e, ion='p') == \
diff --git a/plasmapy/physics/tests/test_transport.py b/plasmapy/physics/tests/test_transport.py
index c1299c78..c4ee7461 100644
--- a/plasmapy/physics/tests/test_transport.py
+++ b/plasmapy/physics/tests/test_transport.py
@@ -5,7 +5,7 @@
 import numpy as np
 import pytest
 from astropy import units as u
-from plasmapy.atomic.atomic import ion_mass, charge_state
+from plasmapy.atomic.atomic import ion_mass, integer_charge
 from plasmapy.utils.exceptions import (PhysicsError, PhysicsWarning,
                                        RelativityWarning, RelativityError)
 from plasmapy.physics.parameters import Hall_parameter
@@ -104,7 +104,7 @@ def setup_method(self):
         self.n_e = 2e13 / u.cm ** 3
         self.ion_particle = 'D +1'
         self.m_i = ion_mass(self.ion_particle)
-        self.Z = charge_state(self.ion_particle)
+        self.Z = integer_charge(self.ion_particle)
         self.T_i = self.T_e
         self.n_i = self.n_e / self.Z
         self.B = 0.01 * u.T
@@ -427,7 +427,7 @@ def test_ion_thermal_conductivity_by_model(self, model, expected):
         assert np.allclose(ct2.ion_thermal_conductivity(), expected,
                            atol=1e-6 * u.W / (u.K * u.m))
 
-    @pytest.mark.parametrize("key, expected",{
+    @pytest.mark.parametrize("key, expected", {
         'resistivity': [2.84304305e-08,
                         5.54447070e-08,
                         1.67853407e-12],
@@ -436,7 +436,7 @@ def test_ion_thermal_conductivity_by_model(self, model, expected):
                                         2.66496639e-05],
         'electron_thermal_conductivity': [4.91374931e+06,
                                           2.28808496e-03,
-                                          6.90324259e+01] ,
+                                          6.90324259e+01],
         'electron_viscosity': [7.51661800e-02,
                                5.23617668e-21,
                                2.09447067e-20,
@@ -444,12 +444,12 @@ def test_ion_thermal_conductivity_by_model(self, model, expected):
                                3.23682681e-11],
         'ion_thermal_conductivity': [1.41709276e+05,
                                      4.20329493e-02,
-                                     6.90323924e+01] ,
+                                     6.90323924e+01],
         'ion_viscosity': [8.43463595e+00,
                           8.84513731e-13,
                           3.53805159e-12,
                           2.54483240e-06,
-                          5.08966116e-06] }.items())
+                          5.08966116e-06]}.items())
     def test_dictionary(self, key, expected):
         calculated = self.all_variables[key]
         assert np.allclose(expected, calculated.si.value)