We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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!


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `plasmapy/utils/exceptions.py`
Content:
```
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 FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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

{"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"}], "after_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    pass\n\n\nclass PhysicsError(PlasmaPyError, ValueError):\n    \"\"\"Error for use of a physics value outside PlasmaPy theoretical bounds\"\"\"\n    pass\n\n\nclass RelativityError(PhysicsError):\n    \"\"\"Error for use of a speed greater than or equal to the speed of light\"\"\"\n    pass\n\n\nclass AtomicError(PlasmaPyError):\n    \"\"\"Error for use by an atomic subpackage\"\"\"\n    pass\n\n\nclass MissingAtomicDataError(AtomicError):\n    \"\"\"Error for use when atomic data is missing.\"\"\"\n    pass\n\n\nclass NoChargeInfoError(AtomicError):\n    \"\"\"Error for use when charge information is needed but missing.\"\"\"\n\n\nclass IonError(NoChargeInfoError):\n    \"\"\"Error for use when an ion is invalid.\"\"\"\n    pass\n\n\nclass IsotopeError(AtomicError):\n    \"\"\"Error for use when an isotope is invalid.\"\"\"\n    pass\n\n\nclass ElementError(IsotopeError, IonError):\n    \"\"\"Error for use when an element is invalid.\"\"\"\n    pass\n\n\nclass ParticleError(ElementError):\n    \"\"\"Error for use when a particle is invalid.\"\"\"\n    pass\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    pass\n\n\nclass PhysicsWarning(PlasmaPyWarning):\n    \"\"\"Warning for using a mildly worrisome physics value\"\"\"\n    pass\n\n\nclass RelativityWarning(PhysicsWarning):\n    \"\"\"Warning for use of a speed quantity approaching the speed of light\"\"\"\n    pass\n\n\nclass AtomicWarning(PlasmaPyWarning):\n    \"\"\"Warnings for use in the atomic subpackage.\"\"\"\n    pass\n\n\nclass MissingAtomicDataWarning(AtomicWarning):\n    \"\"\"Warning for use when atomic data is missing.\"\"\"\n    pass\n", "path": "plasmapy/utils/exceptions.py"}]}