Unreleased changes
PlasmaPy v0.1.dev50+g31d15be (2024-04-22)
New Features
Replaced
plasmapy.utils.data.downloader.get_file
with a new classDownloader
with a methodget_file
which downloads resource files from PlasmaPy’s data repository. (#2570)Added support for new
background
,ion_mu
andion_z
fitting parameters to thespectral_density_model
function. (#2636)
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 beParticleLike | None
orParticleListLike | None
. (#2505)Added known limitations of
particle_input()
to its docstring. (#2516)Removed references to the 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)Add examples to docstring for
thermal_bremsstrahlung
. (#2618)
Backwards Incompatible Changes
Changed the minimum required version of Python from 3.9 to 3.10. (#2501)
Modified
common_isotopes
,known_isotopes
, andknown_isotopes
to each return aParticleList
. (#2559)
Bug Fixes
Fixed an error when
lorentzfactor
and multiple particles are provided togyroradius
. (#2542)Required UTF-8 encoding to be used for generating citation output. (#2578)
Made
spectral_density_model
compatible with the new version oflmfit==1.3.0
. (#2623)Fix a bug when
thermal_bremsstrahlung
is given multiple input density values. (#2627)
Internal Changes and Refactorings
Changed type hint annotations to be consistent with PEP 604. 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.Complex
to 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-compile
touv pip compile
now allows requirements files to be created for multiple versions of Python, as well as for minimal versions of dependencies. (#2523)Refactored
gyroradius
to reduce the cognitive complexity of the function. (#2542)Added and updated type hint annotations across
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. (#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 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 insrc/plasmapy/
and tests are now in a separatetests/
directory. Tests previously inplasmapy/**/tests/
are now intests/**/
, where**
refers to an arbitrary number of subdirectories. For example, the source code ofplasmapy.formulary
is now located insrc/plasmapy/formulary/
and the tests forplasmapy.formulary
are now intests/formulary/
. (#2598)
Additional Changes
Updated type hint annotations in
plasmapy.particles
. (#2458)Added
pytest-rerunfailures
to thetests
set of dependencies, and applied it to a flaky test. (#2483)Added a flag to
require_quantities
to silence warnings when a quantity is not provided and is assumed to be zero everywhere. ModifiedParticleTracker
to not display this warning for the E and B field components, since one of these is often not explicitly provided. (#2519)Exposed
StixTensorElements
andRotatingTensorElements
to the public API. (#2543)Added tests to verify correctness of two properties in
MaxwellianCollisionFrequencies
. (#2614)