prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Expands examples in docstrings of `HarrisSheet` and its methods
  Currently, the docstring for `HarrisSheet` ([permalink](https://github.com/PlasmaPy/PlasmaPy/blob/2c1ee2e74e86d9519d1a306a6f78413683ca9a02/src/plasmapy/plasma/equilibria1d.py#L12)) doesn't contain any examples. It would be helpful to add a simple working example that shows how to use it.
  
  One possibility would be to adapt some of the [tests](https://github.com/PlasmaPy/PlasmaPy/blob/2c1ee2e74e86d9519d1a306a6f78413683ca9a02/tests/plasma/test_equilibria1d.py).
  
  </issue>
  <code>
  [start of src/plasmapy/plasma/equilibria1d.py]
  1 """Functionality for representing one-dimensional equilibria."""
  2 
  3 __all__ = ["HarrisSheet"]
  4 
  5 import astropy.constants as const
  6 import astropy.units as u
  7 import numpy as np
  8 
  9 from plasmapy.utils.decorators.validators import validate_quantities
  10 
  11 
  12 class HarrisSheet:
  13     r"""
  14     Define a Harris Sheet Equilibrium.
  15 
  16     Magnetic field will be in the :math:`±x` direction and the current
  17     density will be in the :math:`±z` direction in a :math:`\hat{x} ×
  18     \hat{y} = \hat{z}` coordinate system.
  19 
  20     Parameters
  21     ----------
  22     B0 : `~astropy.units.Quantity`
  23          Magnitude of magnetic field in the limit of :math:`y → ∞` in
  24          units convertible to teslas.
  25 
  26     delta : `~astropy.units.Quantity`
  27         The thickness of the current sheet in units convertible to
  28         meters.
  29 
  30     P0 : `~astropy.units.Quantity`
  31         The plasma pressure in the limit of :math:`y → ∞` in units
  32         convertible to pascals.
  33 
  34     Notes
  35     -----
  36     A current sheet is current limited to a surface.
  37 
  38     A Harris sheet is a 1D ideal MHD equilibrium. In resistive MHD if
  39     there is any resistivity, it won't be a true equilibrium since the
  40     resistivity will gradually smooth the profile out over time.
  41 
  42     A Harris sheet is often used as the initial condition for
  43     simulations of magnetic reconnection.
  44 
  45     Examples
  46     --------
  47     >>> import astropy.units as u
  48     >>> harris_sheet = HarrisSheet(delta=3 * u.m, B0=2 * u.T)
  49     >>> harris_sheet.magnetic_field(y=5 * u.m)
  50     <Quantity 1.8622... T>
  51     """
  52 
  53     def __init__(self, B0, delta, P0=0 * u.Pa) -> None:
  54         self.B0 = B0
  55         self.delta = delta
  56         self.P0 = P0
  57 
  58     @validate_quantities
  59     def magnetic_field(self, y: u.Quantity[u.m]) -> u.Quantity[u.T]:
  60         r"""
  61         Compute the magnetic field.
  62 
  63         In this equation, :math:`B_0` is the asymptotic magnitude of the
  64         magnetic field for :math:`y → ±∞` and :math:`δ` is the thickness
  65         of the sheet.
  66 
  67         .. math::
  68 
  69             B_x(y) = B_0 \tanh \left( \frac{y}{δ} \right)
  70 
  71         Parameters
  72         ----------
  73         y : `~astropy.units.Quantity`
  74            Orthogonal distance from the current sheet center.
  75         """
  76         return self.B0 * np.tanh(u.rad * y / self.delta)
  77 
  78     @validate_quantities
  79     def current_density(self, y: u.Quantity[u.m]) -> u.Quantity[u.A / u.m**2]:
  80         r"""
  81         Compute the current density.
  82 
  83         .. math::
  84 
  85           J_z(y) = - \frac{B_0}{δ μ_0) \mathrm{sech}^2 \left( \frac{y}{δ} \right)
  86 
  87         Parameters
  88         ----------
  89         y : `~astropy.units.Quantity`
  90           Orthogonal distance from the current sheet center.
  91         """
  92         return (
  93             -self.B0 / (self.delta * const.mu0) * np.cosh(u.rad * y / self.delta) ** -2
  94         )
  95 
  96     @validate_quantities
  97     def plasma_pressure(self, y: u.Quantity[u.m]) -> u.Quantity[u.Pa]:
  98         r"""
  99         Compute plasma pressure.
  100 
  101         .. math::
  102 
  103             p(y) = \frac{B_0^2}{2 μ_0} \mathrm{sech}^2 \left( \frac{y}{δ} \right) + p_0
  104 
  105         Parameters
  106         ----------
  107         y : `~astropy.units.Quantity`
  108           Orthogonal distance from the current sheet center.
  109         """
  110         return (
  111             self.B0**2 / (2 * const.mu0) * (np.cosh(u.rad * y / self.delta) ** -2)
  112             + self.P0
  113         )
  114
  [end of src/plasmapy/plasma/equilibria1d.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/src/plasmapy/plasma/equilibria1d.py b/src/plasmapy/plasma/equilibria1d.py
  --- a/src/plasmapy/plasma/equilibria1d.py
  +++ b/src/plasmapy/plasma/equilibria1d.py
  @@ -72,6 +72,18 @@
           ----------
           y : `~astropy.units.Quantity`
              Orthogonal distance from the current sheet center.
  +
  +        Examples
  +        --------
  +        >>> import astropy.units as u
  +        >>> B0 = 1 * u.T
  +        >>> delta = 1 * u.m
  +        >>> P0 = 0 * u.Pa
  +        >>> hs = HarrisSheet(B0, delta, P0)
  +        >>> y = [-2, 0, 2] * u.m
  +        >>> hs.magnetic_field(y)
  +        <Quantity [-0.96402758007, 0, 0.96402758007] T>
  +
           """
           return self.B0 * np.tanh(u.rad * y / self.delta)
   
  @@ -88,6 +100,17 @@
           ----------
           y : `~astropy.units.Quantity`
             Orthogonal distance from the current sheet center.
  +
  +        Examples
  +        --------
  +        >>> import astropy.units as u
  +        >>> B0 = 1 * u.T
  +        >>> delta = 1 * u.m
  +        >>> P0 = 0 * u.Pa
  +        >>> hs = HarrisSheet(B0, delta, P0)
  +        >>> y = [-2, 0, 2] * u.m
  +        >>> hs.current_density(y)
  +        <Quantity [-56222.1400445, -795774.715459, -56222.1400445] A / m2>
           """
           return (
               -self.B0 / (self.delta * const.mu0) * np.cosh(u.rad * y / self.delta) ** -2
  @@ -106,6 +129,17 @@
           ----------
           y : `~astropy.units.Quantity`
             Orthogonal distance from the current sheet center.
  +
  +        Examples
  +        --------
  +        >>> import astropy.units as u
  +        >>> B0 = 1 * u.T
  +        >>> delta = 1 * u.m
  +        >>> P0 = 0 * u.Pa
  +        >>> hs = HarrisSheet(B0, delta, P0)
  +        >>> y = [-2, 0, 2] * u.m
  +        >>> hs.plasma_pressure(y)
  +        <Quantity [28111.07, 397887.36, 28111.07] Pa>
           """
           return (
               self.B0**2 / (2 * const.mu0) * (np.cosh(u.rad * y / self.delta) ** -2)
  
verification_info: {"golden_diff": "diff --git a/src/plasmapy/plasma/equilibria1d.py b/src/plasmapy/plasma/equilibria1d.py\n--- a/src/plasmapy/plasma/equilibria1d.py\n+++ b/src/plasmapy/plasma/equilibria1d.py\n@@ -72,6 +72,18 @@\n         ----------\n         y : `~astropy.units.Quantity`\n            Orthogonal distance from the current sheet center.\n+\n+        Examples\n+        --------\n+        >>> import astropy.units as u\n+        >>> B0 = 1 * u.T\n+        >>> delta = 1 * u.m\n+        >>> P0 = 0 * u.Pa\n+        >>> hs = HarrisSheet(B0, delta, P0)\n+        >>> y = [-2, 0, 2] * u.m\n+        >>> hs.magnetic_field(y)\n+        <Quantity [-0.96402758007, 0, 0.96402758007] T>\n+\n         \"\"\"\n         return self.B0 * np.tanh(u.rad * y / self.delta)\n \n@@ -88,6 +100,17 @@\n         ----------\n         y : `~astropy.units.Quantity`\n           Orthogonal distance from the current sheet center.\n+\n+        Examples\n+        --------\n+        >>> import astropy.units as u\n+        >>> B0 = 1 * u.T\n+        >>> delta = 1 * u.m\n+        >>> P0 = 0 * u.Pa\n+        >>> hs = HarrisSheet(B0, delta, P0)\n+        >>> y = [-2, 0, 2] * u.m\n+        >>> hs.current_density(y)\n+        <Quantity [-56222.1400445, -795774.715459, -56222.1400445] A / m2>\n         \"\"\"\n         return (\n             -self.B0 / (self.delta * const.mu0) * np.cosh(u.rad * y / self.delta) ** -2\n@@ -106,6 +129,17 @@\n         ----------\n         y : `~astropy.units.Quantity`\n           Orthogonal distance from the current sheet center.\n+\n+        Examples\n+        --------\n+        >>> import astropy.units as u\n+        >>> B0 = 1 * u.T\n+        >>> delta = 1 * u.m\n+        >>> P0 = 0 * u.Pa\n+        >>> hs = HarrisSheet(B0, delta, P0)\n+        >>> y = [-2, 0, 2] * u.m\n+        >>> hs.plasma_pressure(y)\n+        <Quantity [28111.07, 397887.36, 28111.07] Pa>\n         \"\"\"\n         return (\n             self.B0**2 / (2 * const.mu0) * (np.cosh(u.rad * y / self.delta) ** -2)\n", "issue": "Expands examples in docstrings of `HarrisSheet` and its methods\nCurrently, the docstring for `HarrisSheet` ([permalink](https://github.com/PlasmaPy/PlasmaPy/blob/2c1ee2e74e86d9519d1a306a6f78413683ca9a02/src/plasmapy/plasma/equilibria1d.py#L12)) doesn't contain any examples. It would be helpful to add a simple working example that shows how to use it.\r\n\r\nOne possibility would be to adapt some of the [tests](https://github.com/PlasmaPy/PlasmaPy/blob/2c1ee2e74e86d9519d1a306a6f78413683ca9a02/tests/plasma/test_equilibria1d.py).\n", "before_files": [{"content": "\"\"\"Functionality for representing one-dimensional equilibria.\"\"\"\n\n__all__ = [\"HarrisSheet\"]\n\nimport astropy.constants as const\nimport astropy.units as u\nimport numpy as np\n\nfrom plasmapy.utils.decorators.validators import validate_quantities\n\n\nclass HarrisSheet:\n    r\"\"\"\n    Define a Harris Sheet Equilibrium.\n\n    Magnetic field will be in the :math:`\u00b1x` direction and the current\n    density will be in the :math:`\u00b1z` direction in a :math:`\\hat{x} \u00d7\n    \\hat{y} = \\hat{z}` coordinate system.\n\n    Parameters\n    ----------\n    B0 : `~astropy.units.Quantity`\n         Magnitude of magnetic field in the limit of :math:`y \u2192 \u221e` in\n         units convertible to teslas.\n\n    delta : `~astropy.units.Quantity`\n        The thickness of the current sheet in units convertible to\n        meters.\n\n    P0 : `~astropy.units.Quantity`\n        The plasma pressure in the limit of :math:`y \u2192 \u221e` in units\n        convertible to pascals.\n\n    Notes\n    -----\n    A current sheet is current limited to a surface.\n\n    A Harris sheet is a 1D ideal MHD equilibrium. In resistive MHD if\n    there is any resistivity, it won't be a true equilibrium since the\n    resistivity will gradually smooth the profile out over time.\n\n    A Harris sheet is often used as the initial condition for\n    simulations of magnetic reconnection.\n\n    Examples\n    --------\n    >>> import astropy.units as u\n    >>> harris_sheet = HarrisSheet(delta=3 * u.m, B0=2 * u.T)\n    >>> harris_sheet.magnetic_field(y=5 * u.m)\n    <Quantity 1.8622... T>\n    \"\"\"\n\n    def __init__(self, B0, delta, P0=0 * u.Pa) -> None:\n        self.B0 = B0\n        self.delta = delta\n        self.P0 = P0\n\n    @validate_quantities\n    def magnetic_field(self, y: u.Quantity[u.m]) -> u.Quantity[u.T]:\n        r\"\"\"\n        Compute the magnetic field.\n\n        In this equation, :math:`B_0` is the asymptotic magnitude of the\n        magnetic field for :math:`y \u2192 \u00b1\u221e` and :math:`\u03b4` is the thickness\n        of the sheet.\n\n        .. math::\n\n            B_x(y) = B_0 \\tanh \\left( \\frac{y}{\u03b4} \\right)\n\n        Parameters\n        ----------\n        y : `~astropy.units.Quantity`\n           Orthogonal distance from the current sheet center.\n        \"\"\"\n        return self.B0 * np.tanh(u.rad * y / self.delta)\n\n    @validate_quantities\n    def current_density(self, y: u.Quantity[u.m]) -> u.Quantity[u.A / u.m**2]:\n        r\"\"\"\n        Compute the current density.\n\n        .. math::\n\n          J_z(y) = - \\frac{B_0}{\u03b4 \u03bc_0) \\mathrm{sech}^2 \\left( \\frac{y}{\u03b4} \\right)\n\n        Parameters\n        ----------\n        y : `~astropy.units.Quantity`\n          Orthogonal distance from the current sheet center.\n        \"\"\"\n        return (\n            -self.B0 / (self.delta * const.mu0) * np.cosh(u.rad * y / self.delta) ** -2\n        )\n\n    @validate_quantities\n    def plasma_pressure(self, y: u.Quantity[u.m]) -> u.Quantity[u.Pa]:\n        r\"\"\"\n        Compute plasma pressure.\n\n        .. math::\n\n            p(y) = \\frac{B_0^2}{2 \u03bc_0} \\mathrm{sech}^2 \\left( \\frac{y}{\u03b4} \\right) + p_0\n\n        Parameters\n        ----------\n        y : `~astropy.units.Quantity`\n          Orthogonal distance from the current sheet center.\n        \"\"\"\n        return (\n            self.B0**2 / (2 * const.mu0) * (np.cosh(u.rad * y / self.delta) ** -2)\n            + self.P0\n        )\n", "path": "src/plasmapy/plasma/equilibria1d.py"}]}