Repository: PlasmaPy/PlasmaPy

Issue:
Allow eV for temperature input without ImplicitUnitConversionWarnings
Also fix `plasmapy.formulary.gyrofrequency(u.m)` error:
`has -> should be an astropy.Quantity. Got BLAH instead. `

Raised due to #884.


Discussion:

Resolving patch:
diff --git a/plasmapy/utils/decorators/validators.py b/plasmapy/utils/decorators/validators.py
--- a/plasmapy/utils/decorators/validators.py
+++ b/plasmapy/utils/decorators/validators.py
@@ -12,7 +12,6 @@
 
 from plasmapy.utils.decorators.checks import CheckUnits, CheckValues
 from plasmapy.utils.decorators.helpers import preserve_signature
-from plasmapy.utils.exceptions import ImplicitUnitConversionWarning
 
 
 class ValidateQuantities(CheckUnits, CheckValues):
@@ -366,15 +365,6 @@ def _validate_quantity(self, arg, arg_name: str, arg_validations: Dict[str, Any]
             and not arg_validations["pass_equivalent_units"]
         ):
 
-            if not arg.unit.is_equivalent(unit, equivalencies=None):
-                # non-standard conversion
-                warnings.warn(
-                    ImplicitUnitConversionWarning(
-                        f"{err_msg} has a non-standard unit conversion..."
-                        f"converting {arg.unit} to {unit}"
-                    )
-                )
-
             arg = arg.to(unit, equivalencies=equiv)
         elif err is not None:
             raise err
diff --git a/plasmapy/utils/exceptions.py b/plasmapy/utils/exceptions.py
--- a/plasmapy/utils/exceptions.py
+++ b/plasmapy/utils/exceptions.py
@@ -8,7 +8,6 @@
     "RomanError",
     "PlasmaPyWarning",
     "CouplingWarning",
-    "ImplicitUnitConversionWarning",
     "PhysicsWarning",
     "RelativityWarning",
 ]
@@ -118,11 +117,3 @@ class CouplingWarning(PhysicsWarning):
     """
 
     pass
-
-
-class ImplicitUnitConversionWarning(PlasmaPyWarning, UnitsWarning):
-    """
-    A warning for an implicit conversion between equivalent :mod:`astropy` units.
-    """
-
-    pass


Test patch:
diff --git a/plasmapy/utils/decorators/tests/test_validators.py b/plasmapy/utils/decorators/tests/test_validators.py
--- a/plasmapy/utils/decorators/tests/test_validators.py
+++ b/plasmapy/utils/decorators/tests/test_validators.py
@@ -10,9 +10,9 @@
 from typing import Any, Dict, List
 from unittest import mock
 
+from plasmapy.formulary.parameters import Debye_number
 from plasmapy.utils.decorators.checks import CheckUnits, CheckValues
 from plasmapy.utils.decorators.validators import validate_quantities, ValidateQuantities
-from plasmapy.utils.exceptions import ImplicitUnitConversionWarning
 
 
 # ----------------------------------------------------------------------------------------
@@ -246,19 +246,6 @@ def test_vq_method__validate_quantity(self):
                 },
                 "raises": TypeError,
             },
-            # argument has a non-standard unit conversion
-            {
-                "input": {
-                    "args": (5.0 * u.K, "arg"),
-                    "validations": {
-                        **default_validations,
-                        "units": [u.eV],
-                        "equivalencies": u.temperature_energy(),
-                    },
-                },
-                "output": (5.0 * u.K).to(u.eV, equivalencies=u.temperature_energy()),
-                "warns": ImplicitUnitConversionWarning,
-            },
             # argument has a standard unit conversion
             {
                 "input": {
@@ -304,9 +291,6 @@ def test_vq_method__validate_quantity(self):
 
             if "warns" in case:
                 with pytest.warns(case["warns"]):
-                    warnings.simplefilter(
-                        "always", category=ImplicitUnitConversionWarning
-                    )
                     _result = vq._validate_quantity(arg, arg_name, validations)
             elif "raises" in case:
                 with pytest.raises(case["raises"]):