Tutorial 2 fails in spod.get_data
Hello, when running the tutorial 2,in the line 138 'data = spod.get_data(data)' and the error shows up. Could anyone give me a hand to solve it? Best wishes! XUxu
The error log is shown as below:
Reconstructed data saved in: D:\spod\PySPOD-main\tutorials\tutorial2\spod_results\nfft730_novlp0_nblks10\coeffs_0_365\reconstructed.npy
Elapsed time: 0.45338940620422363 s.
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1762: ComplexWarning: Casting complex values to real discards the imaginary part
return math.isfinite(val)
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1398: ComplexWarning: Casting complex values to real discards the imaginary part
return np.asarray(x, float)
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1762: ComplexWarning: Casting complex values to real discards the imaginary part
return math.isfinite(val)
C:\ProgramData\anaconda3\envs\spodProject\lib\site-packages\matplotlib-3.9.0-py3.9-win-amd64.egg\matplotlib\cbook.py:1398: ComplexWarning: Casting complex values to real discards the imaginary part
return np.asarray(x, float)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2023.3.2\plugins\python\helpers\pydev\pydevd.py", line 1534, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2023.3.2\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:\spod\PySPOD-main\tutorials\tutorial2\tutorial2.py", line 138, in
@MemorXuxu Thank you for raising this issue. Do you have a minimum reproducible example?
@MemorXuxu Thank you for raising this issue. Do you have a minimum reproducible example?
Hello,Mengaldo
I run the tutorial 2 (https://github.com/MathEXLab/PySPOD/tree/main/tutorials/tutorial2) under folder test and it cannot run successfully, The error occor at data = spod.get_data(data) at line 136.
Moreover, the version of numpy is 1.26.4. And I find that the newer version of numpy (2.0.0) cannot be used. I guest whether the version of numpy is wrong since the requirement of pyspod doesn't exist.
@MemorXuxu Thank you for raising this issue. Do you have a minimum reproducible example?
Interestingly, the code in test_tutorial can run scuccessfully while the single tutorial under Tutorial folder can't since the code between them is different. I think it's a small mistake and I believe the code under test is rigth!
@MemorXuxu Thank you for spotting this! Do you want to contribute suggesting the modification needed?
@mengaldo It's OK if it's convient ^_^. BTW,it's a great library and I'm happy that I can make a small contribution to it.
Another question, I don't whether I should create a new issus or not. When the SPOD is all calculated, how can I save all the state in JupyterBook or Python. When I need to post-processing the result, I need to perform all the calculation again which costs much time. However, in the result folder, there are many results(.npy) and I think it's the finally result of SPOD. Is it possible to just specify the results_dir data or anything eles to reload these results for postprocessing and visualization.
@MemorXuxu Thank you! Yes, you should be able to save the results and reload them for post processing, without recalculating them every time. Not sure however whether we show how. To do this, we should load the .npy files of the modes, and the .npz file with the frequencies, and manually plot the modes, using the routines in post processing.
@mengaldo Thank you very much!
I have fixed it now. Later I would like to raise a pull, after fixing more bugs.