Skip to content

Commit

Permalink
CovModel.fit: check if weights are given as a string to prevent numpy…
Browse files Browse the repository at this point in the history
… comparisson errors in the future
  • Loading branch information
MuellerSeb committed Nov 18, 2020
1 parent d3f9159 commit 00e1c65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gstools/covmodel/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 00e1c65

Please sign in to comment.