diff --git a/gstools/covmodel/fit.py b/gstools/covmodel/fit.py index e911a27e..32056063 100755 --- a/gstools/covmodel/fit.py +++ b/gstools/covmodel/fit.py @@ -293,7 +293,7 @@ def _set_weights(model, weights, x_data, curve_fit_kwargs, is_dir_vario): if weights is not None: if callable(weights): weights = 1.0 / weights(x_data) - elif weights == "inv": + elif isinstance(weights, str) and weights == "inv": weights = 1.0 + x_data elif is_dir_vario: if weights.size * model.dim == x_data.size: