PlasmaPy v2024.7.0 (2024-07-21)

New Features

Documentation Improvements

Backwards Incompatible Changes

  • Added a __str__ method to the CustomParticle class that returns the symbol of the particle if provided, and otherwise falls back to using __repr__. (#2702)

  • Changed default keyword argument for the fraction_exited_threshold in Tracker and AllParticlesOffGridTerminationCondition to correspond with the fraction of particles that have entered and subsequently exited the grids. Previously this keyword was a misnomer, causing the simulation to instead terminate when the specified fraction of particles remaining on the grids was less than or equal to the provided fraction_exited_threshold. (#2712)

  • Convert particle to a required argument of the load_particles method of ParticleTracker. (#2746)

Bug Fixes

  • Enabled validate_quantities() to be compatible with postponed evaluation of annotations (see PEP 563). (#2479, #2506)

  • Changed the charge number (\(Z\)) dependence of the ion contribution to the optical Thomson scattering spectral density function in spectral_density_lite from \(Z\) to \(z^2 / \bar{z}\) to match Eq. 5.1.2 and following equations in Sheffield et al. [2011]. The result is a small change in the ion acoustic wave spectrum for plasmas with multiple ion species. (#2699)

  • Added axes removed by numpy.squeeze to arrays in mhd_waves_ (#2715)

Internal Changes and Refactorings

  • Converted the tox environment for regenerating the requirements files used in continuous integration checks to Nox. (#2664)

  • Created a parametrized Nox session to run tests. (#2681)

  • Added Nox sessions to test importing PlasmaPy, validating CITATION.cff, and building a source distribution and wheel. (#2682)

  • Switched the GitHub workflows for running tests from using tox environments to using Nox sessions. (#2685)

  • Added pytest-filter-subpackage to the tests dependency set. This dependency enables us to run, for example, pytest -P particles to invoke tests for plasmapy.particles. (#2688)

  • Added Nox sessions to run tests and build documentation against unreleased versions of major dependencies. (#2694)

  • Deleted tox.ini, since all tox environments defined therein have been converted to Nox sessions. (#2694)

  • Removed requirements.txt, along with the requirements files in ci_requirements/ that were used in tox environments that have since been replaced with Nox sessions. (#2694)

  • Switched over weekly tests to use Nox sessions rather than tox environments. (#2694)

  • Added the lint and manifest sessions for Nox to run pre-commit on all files and verify MANIFEST.in with check-manifest, respectively. (#2695)

  • Added a Nox session that invokes autotyping to automatically add type hint annotations, using either the --safe or --aggressive options. (#2696)

  • Added typos as a pre-commit hook to perform spellchecking. (#2700)

  • Added a condition to check if the GitHub API can be reached to be used by the Downloader object. (#2710)

  • Applied type hint annotations using autotyping, and made other updates to type hint annotations and docstrings. (#2728)

  • Added type hint annotations to plasmapy.utils.roman. (#2733)

  • Added type hint annotations to plasmapy.utils._units_helpers. (#2734)

  • Added a Nox session for building the changelog. (#2744)

  • Added an experimental Nox session for adding type hint annotations using MonkeyType. This session creates a database of variable types from running pytest, and then applies the observed types to a particular module. (#2747)

  • Updated Nox sessions, including docstrings and troubleshooting messages. (#2750)

  • Enabled tests to pass with numpy == 2.0.0. (#2772)

Additional Changes

  • Refactored Tracker to use ParticleTracker. (#2704)

  • Included src/plasmapy/_version.py in MANIFEST.in. This file is automatically generated using setuptools_scm, but is necessary for the version to be correct in the titles of pages in development documentation builds. (#2756)

  • Updated the comment that gets posted to new pull requests via a GitHub workflow. (#2765)