Skip to content

Commit 2ab8b2b

Browse files
committed
changed name of function
1 parent 6d13a75 commit 2ab8b2b

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

openml/flows/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .flow import OpenMLFlow
2-
from .sklearn_converter import sklearn_to_flow, flow_to_sklearn, model_is_paralizable
2+
from .sklearn_converter import sklearn_to_flow, flow_to_sklearn, model_single_core
33
from .functions import get_flow, list_flows, flow_exists
44

55
__all__ = ['OpenMLFlow', 'create_flow_from_model', 'get_flow', 'list_flows',

openml/flows/sklearn_converter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,11 @@ def _serialize_cross_validator(o):
536536

537537
return ret
538538

539-
def model_is_paralizable(model):
539+
def model_single_core(model):
540+
'''
541+
Returns True if the parameter settings of model are chosen s.t. the model
542+
will run on a single core (in that case, openml-python can measure runtimes)
543+
'''
540544
def check(param_dict):
541545
for param, value in param_dict.items():
542546
# n_jobs is scikitlearn parameter for paralizing jobs

openml/runs/functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from ..exceptions import PyOpenMLError
1212
from .. import config
13-
from ..flows import sklearn_to_flow, get_flow, flow_exists, model_is_paralizable
13+
from ..flows import sklearn_to_flow, get_flow, flow_exists, model_single_core
1414
from ..setups import setup_exists
1515
from ..exceptions import OpenMLCacheException, OpenMLServerException
1616
from ..util import URLError, version_complies
@@ -160,7 +160,7 @@ def _run_task_get_arffcontent(model, task, class_labels):
160160
user_defined_measures = defaultdict(lambda: defaultdict(dict))
161161

162162
rep_no = 0
163-
can_measure_runtime = version_complies(3, 3) and model_is_paralizable(model)
163+
can_measure_runtime = version_complies(3, 3) and model_single_core(model)
164164
# TODO use different iterator to only provide a single iterator (less
165165
# methods, less maintenance, less confusion)
166166
for rep in task.iterate_repeats():

tests/test_flows/test_sklearn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from openml.flows import OpenMLFlow, sklearn_to_flow, flow_to_sklearn
2828
from openml.flows.sklearn_converter import _format_external_version, \
29-
_check_dependencies, model_is_paralizable
29+
_check_dependencies, model_single_core
3030
from openml.exceptions import PyOpenMLError
3131

3232
this_directory = os.path.dirname(os.path.abspath(__file__))
@@ -570,4 +570,4 @@ def test_paralizable_check(self):
570570
answers = [True, False, False, True, False, False]
571571

572572
for i in range(len(models)):
573-
assert(model_is_paralizable(models[i]) == answers[i])
573+
assert(model_single_core(models[i]) == answers[i])

0 commit comments

Comments
 (0)