From 061a1890b670c567cced027d8d81d67f3f32f58c Mon Sep 17 00:00:00 2001 From: Vahid Tavanashad Date: Wed, 28 May 2025 09:22:00 -0700 Subject: [PATCH] workaround for circular dependency --- mkl_fft/interfaces/numpy_fft.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mkl_fft/interfaces/numpy_fft.py b/mkl_fft/interfaces/numpy_fft.py index 6ab7e795..5653ff13 100644 --- a/mkl_fft/interfaces/numpy_fft.py +++ b/mkl_fft/interfaces/numpy_fft.py @@ -24,9 +24,6 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Added for completing the namespaces -from numpy.fft import fftfreq, fftshift, ifftshift, rfftfreq - # pylint: disable=no-name-in-module from ._numpy_fft import ( fft, @@ -60,8 +57,11 @@ "irfftn", "hfft", "ihfft", - "fftshift", - "ifftshift", - "fftfreq", - "rfftfreq", ] + +# It is important to put the following import here to avoid circular imports +# when patching numpy with mkl_fft +# Added for completing the namespaces +from numpy.fft import fftfreq, fftshift, ifftshift, rfftfreq + +__all__ += ["fftshift", "ifftshift", "fftfreq", "rfftfreq"]