Skip to content

Commit

Permalink
blacken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Mar 27, 2020
1 parent 2c54ca5 commit f4cbfa2
Show file tree
Hide file tree
Showing 3 changed files with 1,611 additions and 1,027 deletions.
34 changes: 17 additions & 17 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@


def _method_and_vergiogram():
method = ['ordinary', 'universal', 'ordinary3d', 'universal3d']
variogram_model = ['linear', 'power', 'gaussian', 'spherical',
'exponential']
method = ["ordinary", "universal", "ordinary3d", "universal3d"]
variogram_model = ["linear", "power", "gaussian", "spherical", "exponential"]
return product(method, variogram_model)


Expand All @@ -21,25 +20,26 @@ def test_krige():
y = 5 * np.random.rand(20)

for m, v in _method_and_vergiogram():
param_dict = {'method': [m], 'variogram_model': [v]}

estimator = GridSearchCV(Krige(),
param_dict,
n_jobs=-1,
iid=False,
pre_dispatch='2*n_jobs',
verbose=False,
cv=5,
)
param_dict = {"method": [m], "variogram_model": [v]}

estimator = GridSearchCV(
Krige(),
param_dict,
n_jobs=-1,
iid=False,
pre_dispatch="2*n_jobs",
verbose=False,
cv=5,
)
# run the gridsearch
if m in ['ordinary', 'universal']:
if m in ["ordinary", "universal"]:
estimator.fit(X=X[:, :2], y=y)
else:
estimator.fit(X=X, y=y)
if hasattr(estimator, 'best_score_'):
if hasattr(estimator, "best_score_"):
if m in threed_krige:
assert estimator.best_score_ > -10.0
else:
assert estimator.best_score_ > -3.0
if hasattr(estimator, 'cv_results_'):
assert estimator.cv_results_['mean_train_score'] > 0
if hasattr(estimator, "cv_results_"):
assert estimator.cv_results_["mean_train_score"] > 0

0 comments on commit f4cbfa2

Please sign in to comment.