Skip to content

Update with forthcoming numpy changes #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 20, 2018

Conversation

oleksandr-pavlyk
Copy link
Contributor

Fixes #4 .

Python 3.6.3 |Intel Corporation| (default, Apr 19 2018, 16:39:15)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import numpy as np, mkl_fft

In [2]: x = np.random.randn(4,4,4)

In [3]: y = mkl_fft._numpy_fft.rfftn(x)

In [4]: yc = y.copy()

In [5]: z = mkl_fft._numpy_fft.irfftn(y)

In [6]: np.allclose(y, yc)
Out[6]: True

In [7]: np.allclose(z, x)
Out[7]: True

NumPy has renamed `numpy.core.multiarray_tests` to `numpy.core._multiarray_tests` in its master branch.

Make code work with current development version of NumPy.
Because assignment `a[tind] = func(...)` amounts to overwriting
data in array `a`, a copy is needed, if not already made.

```ipython
In [1]: import numpy as np, mkl_fft

In [2]: x = np.random.randn(4,4,4)

In [3]: xc = x.copy()

In [4]: y = mkl_fft._numpy_fft.rfftn(x)

In [5]: yc = y.copy()

In [6]: z = mkl_fft._numpy_fft.irfftn(y)

In [7]: np.allclose(y, yc)
Out[7]: True

In [8]: np.allclose(z, x)
Out[8]: True
```
@oleksandr-pavlyk oleksandr-pavlyk merged commit 95223b0 into master Apr 20, 2018
@oleksandr-pavlyk oleksandr-pavlyk deleted the update-with-forthcoming-numpy-changes branch April 20, 2018 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

irfftn corrupts input when dimensions >=3
1 participant