PlasmaPy v2023.10.0 (2023-10-20)
Backwards Incompatible Changes
Renamed the
plasmapy.dispersion.dispersionfunctionmodule toplasmapy.dispersion.dispersion_functions. Both ofplasma_dispersion_funcandplasma_dispersion_func_derivare temporarily still available, but will issue aPlasmaPyFutureWarningand will be removed in a subsequent release. (#2271)Removed the lite-functions for
plasma_dispersion_funcandplasma_dispersion_func_deriv. Instead, the performance of the original functions has been improved by using atryandexceptblock instead of having multipleifstatements to check for preconditions. (#2361)Providing a real number to the
chargeparameter inCustomParticlewill now result in aInvalidParticleErrorinstead of a deprecation warning. Now,chargemust be aQuantitywith units of electrical charge. To express the charge as a multiple of the elementary charge, provide a real number to theZparameter instead. (#2369)
Features
Added the
HarrisSheetclass to calculate magnetic field, current density, and plasma pressure for 1D Harris sheets. (#2068)Added module
plasmapy.dispersion.analytical.mhd_waves_with classes for storing and calculating parameters of magnetohydrodynamic waves. (#2206)Added the
plasmapy.analysis.time_series.conditional_averagingmodule including theConditionalEventsclass for calculating the conditional average and variance of time series. (#2275)Added the
ForceFreeFluxRopeclass to calculate magnetic field for the Lundquist solution for force-free cylindrical equilibria. (#2289)
Bug Fixes
Fixed a bug that had been causing incorrect results in
temp_ratio. (#2248)Enabled the
time_stepparameter inExcessStatisticsclass to be aQuantitywith a unit. (#2300)
Improved Documentation
Updated the code contribution workflow in the Contributor Guide to describe how to use
git pull. (#2193)Expanded the troubleshooting section of the Documentation Guide to describe how to resolve warnings related to documents not being included in any toctrees. (#2257)
Added a step to the code contribution workflow about using
git statusto verify that there have been no changes to tracked files before creating and switching to a new branch. (#2263)Added a page to the Contributor Guide about pre-commit, including how to troubleshoot test failures. (#2265)
Added
CONTRIBUTING.mdto PlasmaPy’s GitHub repository. This page refers contributors to PlasmaPy’s Contributor Guide. (#2266)Enabled the
sphinx.ext.durationextension to show the times required to process different pages during documentation builds. (#2268)Enabled the
sphinx.ext.viewcodeextension for adding links in the documentation to pages containing the source code. (#2269)Moved definitions of certain reStructuredText substitutions from
docs/common_links.rstto the filedocs/contributing/doc_guide.rstin order to speed up the documentation build (see #2277). (#2272)Implemented
sphinxcontrib-globalsubsto enable global reStructuredText substitutions to be used throughout the documentation, and moved the definition of substitutions fromdocs/common_links.rstto theglobal_substitutionsdictindocs/_global_substitutions.py. (#2281)Changed
from astropy import units as utoimport astropy.units as uandfrom astropy import constants as consttoimport astropy.constants as constthroughout the code in order to increase consistency of import statements. (#2282)Added and applied
nbqa-ruffto our suite of pre-commit hooks so that ruff can perform code quality checks on our example notebooks. (#2302)Renamed
docs/cff_to_rst.pytodocs/_cff_to_rst.py, and updated the functionality contained within that file for converting author information inCITATION.cffinto a reStructuredText author list to be included in the documentation. (#2307)Fixed broken hyperlinks and reStructuredText references. (#2308)
Replaced
from plasmapy.particles import *indocs/notebooks/getting_started/particles.ipynbwith imports of the actual functions and classes that were used. (#2311)Applied minor refactorings and formatting improvements to
docs/notebooks/dispersion/stix_dispersion.ipynb. (#2312)Updated the Coding Guide by discussing when to use aliases and applied the
:py:role so that in-line code gets formatted the same as Python code blocks. (#2324)Updated the docstrings and type hint annotations in
plasmapy.formulary.lengths. (#2356)Refactored
docs/conf.pyto improve organization. (#2363)Updated the narrative documentation on particle objects to include
CustomParticle,DimensionlessParticle, andParticleListobjects. (#2377)
Trivial/Internal Changes
Modernized
MANIFEST.in. (#2189)Applied automated refactorings from Sourcery. (#2219)
Distributions defined in the
distributionmodule will now raise aValueErrorfor an improperunitsparameter. (#2229)Added “decorators” section to the Coding Guide. (#2231)
Improved the error message issued by
Alfven_speedwhen the argument provided todensityhas a physical type of number density andionis not provided. (#2262)Exposed
plasmapy.dispersion.analyticalandplasmapy.dispersion.numericalto theplasmapy.dispersionnamespace. (#2271)Expanded the ruff settings to include more linter rules. (#2295)
Added ruff linter rules that check for
printandpprint, as thelogginglibrary is generally preferred for production code. (#2296)Updated and corrected author information in
CITATION.cff. (#2307)Reduced the number of warnings emitted by
plasmapy.particlesduring tests by decorating test functions withpytest.mark.filterwarnings. (#2314)Fixed a
pytestdeprecation warning that had been issued byplasmapy.utils._pytest_helpers/pytest_helpers.run_testso thatNoneis no longer passed to thepytest.warnscontext manager. (#2314)Changed the default configuration for
pytestso that if a test is marked as expected to fail actually passes, then that test will issue an error to indicate that thepytest.mark.xfailmark can be removed. (#2315)Added a weekly linkcheck test that verifies that hyperlinks in the documentation are up-to-date. (#2328)
Enabled
validate_quantities()to accept annotations of the formu.Quantity[u.m], where we have previously runimport astropy.units as u. (#2346)Both
plasma_dispersion_funcandplasma_dispersion_func_derivnow allowinfandnanarguments without raising aValueError. (#2361)Modified the
charge_numberattribute ofCustomParticleto return a real number rather than a dimensionlessQuantity. (#2377)Made minor updates to
plasmapy/__init__.py, including to the top-level package docstring. (#2378)Improved the consistency and specificity of the names of various GitHub Actions. (#2379)
Added a pre-commit hook to validate GitHub Actions. (#2380)