Visitar URL original
Add examples to ForceFreeFluxRope docstring by yassineAlouini · Pull Request #3234 · PlasmaPy/PlasmaPy · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review feedback for ForceFreeFluxRope docstring
- Fix alpha and B0 type hints in __init__ (were untyped/float, now
  correctly annotated as Quantity with appropriate units)
- Add import for astropy.units needed by the new type hints
- Add towncrier changelog entry (2531.doc.rst)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
  • Loading branch information
yassineAlouini and claude committed Mar 7, 2026
commit 0e1c7aac249167733fbeabca0ea84b244dc31071
1 change: 1 addition & 0 deletions changelog/2531.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added docstring examples to `~plasmapy.plasma.cylindrical_equilibria.ForceFreeFluxRope` demonstrating how to instantiate the class and call `B_z`, `B_theta`, and `B_magnitude`.
3 changes: 2 additions & 1 deletion src/plasmapy/plasma/cylindrical_equilibria.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Classes for representing cylindrical equilibria."""

import astropy.units as u
import numpy as np
import scipy.special

Expand Down Expand Up @@ -38,7 +39,7 @@ class ForceFreeFluxRope:
<Quantity 2. T>
"""

def __init__(self, B0, alpha: float) -> None:
def __init__(self, B0: u.Quantity[u.T], alpha: u.Quantity[1 / u.m]) -> None:
self.B0 = B0
self.alpha = alpha

Expand Down
Loading