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

possiblility to pass kwargs to distance function #188

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions skgstat/Kriging.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ def __init__(
self.range = variogram['effective_range']
self.nugget = variogram['nugget']
self.sill = variogram['sill']
self.dist_metric = variogram["dist_func"]

if isinstance(coordinates, MetricSpace):
self.dist_metric = coordinates.dist_metric
self.dist_metric_kwargs = coordinates.dist_metric_kwargs
else:
self.dist_metric = variogram["dist_func"]
self.dist_metric_kwargs = {}
# coordinates and semivariance function
if not isinstance(coordinates, MetricSpace):
coordinates, values = self._remove_duplicated_coordinates(coordinates, values)
Expand Down Expand Up @@ -163,7 +167,7 @@ def __init__(
self.perf_solv = list()

def dist(self, x):
return Variogram.wrapped_distance_function(self.dist_metric, x)
return Variogram.wrapped_distance_function(self.dist_metric, x, **self.dist_metric_kwargs)

@classmethod
def _remove_duplicated_coordinates(cls, coords, values):
Expand Down
Loading
Loading