Repository: PlasmaPy/PlasmaPy

Issue:
Add an `isotope_name` attribute on `Particle` class
> We could definitely add an `isotope_name` attribute as well, which for isotopes in general would return something like `'iodine-131'` plus `'deuterium'` and `'tritium'` for those special cases. The `element` and `element_name` attributes just return the name of the element without respect to the isotope. I'll try to remember to create a separate issue for this.

[as mentioned here](https://github.com/PlasmaPy/PlasmaPy/pull/468/files#r189747292) by @namurphy.

Discussion:

Patch:
diff --git a/plasmapy/atomic/particle_class.py b/plasmapy/atomic/particle_class.py
index 0a5d2c92..b7e7ed5c 100644
--- a/plasmapy/atomic/particle_class.py
+++ b/plasmapy/atomic/particle_class.py
@@ -658,6 +658,42 @@ def element_name(self) -> str:
             raise InvalidElementError(_category_errmsg(self, 'element'))
         return self._attributes['element name']
 
+    @property
+    def isotope_name(self) -> str:
+        """
+        Return the name of the element along with the isotope
+        symbol if the particle corresponds to an isotope, and
+        `None` otherwise.
+
+        If the particle is not a valid element, then this
+        attribute will raise an `~plasmapy.utils.InvalidElementError`.
+        If it is not an isotope, then this attribute will raise an
+        `~plasmapy.utils.InvalidIsotopeError`.
+
+        Examples
+        --------
+        >>> deuterium = Particle("D")
+        >>> deuterium.isotope_name
+        'deuterium'
+        >>> iron_isotope = Particle("Fe-56", Z=16)
+        >>> iron_isotope.isotope_name
+        'iron-56'
+
+        """
+        if not self.element:
+            raise InvalidElementError(_category_errmsg(self.particle, 'element'))
+        elif not self.isotope:
+            raise InvalidIsotopeError(_category_errmsg(self, 'isotope'))
+
+        if self.isotope == "D":
+            isotope_name = "deuterium"
+        elif self.isotope == "T":
+            isotope_name = "tritium"
+        else:
+            isotope_name = f"{self.element_name}-{self.mass_number}"
+
+        return isotope_name
+
     @property
     def integer_charge(self) -> int:
         """


Test patch:
diff --git a/plasmapy/atomic/tests/test_particle_class.py b/plasmapy/atomic/tests/test_particle_class.py
index 17558a58..9d3308e0 100644
--- a/plasmapy/atomic/tests/test_particle_class.py
+++ b/plasmapy/atomic/tests/test_particle_class.py
@@ -31,6 +31,7 @@
      {'particle': 'n',
       'element': None,
       'isotope': None,
+      'isotope_name': InvalidElementError,
       'ionic_symbol': None,
       'roman_symbol': None,
       'is_ion': False,
@@ -51,6 +52,7 @@
       'element': 'H',
       'element_name': 'hydrogen',
       'isotope': 'H-1',
+      'isotope_name': 'hydrogen-1',
       'ionic_symbol': 'p+',
       'roman_symbol': 'H-1 II',
       'is_ion': True,
@@ -85,6 +87,7 @@
       'element': None,
       'element_name': InvalidElementError,
       'isotope': None,
+      'isotope_name': InvalidElementError,
       'ionic_symbol': None,
       'roman_symbol': None,
       'is_ion': False,
@@ -106,6 +109,7 @@
       'element': None,
       'element_name': InvalidElementError,
       'isotope': None,
+      'isotope_name': InvalidElementError,
       'ionic_symbol': None,
       'roman_symbol': None,
       'is_ion': False,
@@ -129,6 +133,7 @@
      {'particle': 'e+',
       'element': None,
       'isotope': None,
+      'isotope_name': InvalidElementError,
       'ionic_symbol': None,
       'roman_symbol': None,
       'is_ion': False,
@@ -156,6 +161,7 @@
      {'particle': 'H',
       'element': 'H',
       'isotope': None,
+      'isotope_name': InvalidIsotopeError,
       'ionic_symbol': None,
       'roman_symbol': ChargeError,
       'is_ion': False,
@@ -177,6 +183,7 @@
      {'particle': 'H 1-',
       'element': 'H',
       'isotope': None,
+      'isotope_name': InvalidIsotopeError,
       'ionic_symbol': 'H 1-',
       'roman_symbol': roman.OutOfRangeError,
       'is_ion': True,
@@ -196,6 +203,7 @@
         'particle': 'H-1 0+',
         'element': 'H',
         'isotope': 'H-1',
+        'isotope_name': 'hydrogen-1',
         'ionic_symbol': 'H-1 0+',
         'roman_symbol': 'H-1 I',
         'is_ion': False,
@@ -218,6 +226,7 @@
       'element': 'H',
       'element_name': 'hydrogen',
       'isotope': 'D',
+      'isotope_name': 'deuterium',
       'ionic_symbol': 'D 1+',
       'roman_symbol': 'D II',
       'is_ion': True,
@@ -238,6 +247,7 @@
      {'particle': 'T 1+',
       'element': 'H',
       'isotope': 'T',
+      'isotope_name': 'tritium',
       'ionic_symbol': 'T 1+',
       'roman_symbol': 'T II',
       'is_ion': True,
@@ -257,6 +267,7 @@
       'element': 'Fe',
       'element_name': 'iron',
       'isotope': 'Fe-56',
+      'isotope_name': 'iron-56',
       'ionic_symbol': 'Fe-56 17+',
       'roman_symbol': 'Fe-56 XVIII',
       'is_electron': False,
@@ -277,6 +288,7 @@
       'element': 'He',
       'element_name': 'helium',
       'isotope': 'He-4',
+      'isotope_name': 'helium-4',
       'ionic_symbol': 'He-4 2+',
       'roman_symbol': 'He-4 III',
       'is_ion': True,
@@ -293,6 +305,7 @@
       'element': 'Li',
       'element_name': 'lithium',
       'isotope': 'Li-7',
+      'isotope_name': 'lithium-7',
       'ionic_symbol': None,
       'roman_symbol': ChargeError,
       'is_ion': False,
@@ -309,6 +322,7 @@
      {'particle': 'Cn-276 22+',
       'element': 'Cn',
       'isotope': 'Cn-276',
+      'isotope_name': 'copernicium-276',
       'ionic_symbol': 'Cn-276 22+',
       'roman_symbol': 'Cn-276 XXIII',
       'is_ion': True,
@@ -324,6 +338,7 @@
      {'particle': 'mu-',
       'element': None,
       'isotope': None,
+      'isotope_name': InvalidElementError,
       'ionic_symbol': None,
       'roman_symbol': None,
       'is_ion': False,
@@ -338,6 +353,7 @@
      {'particle': 'nu_tau',
       'element': None,
       'isotope': None,
+      'isotope_name': InvalidElementError,
       'mass': MissingAtomicDataError,
       'integer_charge': 0,
       'mass_number': InvalidIsotopeError,