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

warnning when import pylandstats #4

Closed
guof2019 opened this issue Jun 16, 2020 · 10 comments
Closed

warnning when import pylandstats #4

guof2019 opened this issue Jun 16, 2020 · 10 comments

Comments

@guof2019
Copy link

Dear sir,
When I run import pylandstats as pls in pycharm, it shows warnning. Module C:\Softwares\20.Python\Lib\site-packages\pylandstats\landscape.py has not been compiled for Transonic-Numba.
What does it mean and how should I solve this problem?
Thanks for your help.

@martibosch
Copy link
Owner

in order to address this, I'd need more information about your environment. There actually is an issue template to report bugs in this repository. Additionally, could you provide more information about your Python environment, e.g., if you are using conda, could you paste the output of running conda env export?

Best,
Martí

@Yasharjamei
Copy link

Yasharjamei commented Aug 19, 2020

Hi Marti;

Ive recently facing the same issue;

Python 3.7 Pylandstasts the latest version and 2.0.1

When I run the code on my windows 10 I face this error: \landscape.py has not been compiled for Transonic-Numba.

I used to work with this library a few days ago with no issue and I recently faced this issue

image

Cheers

@martibosch
Copy link
Owner

Hello Yashar,

thank you for reporting this. The main implication of this issue is that the computation of the adjacency matrix (computed the first time - and only the first time - that one of the following metrics is computed: total_edge, edge_density with count_boundary=False and contagion) will be quite slow. But the rest should function normally.

Nonetheless, I will get access to a Windows computer in order to try to shine some light into why this warning appears. Could you please provide me a list of the packages (and version) of the conda environment in which you are using PyLandStats (e.g., the output of running conda env export)?

@Yasharjamei
Copy link

Thanks, Marti for your reply;

after downloading the Anaconda (with python 3.7) in a new environment; I tried to download " conda install -c conda-forge/label/cf202003 pylandstats " in my Anaconda terminal ( i thought maybe i will not face this error in the previous version) as around 1 month ago I did not receive any error regarding this library;

I thought that might be related to my raster image but I tried with smaller raster however similar error comes up!

Anyway, I end up using IDRISI TERRSET for mapping the landscape metric on my Tiff ( the spatial resolution is 20 cm) ;

Normally it took a lot of time previously to generate hundreds of fishnet to keep the resolution and be able to map lots of landscape metrics in FRAGSTATS;

I assume if I run the landscape metrics one by one then this error would not show up again!

Thanks for your kind supports in advance;

Cheers

List of packages :

image

image

Numba : 0.48.0

Transonic : 0.4.2

P.S : Please let me know if you need any other information and if running this library is easier on Linux

@martibosch
Copy link
Owner

Hello Yashar, thank you for sending me the details.

I am glad to see that the warning does not come up anymore. Let me know if this comes up again. In any case, such a warning does not depend on your raster image - it is an issue of code compilation that is completely independent of the data used - but rather in your system (Windows and its version) the version of numba, transonic and the version of some other dependencies which I honestly do not know very well. It is most likely easier to run this library in Linux or OSX, nevertheless it should be working properly in Windows as well.

I do not know which kind of analysis you intend to perform, but if you do not need all the metrics, it might be a good idea to specify the metrics that you need with the metrics argument (see the section "Selecting the metrics to compute" in the 01-landscape-analysis example notebook) so that only those metrics are computed. This is especially relevant if you do not need to compute any euclidean nearest neighbour related metric.

Let me know if the warning comes again and I will try to get a windows computer and reproduce your environment.

Best,
Martí

@Yasharjamei
Copy link

Thanks, Marti for the comprehensive and great reply;

I will let you know if any issue arise in the future;

Cheers

@martibosch
Copy link
Owner

Thank you @Yasharjamei, I am then closing this for now. Feel free to reopen if needed. Best,

Martí

@ffrosch
Copy link

ffrosch commented Aug 12, 2021

Hi, I discovered that the conda-repository does not contain a __numba__ folder. I think transonic should compile this folder on-the-fly, but in my case it does not.

An easy fix is to run transonic landscape.py -b numba within the pylandstats package folder. Of course it is necessary to activate the respective conda environment before running the command.

Would it be possible to provide a pre-compiled __numba__ folder with the conda package?

Best,
Florian

@jingliu0217
Copy link

Dear Sir,
This warning will still appear after I change the conda environment. Is there any other solution for it?
Another question, will this warning affect the precession speed?
cheers

@sacridini
Copy link

It worked for me just installing numba with "pip install numba"

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

6 participants