Skip to content

Commit 137b341

Browse files
author
Thierry RAMORASOAVINA
committed
Remove the (obsolete) conditional behavior when khiops is < 10.0.0
1 parent 49400ed commit 137b341

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

khiops/core/api.py

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from khiops.core.internals.io import KhiopsOutputWriter
3434
from khiops.core.internals.runner import get_runner
3535
from khiops.core.internals.task import get_task_registry
36-
from khiops.core.internals.version import KhiopsVersion
3736

3837
# List of all available construction rules in the Khiops tool
3938
all_construction_rules = [
@@ -266,15 +265,9 @@ def _preprocess_task_arguments(task_args):
266265
# Transform the use_complement_as_test bool parameter to its string counterpart
267266
if "use_complement_as_test" in task_args:
268267
if task_args["use_complement_as_test"]:
269-
if get_khiops_version() < KhiopsVersion("10.0.0"):
270-
task_args["fill_test_database_settings"] = True
271-
else:
272-
task_args["test_database_mode"] = "Complementary"
268+
task_args["test_database_mode"] = "Complementary"
273269
else:
274-
if get_khiops_version() < KhiopsVersion("10"):
275-
task_args["fill_test_database_settings"] = False
276-
else:
277-
task_args["test_database_mode"] = "None"
270+
task_args["test_database_mode"] = "None"
278271
del task_args["use_complement_as_test"]
279272

280273
# Preprocess the database format parameters
@@ -826,11 +819,7 @@ def train_predictor(
826819
_run_task("train_predictor", task_args)
827820

828821
# Return the paths of the JSON report and modelling dictionary file
829-
reports_file_name = results_prefix
830-
if get_runner().khiops_version < KhiopsVersion("10.0.0"):
831-
reports_file_name += "AllReports.json"
832-
else:
833-
reports_file_name += "AllReports.khj"
822+
reports_file_name = f"{results_prefix}AllReports.khj"
834823
reports_file_path = fs.get_child_path(results_dir, reports_file_name)
835824

836825
if target_variable != "":
@@ -953,11 +942,7 @@ def evaluate_predictor(
953942
_run_task("evaluate_predictor", task_args)
954943

955944
# Return the path of the JSON report
956-
report_file_name = results_prefix
957-
if get_runner().khiops_version < KhiopsVersion("10.0.0"):
958-
report_file_name += "EvaluationReport.json"
959-
else:
960-
report_file_name += "EvaluationReport.khj"
945+
report_file_name = f"{results_prefix}EvaluationReport.khj"
961946

962947
return fs.get_child_path(results_dir, report_file_name)
963948

@@ -1169,11 +1154,7 @@ def train_recoder(
11691154
_run_task("train_recoder", task_args)
11701155

11711156
# Return the paths of the JSON report and modelling dictionary file
1172-
reports_file_name = f"{results_prefix}AllReports"
1173-
if get_runner().khiops_version < KhiopsVersion("10.0.0"):
1174-
reports_file_name += ".json"
1175-
else:
1176-
reports_file_name += ".khj"
1157+
reports_file_name = f"{results_prefix}AllReports.khj"
11771158
reports_file_path = fs.get_child_path(results_dir, reports_file_name)
11781159
modeling_dictionary_file_path = fs.get_child_path(
11791160
results_dir, f"{results_prefix}Modeling.kdic"

0 commit comments

Comments
 (0)