Package utilities (plasmapy.utils)
Introduction
The utils subpackage contains functionality that is needed
across multiple subpackages or does not fit nicely in any other
subpackage. Functionality contained in utils includes:
Warnings and exceptions used in PlasmaPy, such as
RelativityWarningorPhysicsError.Decorators we use for reusable physical
Quantitycomputation and checking, such asvalidate_quantitiesandcheck_relativistic.Helper utilities for importing and testing packages.
Functionality for downloading files from PlasmaPy’s data repository.
API
plasmapy.utils.decorators Package
A module to contain various decorators used to build readable and useful code.
Sub-Packages & Modules
Decorator for checking input/output arguments of functions. |
|
Decorators to convert units. |
|
Decorators to mark objects that are deprecated. |
|
Miscellaneous decorators for various package uses. |
|
|
Module for defining functionality that marks and handle Lite-Function creation. |
Various decorators to validate input/output arguments to functions. |
Classes
|
Base class for 'Check' decorator classes. |
|
A decorator class to 'check' — limit/control — the units of input and return arguments to a function or method. |
|
A decorator class to 'check' — limit/control — the values of input and return arguments to a function or method. |
|
A decorator class to 'validate' -- control and convert -- the units and values of input and return arguments to a function or method. |

Functions
A decorator that enables a function to convert its return value from angular frequency (rad/s) to frequency (Hz). |
|
|
Decorator to bind a lightweight "lite" version of a formulary function to the full formulary function, as well as any supporting attributes. |
|
Warns or raises an exception when the output of the decorated function is greater than |
|
A decorator to 'check' — limit/control — the units of input and return arguments to a function or method. |
|
A decorator to 'check' — limit/control — the values of input and return arguments to a function or method. |
|
A wrapper of |
|
A decorator which programmatically prepends and/or appends the docstring of the decorated method/function. |
A decorator for decorators, which preserves the signature of the function being wrapped. |
|
|
A decorator responsible for raising errors if the expected arguments weren't provided during class instantiation. |
|
A decorator to 'validate' — control and convert — the units and values of input and return arguments to a function or method. |
plasmapy.utils.exceptions Module
Exceptions and warnings specific to PlasmaPy.
Exceptions
An exception to be raised when the input is not a valid Roman numeral. |
|
An exception to be raised for integers that outside of the range that can be converted to Roman numerals. |
|
The base exception for physics-related errors. |
|
Base class of PlasmaPy custom errors. |
|
An exception for speeds greater than the speed of light. |
|
A base exception for errors from |

Warnings
A warning for functions that rely on a particular coupling regime to be valid. |
|
The base warning for warnings related to non-physical situations. |
|
A warning for deprecated features when the warning is intended for other Python developers. |
|
A warning for deprecated features when the warning is intended for end users of PlasmaPy. |
|
Base class of PlasmaPy custom warnings. |
|
A warning for when relativistic velocities are being used in or are returned by non-relativistic functionality. |

plasmapy.utils.code_repr Module
Tools for formatting strings, including for error messages.
Functions
|
Approximate the command to instantiate a class, and access an attribute of the resulting class instance. |
|
Approximate a call of a function or class with positional and keyword arguments. |
|
Approximate the command to instantiate a class, and then call a method in the resulting class instance. |
plasmapy.utils.calculator Package
Subpackage formerly containing a prototype plasma calculator.
Important
The plasma calculator has been removed from PlasmaPy so that it can be included in the plasmapy-calculator standalone package.
Functions
|
Plasma calculator. |
plasmapy.utils.data Package
The plasmapy.utils.data subpackage contains functionality for
downloading and retrieving data files.
Sub-Packages & Modules
Contains functionality for downloading files from a URL. |
Classes
|
Accesses the PlasmaPy resource files. |

Variables & Attributes
Returns True when the argument is true, False otherwise. |