From efa563d6d148d16ff2b23bcf624f1a80227783b5 Mon Sep 17 00:00:00 2001 From: hugo hadfield Date: Sun, 27 Dec 2020 18:32:09 +0000 Subject: [PATCH] Move general_exp deprecation to the original expected place --- clifford/__init__.py | 7 ++++++- clifford/_multivector.py | 7 +------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clifford/__init__.py b/clifford/__init__.py index a74ef9ef..4d58d12f 100644 --- a/clifford/__init__.py +++ b/clifford/__init__.py @@ -93,9 +93,9 @@ from ._version import __version__ # noqa: F401 from . import _numba_utils -from . import _settings from ._settings import pretty, ugly, eps, print_precision # noqa: F401 +import clifford.taylor_expansions as taylor_expansions # For backwards-compatibility. New code should import directly from `clifford.operator` from .operator import gp, op, ip # noqa: F401 @@ -108,6 +108,11 @@ NUMBA_PARALLEL = not bool(NUMBA_DISABLE_PARALLEL) +def general_exp(x, **kwargs): + warnings.warn("cf.general_exp is deprecated. Use `mv.exp()` or `np.exp(mv)` on multivectors, or `cf.taylor_expansions.exp(x)` on arbitrary objects", DeprecationWarning, stacklevel=2) + return taylor_expansions.exp(x, **kwargs) + + def linear_operator_as_matrix(func, input_blades, output_blades): """ Return a matrix that performs the operation of the provided linear diff --git a/clifford/_multivector.py b/clifford/_multivector.py index e513de13..e2acf6ec 100644 --- a/clifford/_multivector.py +++ b/clifford/_multivector.py @@ -11,11 +11,6 @@ from ._layout_helpers import layout_short_name -def general_exp(x, **kwargs): - warnings.warn("cf.general_exp is deprecated. Use `mv.exp()` or `np.exp(mv)` on multivectors, or `cf.taylor_expansions.exp(x)` on arbitrary objects", DeprecationWarning) - return taylor_expansions.exp(x, **kwargs) - - class MultiVector(object): """An element of the algebra @@ -324,7 +319,7 @@ def __rpow__(self, other) -> 'MultiVector': # else. # pow(x, y) == exp(y * log(x)) - newMV = general_exp(math.log(other) * self) + newMV = taylor_expansions.exp(math.log(other) * self) return newMV