prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Create physics exceptions and warnings
  Several of the exceptions and warnings that come up in PlasmaPy result from when we try to violate the laws of physics.  Most of the time these violations cause a `UserWarning` or raise a `ValueError`, but these are pretty generic and don't give much insight into the cause of the problem.  To help with exception handling, I propose that we create new exceptions and warnings, such as `PhysicsError` and `PhysicsWarning`.  We could additionally be more specific and also have `RelativityError` and/or `RelativityWarning`.  One possibility would be to put these in a new file called `plasmapy/utils/exceptions.py`.
  
  This would be a good first contribution for someone who is somewhat familiar with Python.  Here's documentation on [user-defined exceptions](https://docs.python.org/3/tutorial/errors.html#user-defined-exceptions.  Thank you!
  
  
  </issue>
  <code>
  [start of plasmapy/utils/exceptions.py]
  1 """
  2 Custom Error and Warning names to improve readability
  3 """
  4 
  5 
  6 # ----------
  7 # Exceptions:
  8 # ----------
  9 
  10 class PlasmaPyError(Exception):
  11     """
  12     Base class of PlasmaPy custom errors.
  13 
  14     All custom exceptions raised by PlasmaPy should inherit from this class
  15     and be defined in this module.
  16 
  17     Custom exceptions can inherit from other exception types too. Thus, if code
  18     already knows how to handle a ValueError, it won't need any specific
  19     modification.
  20     """
  21 
  22 
  23 class PhysicsError(PlasmaPyError, ValueError):
  24     """Error for use of a physics value outside PlasmaPy theoretical bounds"""
  25 
  26 
  27 class RelativityError(PhysicsError):
  28     """Error for use of a speed greater than or equal to the speed of light"""
  29 
  30 
  31 # ----------
  32 # Warnings:
  33 # ----------
  34 
  35 class PlasmaPyWarning(Warning):
  36     """Base class of PlasmaPy custom warnings.
  37 
  38     All PlasmaPy custom warnings should inherit from this class and be defined
  39     in this module.
  40 
  41     Warnings should be issued using warnings.warn, which will not break
  42     execution if unhandled.
  43     """
  44 
  45 
  46 class PhysicsWarning(PlasmaPyWarning):
  47     """Warning for using a mildly worrisome physics value"""
  48 
  49 
  50 class RelativityWarning(PhysicsWarning):
  51     """Warning for use of a speed quantity approaching the speed of light"""
  52
  [end of plasmapy/utils/exceptions.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/plasmapy/utils/exceptions.py b/plasmapy/utils/exceptions.py
  --- a/plasmapy/utils/exceptions.py
  +++ b/plasmapy/utils/exceptions.py
  @@ -18,14 +18,51 @@
       already knows how to handle a ValueError, it won't need any specific
       modification.
       """
  +    pass
   
   
   class PhysicsError(PlasmaPyError, ValueError):
       """Error for use of a physics value outside PlasmaPy theoretical bounds"""
  +    pass
   
   
   class RelativityError(PhysicsError):
       """Error for use of a speed greater than or equal to the speed of light"""
  +    pass
  +
  +
  +class AtomicError(PlasmaPyError):
  +    """Error for use by an atomic subpackage"""
  +    pass
  +
  +
  +class MissingAtomicDataError(AtomicError):
  +    """Error for use when atomic data is missing."""
  +    pass
  +
  +
  +class NoChargeInfoError(AtomicError):
  +    """Error for use when charge information is needed but missing."""
  +
  +
  +class IonError(NoChargeInfoError):
  +    """Error for use when an ion is invalid."""
  +    pass
  +
  +
  +class IsotopeError(AtomicError):
  +    """Error for use when an isotope is invalid."""
  +    pass
  +
  +
  +class ElementError(IsotopeError, IonError):
  +    """Error for use when an element is invalid."""
  +    pass
  +
  +
  +class ParticleError(ElementError):
  +    """Error for use when a particle is invalid."""
  +    pass
   
   
   # ----------
  @@ -41,11 +78,24 @@
       Warnings should be issued using warnings.warn, which will not break
       execution if unhandled.
       """
  +    pass
   
   
   class PhysicsWarning(PlasmaPyWarning):
       """Warning for using a mildly worrisome physics value"""
  +    pass
   
   
   class RelativityWarning(PhysicsWarning):
       """Warning for use of a speed quantity approaching the speed of light"""
  +    pass
  +
  +
  +class AtomicWarning(PlasmaPyWarning):
  +    """Warnings for use in the atomic subpackage."""
  +    pass
  +
  +
  +class MissingAtomicDataWarning(AtomicWarning):
  +    """Warning for use when atomic data is missing."""
  +    pass
  
verification_info: {"golden_diff": "diff --git a/plasmapy/utils/exceptions.py b/plasmapy/utils/exceptions.py\n--- a/plasmapy/utils/exceptions.py\n+++ b/plasmapy/utils/exceptions.py\n@@ -18,14 +18,51 @@\n     already knows how to handle a ValueError, it won't need any specific\n     modification.\n     \"\"\"\n+    pass\n \n \n class PhysicsError(PlasmaPyError, ValueError):\n     \"\"\"Error for use of a physics value outside PlasmaPy theoretical bounds\"\"\"\n+    pass\n \n \n class RelativityError(PhysicsError):\n     \"\"\"Error for use of a speed greater than or equal to the speed of light\"\"\"\n+    pass\n+\n+\n+class AtomicError(PlasmaPyError):\n+    \"\"\"Error for use by an atomic subpackage\"\"\"\n+    pass\n+\n+\n+class MissingAtomicDataError(AtomicError):\n+    \"\"\"Error for use when atomic data is missing.\"\"\"\n+    pass\n+\n+\n+class NoChargeInfoError(AtomicError):\n+    \"\"\"Error for use when charge information is needed but missing.\"\"\"\n+\n+\n+class IonError(NoChargeInfoError):\n+    \"\"\"Error for use when an ion is invalid.\"\"\"\n+    pass\n+\n+\n+class IsotopeError(AtomicError):\n+    \"\"\"Error for use when an isotope is invalid.\"\"\"\n+    pass\n+\n+\n+class ElementError(IsotopeError, IonError):\n+    \"\"\"Error for use when an element is invalid.\"\"\"\n+    pass\n+\n+\n+class ParticleError(ElementError):\n+    \"\"\"Error for use when a particle is invalid.\"\"\"\n+    pass\n \n \n # ----------\n@@ -41,11 +78,24 @@\n     Warnings should be issued using warnings.warn, which will not break\n     execution if unhandled.\n     \"\"\"\n+    pass\n \n \n class PhysicsWarning(PlasmaPyWarning):\n     \"\"\"Warning for using a mildly worrisome physics value\"\"\"\n+    pass\n \n \n class RelativityWarning(PhysicsWarning):\n     \"\"\"Warning for use of a speed quantity approaching the speed of light\"\"\"\n+    pass\n+\n+\n+class AtomicWarning(PlasmaPyWarning):\n+    \"\"\"Warnings for use in the atomic subpackage.\"\"\"\n+    pass\n+\n+\n+class MissingAtomicDataWarning(AtomicWarning):\n+    \"\"\"Warning for use when atomic data is missing.\"\"\"\n+    pass\n", "issue": "Create physics exceptions and warnings\nSeveral of the exceptions and warnings that come up in PlasmaPy result from when we try to violate the laws of physics.  Most of the time these violations cause a `UserWarning` or raise a `ValueError`, but these are pretty generic and don't give much insight into the cause of the problem.  To help with exception handling, I propose that we create new exceptions and warnings, such as `PhysicsError` and `PhysicsWarning`.  We could additionally be more specific and also have `RelativityError` and/or `RelativityWarning`.  One possibility would be to put these in a new file called `plasmapy/utils/exceptions.py`.\r\n\r\nThis would be a good first contribution for someone who is somewhat familiar with Python.  Here's documentation on [user-defined exceptions](https://docs.python.org/3/tutorial/errors.html#user-defined-exceptions.  Thank you!\r\n\n", "before_files": [{"content": "\"\"\"\nCustom Error and Warning names to improve readability\n\"\"\"\n\n\n# ----------\n# Exceptions:\n# ----------\n\nclass PlasmaPyError(Exception):\n    \"\"\"\n    Base class of PlasmaPy custom errors.\n\n    All custom exceptions raised by PlasmaPy should inherit from this class\n    and be defined in this module.\n\n    Custom exceptions can inherit from other exception types too. Thus, if code\n    already knows how to handle a ValueError, it won't need any specific\n    modification.\n    \"\"\"\n\n\nclass PhysicsError(PlasmaPyError, ValueError):\n    \"\"\"Error for use of a physics value outside PlasmaPy theoretical bounds\"\"\"\n\n\nclass RelativityError(PhysicsError):\n    \"\"\"Error for use of a speed greater than or equal to the speed of light\"\"\"\n\n\n# ----------\n# Warnings:\n# ----------\n\nclass PlasmaPyWarning(Warning):\n    \"\"\"Base class of PlasmaPy custom warnings.\n\n    All PlasmaPy custom warnings should inherit from this class and be defined\n    in this module.\n\n    Warnings should be issued using warnings.warn, which will not break\n    execution if unhandled.\n    \"\"\"\n\n\nclass PhysicsWarning(PlasmaPyWarning):\n    \"\"\"Warning for using a mildly worrisome physics value\"\"\"\n\n\nclass RelativityWarning(PhysicsWarning):\n    \"\"\"Warning for use of a speed quantity approaching the speed of light\"\"\"\n", "path": "plasmapy/utils/exceptions.py"}]}