Skip to content

Commit

Permalink
add explicit class init-arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Apr 29, 2024
1 parent a9df628 commit abf012d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/surfaces/test_functions/_base_test_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BaseTestFunction:
objective_function: callable
pure_objective_function: callable

def __init__(self, metric, sleep=0, evaluate_from_data=False):
def __init__(self, metric, sleep, evaluate_from_data):
self.sleep = sleep
self.metric = metric

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ class KNeighborsClassifierFunction(MachineLearningFunction):
cv_default = [2, 3, 4, 5, 8, 10]
dataset_default = [digits_data, wine_data, iris_data]

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(
self,
metric="loss",
sleep=0,
evaluate_from_data=False,
):
super().__init__(metric, sleep, evaluate_from_data)

def search_space(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ class MathematicalFunction(BaseTestFunction):

def __init__(
self,
*args,
metric="loss",
input_type="dictionary",
sleep=0,
**kwargs,
evaluate_from_data=False,
):
super().__init__(*args, metric, **kwargs)
super().__init__(metric, sleep, evaluate_from_data)

self.metric = metric
self.input_type = input_type
Expand Down

0 comments on commit abf012d

Please sign in to comment.