Skip to content
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

structured_2d issue from call: gamma_x = vario_estimate_structured(herten_trans_skip, direction='x') #18

Closed
ChristopherFowler opened this issue Apr 30, 2019 · 7 comments

Comments

@ChristopherFowler
Copy link

ChristopherFowler commented Apr 30, 2019

When running the example Estimating the Variogram in Specific Directions I get the following error:

Estimating structured variograms
Traceback (most recent call last):
File "real.py", line 111, in
gamma_x = vario_estimate_structured(herten_trans_skip, direction='x')
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gstools/variogram/variogram.py", line 170, in vario_estimate_structured
gamma = structured_2d(field)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gstools/variogram/py_estimator.py", line 100, in structured_2d
raise NotImplementedError(__EXCEPT_MSG)
NotImplementedError: A pure Python version is not yet implemented. Only a Cython version is available.

It is true that when I run the script: usr$ python3 real.py
Warning: No Cython functions imported

shows up. I'm not sure how to resolve this issue. Have you guys run into this issue with the examples that use the structured_2d function?

I'm on a Mac but I'm hoping that this issue isn't OS dependent.

Chris

@MuellerSeb
Copy link
Member

Hey Chris, thanks for your feedback.
It seems, that your package wasn't installed by a wheel so it was build locally. In this case it is checked if cython is installed and if not, the python implementations of the variogram routines are used. These routines don't contain an estimator for structured fields yet, thats why the error:

NotImplementedError: A pure Python version is not yet implemented. Only a Cython version is available.

From your error-log I see, that you are using python3.7.. and there is the problem, since we don't provide wheels for python3.7 on mac yet.
What you can try is the following:

pip install cython
pip install -I gstools

If you have installed it via pip (or with pip3 maybe).
Then cython should be installed and gstools should be reinstalled with cython support. If the error from above comes again (or even cython fails to install), you maybe don't have a c-compiler installed. In this case follow the instructions from here: https://cython.readthedocs.io/en/latest/src/quickstart/install.html
to install Apple’s XCode and to get gcc.
Then run the following command again:

pip install -I gstools

Maybe you also have to reinstall cython. I don't know how cython reacts to a missing compiler.
I hope this is helping you! Good luck!

Sebastian

@ChristopherFowler
Copy link
Author

ChristopherFowler commented Apr 30, 2019 via email

@MuellerSeb
Copy link
Member

MuellerSeb commented Apr 30, 2019

Nice to hear it worked!
The -I flag just forces a reinstall and this is in my opinion a pip related problem and not at all Mac specific. I think there was a previous installed version of gstools in your Python package list which was lacking the cython routines and it was not updated by pip since it was the latest version.. So I think putting this in the documentation would be a bit misleading since it's a workaround for a pip related problem.
Hope you understand that! But thanks for using and the feedback!
Sebastian

@ChristopherFowler
Copy link
Author

ChristopherFowler commented May 1, 2019 via email

@MuellerSeb
Copy link
Member

If you have any recommendations on tools, methods, models that would fit into the package, don't hesitate to write an issue! We are happy for feedback!
We are working on a publication for citing. At the moment you can cite the code from Zenodo!

@ChristopherFowler
Copy link
Author

ChristopherFowler commented May 2, 2019 via email

@MuellerSeb
Copy link
Member

I now put a little hint in the README about the -I flag, if something is going wrong during installation.

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

No branches or pull requests

2 participants