PlasmaPy v2024.5.0 (2024-05-08)

New Features

Documentation Improvements

  • Added the internal category 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 be ParticleLike | None or ParticleListLike | 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 gyroradius to finish an unfinished sentence. (#2560)

  • Updated the instructions in the Documentation Guide on how to build PlasmaPy’s documentation locally. (#2565)

  • Fix typo in description of mass_density. (#2588)

  • Updated the Testing Guide to reflect recent performance improvements with tox via the tox-uv extension, and the Documentation Guide to reflect that the documentation is now built with nox instead of tox (#2590)

  • Add examples to the docstring for thermal_bremsstrahlung. (#2618)

  • Update the dependency version support policy in the Coding Guide. (#2670)

Backwards Incompatible Changes

Bug Fixes

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 with typing.Union. (#2504)

  • Refactored, parametrized, and expanded the tests for Debye_length. (#2509)

  • Changed type hint annotations that used numbers.Integral, numbers.Real, or numbers.Complex to instead use int, float, or complex, 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-compile to uv pip compile now 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-lint as 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 plasmapy/ is now located in src/plasmapy/ and tests are now in a separate tests/ directory. Tests previously in plasmapy/**/tests/ are now in tests/**/, where ** refers to an arbitrary number of subdirectories. For example, the source code of plasmapy.formulary is now located in src/plasmapy/formulary/ and the tests for plasmapy.formulary are now in tests/formulary/. (#2598)

  • Reconfigured the auto-generated requirements files used during continuous integration and for documentation builds, while adding corresponding documentation. (#2650)

  • Added noxfile.py as 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