bluemira.magnetostatics.tools ============================= .. py:module:: bluemira.magnetostatics.tools .. autoapi-nested-parse:: Just-in-time compilation and LowLevelCallable speed-up tools. Functions --------- .. autoapisummary:: bluemira.magnetostatics.tools.process_xyz_array bluemira.magnetostatics.tools.process_coords_array bluemira.magnetostatics.tools.jit_llc7 bluemira.magnetostatics.tools.jit_llc5 bluemira.magnetostatics.tools.jit_llc4 bluemira.magnetostatics.tools.jit_llc3 bluemira.magnetostatics.tools.integrate bluemira.magnetostatics.tools.n_integrate Module Contents --------------- .. py:function:: process_xyz_array(func) Decorator for coordinate input handling in array-return functions and methods. :returns: decorator :rtype: wrapper :raises MagnetostaticsError: Coordinates must be the same length and 1D or 2D .. py:function:: process_coords_array(shape: numpy.ndarray | bluemira.geometry.coordinates.Coordinates) -> numpy.ndarray Parse Coordinates or array to an array. :param shape: The Coordinates or array to make into a coordinate array :returns: Array in proper dimensions :rtype: shape :raises MagnetostaticsError: Unknown Type .. py:function:: jit_llc7(f_integrand: collections.abc.Callable) -> scipy.LowLevelCallable Decorator for 6-argument integrand function to a low-level callable. :param f_integrand: The integrand function :returns: The decorated integrand function as a LowLevelCallable .. py:function:: jit_llc5(f_integrand: collections.abc.Callable) -> scipy.LowLevelCallable Decorator for 4-argument integrand function to a low-level callable. :param f_integrand: The integrand function :returns: The decorated integrand function as a LowLevelCallable .. py:function:: jit_llc4(f_integrand: collections.abc.Callable) -> scipy.LowLevelCallable Decorator for 3-argument integrand function to a low-level callable. :param f_integrand: The integrand function :returns: The decorated integrand function as a LowLevelCallable .. py:function:: jit_llc3(f_integrand: collections.abc.Callable) -> scipy.LowLevelCallable Decorator for 2-argument integrand function to a low-level callable. :param f_integrand: The integrand function :returns: The decorated integrand function as a LowLevelCallable .. py:function:: integrate(func: collections.abc.Callable, args: collections.abc.Iterable, bound1: float, bound2: float) -> float Utility for integration of a function between bounds. Easier to refactor integration methods. :param func: The function to integrate. The integration variable should be the last argument of this function. :param args: The iterable of static arguments to the function. :param bound1: The lower integration bound :param bound2: The upper integration bound :returns: The value of the integral of the function between the bounds :raises MagnetostaticsIntegrationError: Integration failed .. py:function:: n_integrate(func: collections.abc.Callable, args: collections.abc.Iterable, bounds: list[collections.abc.Iterable[int | float]]) -> float Utility for n-dimensional integration of a function between bounds. Easier to refactor integration methods. :param func: The function to integrate. The integration variable should be the last argument of this function. :param args: The iterable of static arguments to the function. :param bounds: The list of lower and upper integration bounds applied to x[0], x[1], .. :returns: The value of the integral of the function between the bounds