PlasmaPy v2024.5.0 (2024-05-08)
New Features
Replaced
plasmapy.utils.data.downloader.get_filewith a new classDownloaderwith a methodget_filewhich downloads resource files from PlasmaPy’s data repository. (#2570)Added support for new
background,ion_muandion_zfitting parameters to thespectral_density_modelfunction. (#2636)
Documentation Improvements
Added the
internalcategory for changelog entries, which will be used to denote refactorings with minimal impact on the API, and updated the Changelog Guide to reflect these changes. (#2441)Updated the docstring of
particle_input()to indicate that annotations for optional parameters should now beParticleLike | NoneorParticleListLike | None. (#2505)Added known limitations of
particle_input()to its docstring. (#2516)Removed references to PlasmaPy’s Twitter account, which is no longer used. (#2522)
Updated the docstring for
gyroradiusto finish an unfinished sentence. (#2560)Updated the instructions in the Documentation Guide on how to build PlasmaPy’s documentation locally. (#2565)
Fixed a typo in description of
mass_density. (#2588)Updated the Testing Guide to reflect recent performance improvements with tox via the
tox-uvextension, and the Documentation Guide to reflect that the documentation is now built with Nox instead of tox (#2590)Added examples to the docstring for
thermal_bremsstrahlung. (#2618)Updated the dependency version support policy in the Coding Guide 👾. (#2670)
Backwards Incompatible Changes
Changed the minimum required version of Python from 3.9 to 3.10. (#2501)
Modified
common_isotopes,known_isotopes, andknown_isotopesto each return aParticleList. (#2559)Added a new keyword
particlewiseto the methodis_categoryofParticleList, which now causes the function to return aboolfor the whole list by default. The old functionality is still available by settingparticlewisetoTrue. (#2648)
Bug Fixes
Fixed an error when
lorentzfactorand multiple particles are provided togyroradius. (#2542)Required UTF-8 encoding to be used for generating citation output. (#2578)
Fixed a bug in
particle_input()where particle categorization criteria had not been applied to arguments that became aParticleList. (#2594)Made
spectral_density_modelcompatible with the new version oflmfit==1.3.0. (#2623)Fixed a bug when
thermal_bremsstrahlungis given multiple input density values. (#2627)Fixed the requirements file used by binder to open notebooks. (#2672)
Internal Changes and Refactorings
Changed type hint annotations to be consistent with PEP 604. Most type unions are now made using the
|operator rather than withtyping.Union. (#2504)Refactored, parametrized, and expanded the tests for
Debye_length. (#2509)Changed type hint annotations that used
numbers.Integral,numbers.Real, ornumbers.Complexto instead useint,float, orcomplex, respectively. (#2520)Created a tox environment for regenerating requirements files used in continuous integration (CI) and by integrated development environments (IDEs). This environment is now what is being used in the automated pull requests to regenerate requirements files. Switching from
pip-compiletouv pip compilenow allows requirements files to be created for multiple versions of Python, as well as for minimal versions of dependencies. (#2523)Reduced the cognitive complexity of
gyroradius. (#2542)Added and updated type hint annotations within
plasmapy.formulary. (#2543)Applied caching through GitHub Actions to speed up continuous integration tests and documentation builds. Because the Python environments used by tox to run tests no longer need to be recreated every time tests are run, caching speeds up several continuous integration tests by ∼2–3 minutes. See #2585 to learn more about recent efforts to drastically speed up PlasmaPy’s continuous integraiton checks. (#2552)
Removed
setup.py. (#2558)Added
sphinx-lintas a pre-commit hook to find reStructuredText errors. (#2561)Enabled the tox-uv plugin to tox, so that package installation, caching, and the creation of virtual environments will be handled by uv instead of pip. This change makes it faster to run tests both locally and via GitHub Actions. (#2584)
Changed the project structure to an src layout to follow the updated recommendation from the Python Packaging Authority’s packaging guide. The motivation for this change is described in #2581. Source code previously in
plasmapyis now located insrc/plasmapyand tests are now in a separatetestsdirectory. Tests previously inplasmapy/**/testsare now intests/**/, where**refers to an arbitrary number of subdirectories. For example, the source code ofplasmapy.formularyis now located insrc/plasmapy/formularyand the tests forplasmapy.formularyare now intests/formulary. (#2598)Reconfigured the auto-generated requirements files used during continuous integration and for documentation builds, while adding corresponding documentation. (#2650)
Added
noxfile.pyas a configuration file for Nox. This file initially contains environments for building documentation, checking hyperlinks, and performing static type checking with mypy (#2654)Began using Nox for some testing environments in GitHub Actions, including for the documentation build and static type checking. (#2656)
Additional Changes
Updated type hint annotations in
plasmapy.particles. (#2458)Added
pytest-rerunfailuresto thetestsset of dependencies defined inpyproject.toml, and applied it to a test that experiences intermittent failures. (#2483)Added a flag to
require_quantitiesto silence warnings when a quantity is not provided and is assumed to be zero everywhere. Modifiedplasmapy.simulation.particle_tracker.ParticleTrackerto not display this warning for the \(\mathbf{E}\) and \(\mathbf{B}\) field components, since one of these is often not explicitly provided. (#2519)Removed the unused
py310-condatox environment. (#2526)Exposed
StixTensorElementsandRotatingTensorElementsto the public API. (#2543)Added tests to verify correctness of two properties in
MaxwellianCollisionFrequencies. (#2614)