Visitar URL original
Add examples to ForceFreeFluxRope docstring by yassineAlouini · Pull Request #3234 · PlasmaPy/PlasmaPy · GitHub
Skip to content

Add examples to ForceFreeFluxRope docstring - #3234

Open
yassineAlouini wants to merge 3 commits into
PlasmaPy:mainfrom
yassineAlouini:fix/issue-2531-forcefreefluxrope-docstring
Open

yassineAlouini wants to merge 3 commits into
PlasmaPy:mainfrom
yassineAlouini:fix/issue-2531-forcefreefluxrope-docstring

Conversation

@yassineAlouini

Copy link
Copy Markdown

Summary

Closes #2531.

  • Adds an Examples section to the ForceFreeFluxRope class docstring showing how to instantiate the class and call B_z, B_theta, and B_magnitude
  • Values at r=0 are mathematically exact (J0(0)=1, J1(0)=0), making the doctests unambiguous
  • Fixes incorrect type hints on __init__: B0 and alpha are now correctly annotated as u.Quantity with appropriate units (was alpha: float)
  • Adds the required import astropy.units as u for the type hints

Test plan

  • Doctest passes: pytest --doctest-modules src/plasmapy/plasma/cylindrical_equilibria.py
  • No regressions in plasma subpackage tests: pytest tests/plasma/

🤖 Generated with Claude Code

yassineAlouini and others added 2 commits February 28, 2026 13:57
Adds an Examples section to the ForceFreeFluxRope class docstring
showing how to instantiate the class and call B_z, B_theta, and
B_magnitude. Values at r=0 are exact (J0(0)=1, J1(0)=0).

Closes PlasmaPy#2531

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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>
@github-actions

Copy link
Copy Markdown

Thank you for submitting this pull request (PR)! ✨

Below are checks that are being run for this PR. Click on the name of a check to learn why it didn't pass. ✅ Don't worry if something broke! We break stuff all the time. 😅

PlasmaPy's contributor guide has pages on:

Tip

📚 For a documentation preview, click on docs/readthedocs.org:plasmapy below. For cryptic documentation errors, see the documentation troubleshooting guide.

Tip

🧹 Automatically fix most pre-commit.ci failures by commenting pre-commit.ci autofix below. For other failures, please see the pre-commit troubleshooting guide.

We thank you once again! 🌌

@github-actions github-actions Bot added plasmapy.plasma Related to the plasmapy.plasma subpackage python Pull requests that update Python code labels Mar 10, 2026
@codecov

codecov Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.59%. Comparing base (0319a2d) to head (d1d28d3).
⚠️ Report is 88 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3234      +/-   ##
==========================================
- Coverage   95.36%   94.59%   -0.77%     
==========================================
  Files         108      108              
  Lines        9872     9873       +1     
  Branches     1501     1501              
==========================================
- Hits         9414     9339      -75     
- Misses        262      332      +70     
- Partials      196      202       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@namurphy namurphy added the AI assisted Pull requests that include AI generated code. label Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted Pull requests that include AI generated code. plasmapy.plasma Related to the plasmapy.plasma subpackage python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add examples to docstring of ForceFreeFluxRope

2 participants