scikit-gstat icon indicating copy to clipboard operation
scikit-gstat copied to clipboard

Bug in MetricSpace

Open mmaelicke opened this issue 3 years ago • 0 comments

Hey @redhog

I think there is still a bug in MetricSpace related to the setting of maxlag. You can reproduce the example below with the newly introduced data module of scikit-gstat:

import skgstat as skg
c, v = skg.data.pancake().get('sample')

V = skg.Variogram(c, v, n_lags=20)
V.plot()

gives: image

If you build the variogram like:

V = skg.Variogram(c, v, n_lags=20, maxlag=500)

we get: image

I guess the problem is the MetricSpace as it gets instantiated differently when maxlag is not an integer > 1. If I pass a float < 1 things seem to work properly:

image

Something that could be related: I fixed an issue here: https://github.com/mmaelicke/scikit-gstat/blob/259c10fa7e4c0a6132a28165e275cf28acd61d49/skgstat/Variogram.py#L254

Formerly, this line looked like:

if maxlag == None:

For which pylint was always complaining cause it's bad practice.

I can somehow remember that you fixed a similar issue already, so maybe you know what is going wrong here.

mmaelicke avatar May 19 '21 06:05 mmaelicke