wafo-project / pywafo

Wave Analysis for Fatigue and Oceanography
http://www.maths.lth.se/matstat/wafo/
Other
94 stars 42 forks source link

Issues with Rind not being loaded #16

Closed eelcovv closed 8 years ago

eelcovv commented 8 years ago

Hello, I have installed pywafo and tried to run the tutorials but I am running into some issues. From chapter 1 I have here given the smallest example to raise the error I have installed the pywafo project from this repository, but also tried the anaconda version which gives the same error

The example is:

import wafo.spectrum.models as wsm
import wafo.objects as wo

try:
    from win32api import LoadResource
except ImportError:
    pass

S = wsm.Torsethaugen(Hm0=6, Tp=8)
S1 = S.tospecdata()

dtyex = S1.to_t_pdf(pdef='Tt', paramt=(0, 10, 51), nit=3)

Running this code raises the issue

 File "C:/Data/Eelco/Python Scripts/PyCharm/pywafo_examples/tutorial_scripts/bug_example.py", line 14, in <module>
    dtyex = S1.to_t_pdf(pdef='Tt', paramt=(0, 10, 51), nit=3)
  File "C:\Apps\Anaconda\Anaconda2\lib\site-packages\wafo-0.1.2-py2.7.egg\wafo\spectrum\core.py", line 1369, in to_t_pdf
    rind = Rind(**opts)
TypeError: 'NoneType' object is not callable

It appears that Rind is loaded in wafo.gauss, however, this is not done correctly and therefore remains None

Therefore, as a work around I try to force to load wafo.gauss.Rind again before I call the to_t_pdf as

 from wafo.gaussian import Rind 

Now Rind seems to be loaded, but I get the following error

Traceback (most recent call last):
  File "C:/Data/Eelco/Python Scripts/PyCharm/pywafo_examples/tutorial_scripts/bug_example.py", line 14, in <module>
    from wafo.gaussian import Rind
  File "C:\Apps\Anaconda\Anaconda2\lib\site-packages\wafo-0.1.2-py2.7.egg\wafo\gaussian.py", line 7, in <module>
    from wafo import mvn
ImportError: DLL load failed: %1 is not a valid Win32 application.

I am not sure if this error is related to the first problem. Anyhow. Any idea how I could fix this?

Many thanks

Regards Eelco

davidovitch commented 8 years ago

Thanks for reporting this. I hope this problem will be fixed when the pipinstall branch is merged with master. It is further discussed in issue #14.

davidovitch commented 8 years ago

There are still issues when building on Windows. Closing here but the discussion continues in #29.