Repository: PlasmaPy/PlasmaPy
Pull request #502 (2018-06-18 16:11:57)

Move coveragerc to default location
It looks like `coverage` isn't reading our [coveragerc](https://github.com/PlasmaPy/PlasmaPy/blob/27bfbed4c5d70395c0656051bfa1ac1a49ee2288/plasmapy/tests/coveragerc). This is a weird workaround that seems to work.

I moved `PlasmaPy/plasmapy/tests/coveragerc` to `PlasmaPy/.coveragerc` (default location expected by `coverage`) and created an empty file `PlasmaPy/plasmapy/tests/coveragerc` (without this empty file, there was an error complaining https://github.com/PlasmaPy/PlasmaPy/pull/496#issuecomment-396878676) and looks like it works.

Also see #495, #496, #497.


Patch:
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 00000000..5cf049e8
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,15 @@
+[report]
+omit =
+    ci-helpers/*
+    */tests/*
+    astropy_helpers/*
+    ah_bootstrap.py
+    plasmapy/setup_package.py
+    plasmapy/version.py
+exclude_lines =
+    coveralls: ignore
+    def __repr__
+    NotImplementedError
+    ImportError
+    ModuleNotFoundError
+    SyntaxError
diff --git a/plasmapy/classes/plasma_base.py b/plasmapy/classes/plasma_base.py
index ddcd3ea8..dcb65b41 100644
--- a/plasmapy/classes/plasma_base.py
+++ b/plasmapy/classes/plasma_base.py
@@ -34,23 +34,23 @@ def __init_subclass__(cls, **kwargs):
 
     @abstractproperty
     def electron_temperature(self):
-        raise NotImplementedError
+        pass
 
     @abstractproperty
     def ion_temperature(self):
-        raise NotImplementedError
+        pass
 
     @abstractproperty
     def electron_density(self):
-        raise NotImplementedError
+        pass
 
     @abstractproperty
     def ion_density(self):
-        raise NotImplementedError
+        pass
 
     @abstractproperty
     def average_ionization(self):
-        raise NotImplementedError
+        pass
 
 
 class GenericPlasma(BasePlasma):
@@ -65,16 +65,16 @@ def __init__(self, **kwargs):
     # goes here.
 
     def electron_temperature(self):
-        raise NotImplementedError
+        pass
 
     def ion_temperature(self):
-        raise NotImplementedError
+        pass
 
     def electron_density(self):
-        raise NotImplementedError
+        pass
 
     def ion_density(self):
-        raise NotImplementedError
+        pass
 
     def average_ionization(self):
-        raise NotImplementedError
+        pass
diff --git a/plasmapy/diagnostics/langmuir.py b/plasmapy/diagnostics/langmuir.py
index 29db6514..93045695 100644
--- a/plasmapy/diagnostics/langmuir.py
+++ b/plasmapy/diagnostics/langmuir.py
@@ -378,7 +378,7 @@ def swept_probe_analysis(probe_characteristic, probe_area, gas,
 
     # Obtain and show the EEDF. This is only useful if the characteristic data
     # has been preprocessed to be sufficiently smooth and noiseless.
-    if plot_EEDF:  # coveralls: ignore
+    if plot_EEDF:
         get_EEDF(probe_characteristic, visualize=True)
 
     # Compile the results dictionary
diff --git a/plasmapy/physics/parameters.py b/plasmapy/physics/parameters.py
index f4b66aeb..24ff421f 100644
--- a/plasmapy/physics/parameters.py
+++ b/plasmapy/physics/parameters.py
@@ -29,6 +29,7 @@
 
 import numpy as np
 # import warnings
+import inspect
 from plasmapy.constants import (m_p, m_e, c, mu0, k_B, e, eps0, pi)
 from plasmapy import atomic, utils
 
diff --git a/plasmapy/physics/transport/collisions.py b/plasmapy/physics/transport/collisions.py
index eb6d262e..55191061 100644
--- a/plasmapy/physics/transport/collisions.py
+++ b/plasmapy/physics/transport/collisions.py
@@ -318,7 +318,7 @@ def _replaceNanVwithThermalV(V, T, m):
     Handles vector checks for V, you must already know that T and m are okay.
     """
     if np.any(V == 0):
-        raise utils.PhysicsError("You cannot have a collision for zero velocity!")
+        raise utils.exceptions.PhysicsError("You cannot have a collision for zero velocity!")
     # getting thermal velocity of system if no velocity is given
     if V is None:
         V = parameters.thermal_speed(T, mass=m)
@@ -754,7 +754,6 @@ def collision_frequency(T,
         bPerp = impact_parameter_perp(T=T,
                                       particles=particles,
                                       V=V_reduced)
-        print(T, n, particles, z_mean, method)
         # Coulomb logarithm
         cou_log = Coulomb_logarithm(T,
                                     n,
@@ -959,8 +958,9 @@ def fundamental_electron_collision_freq(T_e,
                              )
     coeff = 4 / np.sqrt(np.pi) / 3
 
+
     # accounting for when a Coulomb logarithm value is passed
-    if np.any(coulomb_log):
+    if coulomb_log:
         cLog = Coulomb_logarithm(T_e,
                                  n_e,
                                  particles,
@@ -974,7 +974,6 @@ def fundamental_electron_collision_freq(T_e,
         nu_e = coeff * nu_mod
     else:
         nu_e = coeff * nu
-
     return nu_e.to(1 / u.s)
 
 
@@ -1099,7 +1098,7 @@ def fundamental_ion_collision_freq(T_i,
     coeff = np.sqrt(8 / np.pi) / 3 / 4
 
     # accounting for when a Coulomb logarithm value is passed
-    if np.any(coulomb_log):
+    if coulomb_log:
         cLog = Coulomb_logarithm(T_i,
                                  n_i,
                                  particles,
@@ -1784,7 +1783,7 @@ def coupling_parameter(T,
         fermiIntegral = Fermi_integral(chemicalPotential.si.value, 1.5)
         denom = (n_e * lambda_deBroglie ** 3) * fermiIntegral
         kineticEnergy = 2 * k_B * T / denom
-        if np.all(np.imag(kineticEnergy) == 0):
+        if np.imag(kineticEnergy) == 0:
             kineticEnergy = np.real(kineticEnergy)
         else:
             raise ValueError("Kinetic energy should not be imaginary."
diff --git a/plasmapy/utils/__init__.py b/plasmapy/utils/__init__.py
index 0974f11a..1120bfee 100644
--- a/plasmapy/utils/__init__.py
+++ b/plasmapy/utils/__init__.py
@@ -31,5 +31,4 @@
     IncorrectResultError,
     MissingExceptionError,
     MissingWarningError,
-    assert_can_handle_nparray,
 )


Test patch:
diff --git a/plasmapy/diagnostics/tests/test_langmuir.py b/plasmapy/diagnostics/tests/test_langmuir.py
index df4acec0..814c0405 100644
--- a/plasmapy/diagnostics/tests/test_langmuir.py
+++ b/plasmapy/diagnostics/tests/test_langmuir.py
@@ -6,7 +6,8 @@
 import pytest
 import plasmapy.constants as const
 
-from plasmapy.diagnostics import langmuir
+from plasmapy.diagnostics.langmuir import (Characteristic,
+                                           swept_probe_analysis)
 
 np.random.seed(42)
 N = 30  # array length of dummy probe characteristic
@@ -15,60 +16,9 @@
 bias_arr = np.random.rand(N) * u.V
 
 
-class Test__fitting_functions:
-    r"Tests the different available fit functions"
-
-    x = 20
-    x0 = 10
-    y0 = 5
-    c0 = 2
-    T0 = 3
-    Delta_T = 15
-
-    def test_fit_func_lin(self):
-        r"""Test linear fitting function"""
-
-        value = langmuir._fit_func_lin(self.x, self.x0, self.y0, self.c0)
-        expect_value = 25
-
-        errStr = (f"Linear fitting function did not return the expected"
-                  f"value {expect_value} and instead returned {value}")
-        assert value == expect_value, errStr
-
-    def test_fit_func_lin_inverse(self):
-        r"""Test linear fitting function with inverse slope"""
-
-        value = langmuir._fit_func_lin_inverse(self.x, self.x0, self.y0, self.T0)
-        expect_value = 8.33333
-
-        errStr = (f"Linear fitting function with inverse slope did not return"
-                  f"the expected value {expect_value} and instead returned"
-                  f"{value}")
-        assert np.allclose(value, expect_value), errStr
-
-    def test_fit_func_double_lin_inverse(self):
-        r"""Test double linear fitting function with inverse slope and an offset
-            for use in fitting a bi-Maxwellian electron current growth region"""
-
-        value = langmuir._fit_func_double_lin_inverse(self.x, self.x0, self.y0,
-                                                      self.T0, self.Delta_T)
-        expect_value = 8
-
-        errStr = (f"Linear fitting function with inverse slope and an offset for"
-                  f"use in fitting a bi-Maxwellian electron current growth"
-                  f"region did not return the expected value {expect_value} and"
-                  f"instead returned {value}")
-        assert value == expect_value, errStr
-
-
 class Test__characteristic_errors:
     r"""Test the Characteristic class constructor in langmuir.py"""
 
-    bias_2darr = np.array((np.random.rand(N),
-                           np.random.rand(N))) * u.V
-    current_2darr = np.array((np.random.rand(N),
-                              np.random.rand(N))) * u.A
-
     bias_infarr = np.append(np.random.rand(N - 1), np.inf) * u.V
     current_infarr = np.append(np.random.rand(N - 1), np.inf) * u.A
 
@@ -77,41 +27,35 @@ class Test__characteristic_errors:
 
     current_arr2 = np.random.rand(N) * u.A
 
-    def test_invalid_dimensions(self):
-        r"""Test 2D arrays work with Characteristic class"""
-
-        # `Characteristic.get_unique_bias` runs during initialization
-        # which prevents an exception from being raised..
-        langmuir.Characteristic(self.bias_2darr, self.current_2darr)
-
     def test_infinite_I(self):
         r"""Test error upon an infinite current value"""
 
         with pytest.raises(ValueError):
-            langmuir.Characteristic(bias_arr, self.current_infarr)
+            Characteristic(bias_arr, self.current_infarr)
 
     def test_infinite_U(self):
         r"""Test error upon an infinite bias value"""
 
         with pytest.raises(ValueError):
-            langmuir.Characteristic(self.bias_infarr, current_arr)
+            Characteristic(self.bias_infarr, current_arr)
 
     def test_unequal_arrays(self):
         r"""Test errors upon unequal array lengths"""
 
         with pytest.raises(ValueError):
-            langmuir.Characteristic(self.bias_longarr, current_arr)
+            Characteristic(self.bias_longarr, current_arr)
 
         with pytest.raises(ValueError):
-            langmuir.Characteristic(bias_arr, self.current_longarr)
+            Characteristic(bias_arr, self.current_longarr)
 
     def test_addition(self):
         r"""Test addition of characteristic objects"""
 
-        a = langmuir.Characteristic(bias_arr, current_arr)
-        b = langmuir.Characteristic(bias_arr, self.current_arr2)
+        a = Characteristic(bias_arr, current_arr)
+
+        b = Characteristic(bias_arr, self.current_arr2)
 
-        ab_sum = a + b
+        ab_sum = Characteristic(bias_arr, current_arr + self.current_arr2)
 
         errStr = (f"Addition of characteristic objects is not behaving as it "
                   f"should.")
@@ -120,10 +64,11 @@ def test_addition(self):
     def test_subtraction(self):
         r"""Test addition of characteristic objects"""
 
-        a = langmuir.Characteristic(bias_arr, current_arr)
-        b = langmuir.Characteristic(bias_arr, self.current_arr2)
+        a = Characteristic(bias_arr, current_arr)
 
-        ab_sub = a - b
+        b = Characteristic(bias_arr, self.current_arr2)
+
+        ab_sub = Characteristic(bias_arr, current_arr - self.current_arr2)
 
         errStr = (f"Subtraction of characteristic objects is not behaving as "
                   f"it should.")
@@ -133,8 +78,7 @@ def test_subtraction(self):
 @pytest.fixture
 def characteristic():
     r""""Create a dummy characteristic with random values"""
-
-    return langmuir.Characteristic(bias_arr, current_arr)
+    return Characteristic(bias_arr, current_arr)
 
 
 @pytest.fixture
@@ -162,7 +106,7 @@ def characteristic_simulated():
     current_simarr[current_simarr < I_es_sim] += (
         bias_simarr[current_simarr < I_es_sim] * 1e-4 * u.A/u.V)
 
-    return langmuir.Characteristic(bias_simarr, current_simarr)
+    return Characteristic(bias_simarr, current_simarr)
 
 
 @pytest.fixture
@@ -173,82 +117,7 @@ def shuffle_characteristic(characteristic):
                       key=lambda k: np.random.random())
     U_shuffled = characteristic.bias[_shuffle]
     I_shuffled = characteristic.current[_shuffle]
-    return langmuir.Characteristic(U_shuffled, I_shuffled)
-
-
-class DryCharacteristic(langmuir.Characteristic):
-    r"""Overrides the constructor in Characteristic class"""
-
-    def __init__(self, bias, current):
-        self.bias = bias
-        self.current = current
-
-
-class Test__Characteristic_inherited_methods:
-    r"""Test methods on DryCharacteristic class."""
-
-    bias_2darr = np.array((np.random.rand(N),
-                           np.random.rand(N))) * u.V
-    current_2darr = np.array((np.random.rand(N),
-                              np.random.rand(N))) * u.A
-
-    bias_4length_arr = np.array(np.random.rand(N-1)) * u.V
-    current_5length_arr = np.array(np.random.rand(N)) * u.A
-
-    bias_duplicates_arr = np.array((1, 2) * int(N/2))
-
-    def test_invalid_bias_dimensions(self):
-        r"""Test error on non-1D bias array"""
-
-        with pytest.raises(ValueError):
-            char = DryCharacteristic(self.bias_2darr,
-                                     current_arr)
-            char.check_validity()
-
-    def test_invalid_current_dimensions(self):
-        r"""Test error on non-1d current array"""
-
-        with pytest.raises(ValueError):
-            char = DryCharacteristic(bias_arr,
-                                     self.current_2darr)
-            char.check_validity()
-
-    def test_bias_and_current_length_mismatch(self):
-        r"""Test error on non-1d bias and current arrays"""
-
-        with pytest.raises(ValueError):
-            char = DryCharacteristic(self.bias_4length_arr,
-                                     self.current_5length_arr)
-            char.check_validity()
-
-    def test_duplicate_bias_values(self):
-        r"""Test error on bias array containig duplicate values"""
-
-        with pytest.raises(ValueError):
-            char = DryCharacteristic(self.bias_duplicates_arr,
-                                     current_arr)
-            char.check_validity()
-
-    @staticmethod
-    def test_inplace_unique_bias():
-        r"""Test new Characteristic instance being returned"""
-
-        char = DryCharacteristic(bias_arr, current_arr)
-        new_char = char.get_unique_bias(inplace=False)
-        assert char != new_char
-        assert isinstance(new_char, langmuir.Characteristic)
-
-    @staticmethod
-    def test_getpadded_limit():
-        r"""Test padding limit on Characteristic instance"""
-
-        char = characteristic()
-        limits = char.get_padded_limit(0.1)
-        log_limits = char.get_padded_limit(0.1, log=True)
-        assert np.allclose(limits.to(u.A).value,
-                           np.array((-0.07434804, 1.06484239)))
-        assert np.allclose(log_limits.to(u.A).value,
-                           np.array((0.014003, 1.42577333)))
+    return Characteristic(U_shuffled, I_shuffled)
 
 
 class Test__swept_probe_analysis:
@@ -259,21 +128,21 @@ def test_nan_area():
         r"""Test error upon NaN area"""
 
         with pytest.raises(ValueError):
-            langmuir.swept_probe_analysis(characteristic, np.nan * u.cm**2, 40 * u.u)
+            swept_probe_analysis(characteristic, np.nan * u.cm**2, 40 * u.u)
 
     @staticmethod
     def test_unit_conversion_error():
         r"""Test error upon incorrect probe area unit"""
 
         with pytest.raises(u.UnitConversionError):
-            langmuir.swept_probe_analysis(characteristic, 1 * u.cm, 40 * u.u)
+            swept_probe_analysis(characteristic, 1 * u.cm, 40 * u.u)
 
     @staticmethod
     def test_negative_area():
         r"""Test error upon negative probe area"""
 
         with pytest.raises(ValueError):
-            langmuir.swept_probe_analysis(characteristic, -1 * u.cm**2, 40 * u.u)
+            swept_probe_analysis(characteristic, -1 * u.cm**2, 40 * u.u)
 
     @staticmethod
     def test_ion_mass_unit():
@@ -281,10 +150,10 @@ def test_ion_mass_unit():
 
         sim = characteristic_simulated()
 
-        sim_result1 = langmuir.swept_probe_analysis(
+        sim_result1 = swept_probe_analysis(
             sim, 1 * u.cm**2, 40)
 
-        sim_result2 = langmuir.swept_probe_analysis(
+        sim_result2 = swept_probe_analysis(
             sim, 1 * u.cm**2, 40 * u.u)
 
         errStr = (f"`swept_probe_analysis` should accept both floats and "
@@ -299,13 +168,13 @@ def test_ordering_invariance(bimaxwellian):
 
         sim = characteristic_simulated()
 
-        sim_result = langmuir.swept_probe_analysis(
+        sim_result = swept_probe_analysis(
             sim,
             1 * u.cm**2,
             40 * u.u,
             bimaxwellian=bimaxwellian)
 
-        sim_result_shuffled = langmuir.swept_probe_analysis(
+        sim_result_shuffled = swept_probe_analysis(
             shuffle_characteristic(sim),
             1 * u.cm**2,
             40 * u.u,
@@ -315,34 +184,3 @@ def test_ordering_invariance(bimaxwellian):
                   f"input data.")
         for key in sim_result:
             assert (sim_result[key] == sim_result_shuffled[key]).all(), errStr
-
-
-def test_get_floating_potential_with_return_arg():
-    r"""Test floating potential and the return argument"""
-
-    char = characteristic()
-    potential, arg = langmuir.get_floating_potential(char, return_arg=True)
-    assert np.allclose((potential.to(u.V).value, arg), (0.12203823, 5))
-
-
-def test_get_ion_density_OML_without_return_fit():
-    r"""Test ion density without returning the fit value"""
-
-    char = characteristic()
-    density = langmuir.get_ion_density_OML(char, 5000000*u.m**2,
-                                           1*u.u, return_fit=False)
-    assert np.isclose(density.value, 383949768.0764418)
-
-
-def test_get_EEDF():
-    """Test the obtained EEDF"""
-
-    char = langmuir.Characteristic(bias_arr[:17],
-                                   current_arr[:17])
-    energy, probability = langmuir.get_EEDF(char, visualize=False)
-
-    expect_energy = (0.14118696, 0.05293109, 0.00709731)
-    expect_probability = (8.64838751, 8.05295503, 3.42348436)
-
-    assert np.allclose(energy.to(u.eV).value, np.array(expect_energy))
-    assert np.allclose(probability, np.array(expect_probability))
diff --git a/plasmapy/physics/tests/test_parameters.py b/plasmapy/physics/tests/test_parameters.py
index 65452c56..b9974119 100644
--- a/plasmapy/physics/tests/test_parameters.py
+++ b/plasmapy/physics/tests/test_parameters.py
@@ -8,7 +8,6 @@
 
 from plasmapy.utils.exceptions import RelativityWarning, RelativityError
 from plasmapy.utils.exceptions import PhysicsError, InvalidParticleError
-from plasmapy.utils.pytest_helpers import assert_can_handle_nparray
 from astropy.constants import c, m_p, m_e, e, mu0
 
 from plasmapy.physics.parameters import (mass_density,
@@ -61,20 +60,13 @@
 
 
 class Test_mass_density:
-    r"""Test the mass_density function in parameters.py."""
-
     def test_particleless(self):
         with pytest.raises(ValueError):
             mass_density(1 * u.m ** -3)
-
     def test_wrong_units(self):
         with pytest.raises(ValueError):
             mass_density(1 * u.J)
 
-    def test_handle_nparrays(self):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(mass_density)
-
 
 # Assertions below that are in CGS units with 2-3 significant digits
 # are generally from the NRL Plasma Formulary.
@@ -182,8 +174,6 @@ def test_Alfven_speed():
                       atol=0.0,
                       rtol=1e-15), errStr
 
-    assert_can_handle_nparray(Alfven_speed)
-
 
 def test_ion_sound_speed():
     r"""Test the ion_sound_speed function in parameters.py."""
@@ -272,7 +262,9 @@ def test_ion_sound_speed():
                       atol=0.0,
                       rtol=1e-15), errStr
 
-    assert_can_handle_nparray(ion_sound_speed)
+
+def test_thermal_pressure():
+    assert thermal_pressure(T_e, n_i).unit.is_equivalent(u.Pa)
 
 
 def test_thermal_speed():
@@ -341,15 +333,6 @@ def test_thermal_speed():
     with pytest.raises(ValueError):
         thermal_speed(T_i, method="sadks")
 
-    assert_can_handle_nparray(thermal_speed)
-
-
-def test_thermal_pressure():
-    assert thermal_pressure(T_e, n_i).unit.is_equivalent(u.Pa)
-
-    # TODO: may be array issues with arg "mass"
-    assert_can_handle_nparray(thermal_pressure)
-
 
 # test class for kappa_thermal_speed() function:
 
@@ -437,10 +420,6 @@ def test_mean1(self):
                           atol=0.0), errStr
         return
 
-    def test_handle_nparrays(self, kwargs={"kappa": 2}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(kappa_thermal_speed, kwargs=kwargs)
-
 
 def test_gyrofrequency():
     r"""Test the gyrofrequency function in parameters.py."""
@@ -518,10 +497,6 @@ def test_gyrofrequency():
                       atol=0.0,
                       rtol=1e-15), errStr
 
-    assert_can_handle_nparray(gyrofrequency, kwargs={"signed": True})
-
-    assert_can_handle_nparray(gyrofrequency, kwargs={"signed": False})
-
 
 def test_gyroradius():
     r"""Test the gyroradius function in parameters.py."""
@@ -623,7 +598,6 @@ def test_gyroradius():
 
 class Test_gyroradius:
 
-    # some custom numpy array tests here, because of the T_i / Vperp situation
     def test_handle_numpy_array(self):
         # Tests to verify that can handle Quantities with numpy array as the value:
         assert gyroradius(B_arr, Vperp=V_arr)[0] == gyroradius(B_arr[0], Vperp=V_arr[0])
@@ -661,10 +635,9 @@ def test_keeps_arguments_unchanged(self):
         Vperp2 = u.Quantity([np.nan, 1], unit=u.m/u.s)  # an exact copy
         T_i = u.Quantity([1, np.nan], unit=u.K)
 
-        gyroradius(B_arr, Vperp=Vperp1, T_i=T_i)
+        gyroradius(B_arr, Vperp=Vperp1, T_i = T_i)
         assert_quantity_allclose(Vperp1, Vperp2)
 
-
 def test_plasma_frequency():
     r"""Test the plasma_frequency function in parameters.py."""
 
@@ -711,8 +684,6 @@ def test_plasma_frequency():
                       atol=0.0,
                       rtol=1e-15), errStr
 
-    assert_can_handle_nparray(plasma_frequency)
-
 
 def test_Debye_length():
     r"""Test the Debye_length function in parameters.py."""
@@ -745,8 +716,6 @@ def test_Debye_length():
     with pytest.warns(u.UnitsWarning):
         assert Debye_length(2.0 * u.K, 2.0) == Debye_length(2.0, 2.0 * u.m ** -3)
 
-    assert_can_handle_nparray(Debye_length)
-
 
 def test_Debye_number():
     r"""Test the Debye_number function in parameters.py."""
@@ -785,8 +754,6 @@ def test_Debye_number():
     with pytest.warns(u.UnitsWarning):
         assert Debye_number(1.1 * u.K, 1.1) == Debye_number(1.1, 1.1 * u.m ** -3)
 
-    assert_can_handle_nparray(Debye_number)
-
 
 def test_inertial_length():
     r"""Test the inertial_length function in parameters.py."""
@@ -833,8 +800,6 @@ def test_inertial_length():
     with pytest.warns(u.UnitsWarning):
         assert inertial_length(1e19) == inertial_length(1e19 * u.m ** -3)
 
-    assert_can_handle_nparray(inertial_length)
-
 
 def test_magnetic_pressure():
     r"""Test the magnetic_pressure function in parameters.py."""
@@ -869,8 +834,6 @@ def test_magnetic_pressure():
     with pytest.warns(u.UnitsWarning):
         assert magnetic_pressure(22.2) == magnetic_pressure(22.2 * u.T)
 
-    assert_can_handle_nparray(magnetic_pressure)
-
 
 def test_magnetic_energy_density():
     r"""Test the magnetic_energy_density function in parameters.py."""
@@ -887,6 +850,8 @@ def test_magnetic_energy_density():
 
     assert_quantity_allclose(magnetic_energy_density(B), magnetic_energy_density(B.to(u.G)))
 
+    # TODO Add an array test!
+
     assert magnetic_energy_density(B_arr)
 
     with pytest.warns(u.UnitsWarning):
@@ -907,8 +872,6 @@ def test_magnetic_energy_density():
     with pytest.warns(u.UnitsWarning):
         assert magnetic_energy_density(22.2) == magnetic_energy_density(22.2 * u.T)
 
-    assert_can_handle_nparray(magnetic_energy_density)
-
 
 def test_upper_hybrid_frequency():
     r"""Test the upper_hybrid_frequency function in parameters.py."""
@@ -934,8 +897,6 @@ def test_upper_hybrid_frequency():
         assert upper_hybrid_frequency(1.4 * u.T, 1.3) == upper_hybrid_frequency(1.4,
                                                                                 1.3 * u.m ** -3)
 
-    assert_can_handle_nparray(upper_hybrid_frequency)
-
 
 def test_lower_hybrid_frequency():
     r"""Test the lower_hybrid_frequency function in parameters.py."""
@@ -966,4 +927,3 @@ def test_lower_hybrid_frequency():
     with pytest.warns(u.UnitsWarning):
         assert lower_hybrid_frequency(1.3, 1e19) == lower_hybrid_frequency(1.3 * u.T,
                                                                            1e19 * u.m ** -3)
-    assert_can_handle_nparray(lower_hybrid_frequency)
diff --git a/plasmapy/physics/transport/tests/test_collisions.py b/plasmapy/physics/transport/tests/test_collisions.py
index feb1c115..eb48ef4b 100644
--- a/plasmapy/physics/transport/tests/test_collisions.py
+++ b/plasmapy/physics/transport/tests/test_collisions.py
@@ -15,7 +15,6 @@
                                                    fundamental_electron_collision_freq,
                                                    fundamental_ion_collision_freq)
 from plasmapy.utils import exceptions
-from plasmapy.utils.pytest_helpers import assert_can_handle_nparray
 from plasmapy.constants import m_p, m_e, c
 
 
@@ -44,19 +43,6 @@ def setup_class(self):
         self.gms6 = 3.635342040477818
         self.gms6_negative = 0.030720859361047514
 
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    @pytest.mark.parametrize("kwargs", [{"method": "classical"},
-                                        {"method": "GMS-1"},
-                                        {"method": "GMS-2", "z_mean": 1.0},
-                                        {"method": "GMS-3"},
-                                        {"method": "GMS-4"},
-                                        {"method": "GMS-5", "z_mean": 1.0},
-                                        {"method": "GMS-6", "z_mean": 1.0}, ])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(Coulomb_logarithm, insert_some_nans, insert_all_nans, kwargs)
-
     def test_unknown_method(self):
         """Test that function will raise ValueError on non-existent method"""
         with pytest.raises(ValueError):
@@ -93,6 +79,24 @@ def test_handle_zero_V(self):
                               z_mean=1 * u.dimensionless_unscaled,
                               V=0 * u.m / u.s)
 
+    @pytest.mark.parametrize("method", ["classical", "GMS-1", "GMS-2", "GMS-3", "GMS-4", "GMS-5",
+                                        "GMS-6"])
+    def test_handle_numpy_array(self, method):
+        """Tests to verify that can handle Quantities with numpy array as the value"""
+        methodVal = Coulomb_logarithm(self.T_arr,
+                                      self.n_arr,
+                                      self.particles,
+                                      z_mean=1 * u.dimensionless_unscaled,
+                                      V=np.nan * u.m / u.s,
+                                      method=method)
+        methodVal_0 = Coulomb_logarithm(self.T_arr[0],
+                                        self.n_arr[0],
+                                        self.particles,
+                                        z_mean=1 * u.dimensionless_unscaled,
+                                        V=np.nan * u.m / u.s,
+                                        method=method)
+        assert_quantity_allclose(methodVal[0], methodVal_0)
+
     def test_handle_V_arraysizes(self):
         """Test that different sized V input array gets handled by _boilerplate"""
         methodVal_0 = Coulomb_logarithm(self.T_arr[0],
@@ -586,14 +590,6 @@ def test_fail1(self):
                   f"should not be equal to {fail1}.")
         assert testTrue, errStr
 
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    def test_handle_nparrays(self, insert_some_nans,
-                             insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(impact_parameter_perp, insert_some_nans,
-                                  insert_all_nans, kwargs)
-
     assert np.isclose(Coulomb_logarithm(1 * u.eV, 5 * u.m ** -3, ('e', 'e')),
                       Coulomb_logarithm(11604.5220 * u.K,
                                         5 * u.m ** -3,
@@ -670,18 +666,23 @@ def test_bad_method(self):
                              V=np.nan * u.m / u.s,
                              method="meow")
 
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    @pytest.mark.parametrize("kwargs", [{"method": "classical"},
-                                        {"method": "GMS-1"},
-                                        {"method": "GMS-2", "z_mean": 1.0},
-                                        {"method": "GMS-3"},
-                                        {"method": "GMS-4"},
-                                        {"method": "GMS-5", "z_mean": 1.0},
-                                        {"method": "GMS-6", "z_mean": 1.0}, ])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(impact_parameter, insert_some_nans, insert_all_nans, kwargs)
+    @pytest.mark.parametrize("method", ["classical", "GMS-1", "GMS-2", "GMS-3", "GMS-4", "GMS-5",
+                                        "GMS-6"])
+    def test_handle_numpy_array(self, method):
+        """Tests to verify that can handle Quantities with numpy array as the value"""
+        methodVal = impact_parameter(self.T_arr,
+                                     self.n_e_arr,
+                                     self.particles,
+                                     z_mean=1 * u.dimensionless_unscaled,
+                                     V=np.nan * u.m / u.s,
+                                     method=method)
+        methodVal_0 = impact_parameter(self.T_arr[0],
+                                       self.n_e_arr[0],
+                                       self.particles,
+                                       z_mean=1 * u.dimensionless_unscaled,
+                                       V=np.nan * u.m / u.s,
+                                       method=method)
+        assert_quantity_allclose((methodVal[0][0], methodVal[1][0]), methodVal_0)
 
     def test_extend_scalar_bmin(self):
         """
@@ -755,15 +756,6 @@ def test_fail1(self):
                   f"should not be equal to {fail1}.")
         assert testTrue, errStr
 
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    @pytest.mark.parametrize("kwargs", [{"particles": ("e", "e")},
-                                        {"particles": ("e", "p")},
-                                        {"particles": ("p", "p")}, ])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(collision_frequency, insert_some_nans, insert_all_nans, kwargs)
-
     def test_electrons(self):
         """
         Testing collision frequency between electrons.
@@ -831,13 +823,17 @@ def setup_class(self):
         self.ion_particle = 'p'
         self.coulomb_log = 10
 
-    # TODO: array coulomb log
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(fundamental_electron_collision_freq, insert_some_nans,
-                                  insert_all_nans, kwargs)
+    def test_handle_numpy_array(self):
+        """Tests to verify that can handle Quantities with numpy array as the value"""
+        methodVal = fundamental_electron_collision_freq(self.T_arr,
+                                                        self.n_arr,
+                                                        self.ion_particle,
+                                                        coulomb_log=self.coulomb_log)
+        methodVal_0 = fundamental_electron_collision_freq(self.T_arr[0],
+                                                          self.n_arr[0],
+                                                          self.ion_particle,
+                                                          coulomb_log=self.coulomb_log)
+        assert_quantity_allclose(methodVal[0], methodVal_0)
 
 
 class Test_fundamental_ion_collision_freq():
@@ -849,13 +845,17 @@ def setup_class(self):
         self.ion_particle = 'p'
         self.coulomb_log = 10
 
-    # TODO: array coulomb log
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(fundamental_ion_collision_freq, insert_some_nans,
-                                  insert_all_nans, kwargs)
+    def test_handle_numpy_array(self):
+        """Tests to verify that can handle Quantities with numpy array as the value"""
+        methodVal = fundamental_ion_collision_freq(self.T_arr,
+                                                   self.n_arr,
+                                                   self.ion_particle,
+                                                   coulomb_log=self.coulomb_log)
+        methodVal_0 = fundamental_ion_collision_freq(self.T_arr[0],
+                                                     self.n_arr[0],
+                                                     self.ion_particle,
+                                                     coulomb_log=self.coulomb_log)
+        assert_quantity_allclose(methodVal[0], methodVal_0)
 
 
 class Test_mean_free_path:
@@ -914,12 +914,6 @@ def test_fail1(self):
                   f"should not be equal to {fail1}.")
         assert testTrue, errStr
 
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(mean_free_path, insert_some_nans, insert_all_nans, kwargs)
-
 
 class Test_Spitzer_resistivity:
     @classmethod
@@ -992,13 +986,6 @@ def test_zmean(self):
                   f"not {methodVal}.")
         assert testTrue, errStr
 
-    # TODO vector z_mean
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(Spitzer_resistivity, insert_some_nans, insert_all_nans, kwargs)
-
 
 class Test_mobility:
     @classmethod
@@ -1074,13 +1061,6 @@ def test_zmean(self):
                   f"not {methodVal}.")
         assert testTrue, errStr
 
-    # TODO vector z_mean
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(mobility, insert_some_nans, insert_all_nans, kwargs)
-
 
 class Test_Knudsen_number:
     @classmethod
@@ -1141,12 +1121,6 @@ def test_fail1(self):
                   f"should not be equal to {fail1}.")
         assert testTrue, errStr
 
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    def test_handle_nparrays(self, insert_some_nans, insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(Knudsen_number, insert_some_nans, insert_all_nans, kwargs)
-
 
 class Test_coupling_parameter:
     @classmethod
@@ -1222,17 +1196,6 @@ def test_zmean(self):
                   f"not {methodVal}.")
         assert testTrue, errStr
 
-    # TODO vector z_mean
-    @pytest.mark.parametrize("insert_some_nans", [[], ["V"]])
-    @pytest.mark.parametrize("insert_all_nans", [[], ["V"]])
-    # @pytest.mark.parametrize("kwargs", [{"method": "classical"},
-    #                                     {"method": "quantum"},])   # TODO quantum issues
-    def test_handle_nparrays(self, insert_some_nans,
-                             insert_all_nans, kwargs={}):
-        """Test for ability to handle numpy array quantities"""
-        assert_can_handle_nparray(coupling_parameter, insert_some_nans,
-                                  insert_all_nans, kwargs)
-
     def test_quantum(self):
         """
         Testing quantum method for coupling parameter.
diff --git a/plasmapy/tests/coveragerc b/plasmapy/tests/coveragerc
index 5cf049e8..e69de29b 100644
--- a/plasmapy/tests/coveragerc
+++ b/plasmapy/tests/coveragerc
@@ -1,15 +0,0 @@
-[report]
-omit =
-    ci-helpers/*
-    */tests/*
-    astropy_helpers/*
-    ah_bootstrap.py
-    plasmapy/setup_package.py
-    plasmapy/version.py
-exclude_lines =
-    coveralls: ignore
-    def __repr__
-    NotImplementedError
-    ImportError
-    ModuleNotFoundError
-    SyntaxError
diff --git a/plasmapy/utils/pytest_helpers.py b/plasmapy/utils/pytest_helpers.py
index 0f0e2dd0..0e67877c 100644
--- a/plasmapy/utils/pytest_helpers.py
+++ b/plasmapy/utils/pytest_helpers.py
@@ -8,7 +8,6 @@
 import astropy.units as u
 import astropy.constants as const
 import colorama
-import astropy.tests.helper as astrohelper
 
 # These colors/styles are used to highlight certain parts of the error
 # messages in consistent ways.
@@ -720,157 +719,3 @@ def run_test_equivalent_calls(*test_inputs, require_same_type: bool = True):
                 f"of type {test_case['type']}")
 
         raise UnexpectedResultError(errmsg)
-
-
-def assert_can_handle_nparray(function_to_test, insert_some_nans=[], insert_all_nans=[],
-                              kwargs={}):
-    """
-    Test for ability to handle numpy array quantities.
-
-    Parameters
-    ----------
-    function_to_test
-        The function to be tested for ability to handle numpy array quantities.
-        Arguments are automatically given a vector input based on their
-        variable name. Current args that are interpreted as vectors are:
-        `["T", "T_i", "T_e", "temperature"]`
-        `["n", "n_i", "n_e", "density"]`
-        `["B"]`
-        `["V", "Vperp"]`
-        `["coulomb_log"]`
-        `["characteristic_length"]`
-
-    insert_some_nans: list
-        List of argument names in which to insert some np.nan values.
-        These must be arguments that will be tested as vectors as listed
-        above.
-
-    insert_all_nans: list
-        List of argument names to fill entirely with np.nan values.
-
-    kwargs: dict
-        Arguments to pass directly to the function in under test, in the
-        normal kwargs python dictionary format.
-
-    Raises
-    ------
-    ~ValueError
-        If this function cannot interpret a parameter of function_to_test,
-
-    Examples
-    --------
-    >>> from plasmapy.physics.parameters import Alfven_speed, gyrofrequency
-    >>> assert_can_handle_nparray(Alfven_speed)
-    >>> assert_can_handle_nparray(gyrofrequency, kwargs={"signed": True})
-    >>> assert_can_handle_nparray(gyrofrequency, kwargs={"signed": False})
-    """
-    def _prepare_input(param_name, param_default, insert_some_nans, insert_all_nans, kwargs):
-        """
-        Parse parameter names and set up values to input for 0d, 1d, and 2d array tests.
-        """
-        # first things first: let any passed in kwarg right through (VIP access)
-        if param_name in kwargs.keys():
-            return (kwargs[param_name], ) * 4
-
-        # else, if it's a recognized variable name, give it a reasonable unit and magnitude
-        elif param_name in ["particle", "ion_particle", "ion"]:
-            if not (param_default is inspect._empty or param_default is None):
-                return (param_default, ) * 4
-            else:
-                return ("p", ) * 4
-        elif param_name == "particles":
-            if not (param_default is inspect._empty):
-                return (param_default, ) * 4
-            else:
-                return (("e", "p"), ) * 4
-        elif param_name in ["T", "T_i", "T_e", "temperature"]:
-            unit = u.eV
-            magnitude = 1.0
-        elif param_name in ["n", "n_i", "n_e", "density"]:
-            unit = u.m ** -3
-            magnitude = 1e20
-        elif param_name == "B":
-            unit = u.G
-            magnitude = 1e3
-        elif param_name in ["V", "Vperp"]:
-            unit = u.m / u.s
-            magnitude = 1e5
-        elif param_name == "coulomb_log":
-            unit = 1.0
-            magnitude = 1e1
-        elif param_name == "characteristic_length":
-            unit = u.m
-            magnitude = 1.0
-
-        # else, last resort, if it has a default argument, go with that:
-        elif not (param_default is inspect._empty):
-            return (param_default, ) * 4
-
-        else:
-            raise ValueError("Unrecognized function input")
-
-        # now knowing unit and magnitude, set up the 0d, 1d, 2d, and 3d arrays:
-        input_data_3d = np.reshape(np.arange(1.0, 9.0, 1.0), (2, 2, 2))
-        input_data_2d = np.reshape(np.arange(1.0, 5.0, 1.0), (2, 2))
-        input_data_1d = np.arange(1.0, 5.0, 1.0)
-        if param_name in insert_some_nans:
-            input_data_3d[0, 0, 1] = np.nan
-            input_data_3d[0, 1, 0] = np.nan
-            input_data_2d[0, 1] = np.nan
-            input_data_2d[1, 0] = np.nan
-            input_data_1d[1] = np.nan
-        elif param_name in insert_all_nans:
-            input_data_3d = np.ones((2, 2, 2)) * np.nan
-            input_data_2d = np.ones((2, 2)) * np.nan
-            input_data_1d = np.ones(4) * np.nan
-        input_data_3d *= magnitude
-        input_data_3d *= unit
-        input_data_2d *= magnitude
-        input_data_2d *= unit
-        input_data_1d *= magnitude
-        input_data_1d *= unit
-        input_data_0d = input_data_1d[3]
-        return input_data_0d, input_data_1d, input_data_2d, input_data_3d
-
-    #
-    # *** body of assert_can_handle_nparray function ***
-    #
-
-    # call _prepare_input to prepare 0d, 1d, and 2d sets of arguments for the function:
-    function_sig = inspect.signature(function_to_test)
-    function_params = function_sig.parameters
-    args_0d = dict()
-    args_1d = dict()
-    args_2d = dict()
-    args_3d = dict()
-    param_names = [elm for elm in function_params.keys()]
-    for idx, key in enumerate(function_params):
-        args_0d[key], args_1d[key], args_2d[key], args_3d[key] = _prepare_input(
-            param_names[idx],
-            function_params[key].default,
-            insert_some_nans,
-            insert_all_nans,
-            kwargs,
-            )
-
-    # call the function with the prepared argument sets:
-    result_0d = function_to_test(**args_0d)
-    result_1d = function_to_test(**args_1d)
-    result_2d = function_to_test(**args_2d)
-    result_3d = function_to_test(**args_3d)
-
-    # assert that the 1d, 2d, 3d versions get the same result (elementwise) as the 0d version:
-    # (if the function returns multiple values, loop through and test each)
-    try:
-        scalar_testable = result_0d.value
-    except AttributeError:
-        scalar_testable = result_0d
-    if np.isscalar(scalar_testable):
-        astrohelper.assert_quantity_allclose(result_0d, result_1d[3])
-        astrohelper.assert_quantity_allclose(result_0d, result_2d[1, 1])
-        astrohelper.assert_quantity_allclose(result_0d, result_3d[0, 1, 1])
-    else:
-        for idx, res_0d in enumerate(result_0d):
-            astrohelper.assert_quantity_allclose(res_0d, result_1d[idx][3])
-            astrohelper.assert_quantity_allclose(res_0d, result_2d[idx][1, 1])
-            astrohelper.assert_quantity_allclose(res_0d, result_3d[idx][0, 1, 1])