Repository: PlasmaPy/PlasmaPy

Issue:
Unnecessary warning issued for `Particle("H", Z=1, mass_numb=1)`
### Bug description

Running `Particle("H", Z=1, mass_numb=1)` causes a warning to be issued that there is redundant information provided, even though there is no redundant information. 

That warning was intended to occur for situations like `Particle("p+", Z=1)` where the charge is provided in both the string and `Z`.

### Expected outcome

No warning should be issued.

### Minimal complete verifiable example

```pycon
>>> from plasmapy.particles import Particle
>>> Particle("H", Z=1, mass_numb=1)
/home/namurphy/Projects/PlasmaPy/plasmapy/particles/particle_class.py:702: ParticleWarning: Redundant mass number or charge information.
  warnings.warn(
Particle("p+")
```

### Additional context

The problem is with this [block of code](https://github.com/PlasmaPy/PlasmaPy/blob/dc00cc5675cc956b388b9286dbac7e085c783890/plasmapy/particles/particle_class.py#L700).  Changing the warning to `pass` leads to two test failures which I still need to figure out.


Discussion:

Resolving patch:
diff --git a/plasmapy/particles/particle_class.py b/plasmapy/particles/particle_class.py
--- a/plasmapy/particles/particle_class.py
+++ b/plasmapy/particles/particle_class.py
@@ -695,20 +695,24 @@ def _assign_special_particle_attributes(self) -> NoReturn:
         if self.symbol == "p+":
             categories.update({"element", "isotope", "ion"})
 
-        _, mass_numb, Z = self.__inputs
+        argument, mass_numb, Z = self.__inputs
 
-        if mass_numb is not None or Z is not None:
-            if self.symbol == "p+" and 1 in (mass_numb, Z):
-                warnings.warn(
-                    "Redundant mass number or charge information.", ParticleWarning
-                )
-            else:
-                raise InvalidParticleError(
-                    "The keywords 'mass_numb' and 'Z' cannot be used when "
-                    "creating Particle objects for special particles. To "
-                    f"create a Particle object for {attributes['name']}s, "
-                    f"use:  Particle({attributes['particle']!r})"
-                )
+        if mass_numb is None and Z is None:
+            return
+
+        if self.symbol != "p+":
+            raise InvalidParticleError(
+                "The keywords 'mass_numb' and 'Z' cannot be used when "
+                "creating Particle objects for special particles. To "
+                f"create a Particle object for {attributes['name']}s, "
+                f"use: Particle({attributes['particle']!r})"
+            )
+
+        if mass_numb not in (1, None) or Z not in (1, None):
+            raise InvalidParticleError(
+                "Cannot create a Particle representing a proton for a "
+                "mass number or charge number not equal to 1."
+            )
 
     def _assign_atom_attributes(self) -> NoReturn:
         """Assign attributes and categories to elements, isotopes, and ions."""


Test patch:
diff --git a/plasmapy/particles/tests/test_exceptions.py b/plasmapy/particles/tests/test_exceptions.py
--- a/plasmapy/particles/tests/test_exceptions.py
+++ b/plasmapy/particles/tests/test_exceptions.py
@@ -953,7 +953,6 @@ def test_named_tests_for_exceptions(tested_object, args, kwargs, expected_except
     [isotope_symbol, ("Li-6",), {"mass_numb": 6}, pytest.warns(ParticleWarning)],
     [isotope_symbol, ("lithium-6",), {"mass_numb": 6}, pytest.warns(ParticleWarning)],
     [isotope_symbol, ("alpha",), {"mass_numb": 4}, pytest.warns(ParticleWarning)],
-    [isotope_symbol, ("p",), {"mass_numb": 1}, pytest.warns(ParticleWarning)],
 ]