|
33 | 33 | from khiops.core.internals.io import KhiopsOutputWriter |
34 | 34 | from khiops.core.internals.runner import get_runner |
35 | 35 | from khiops.core.internals.task import get_task_registry |
36 | | -from khiops.core.internals.version import KhiopsVersion |
37 | 36 |
|
38 | 37 | # List of all available construction rules in the Khiops tool |
39 | 38 | all_construction_rules = [ |
@@ -266,15 +265,9 @@ def _preprocess_task_arguments(task_args): |
266 | 265 | # Transform the use_complement_as_test bool parameter to its string counterpart |
267 | 266 | if "use_complement_as_test" in task_args: |
268 | 267 | 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" |
273 | 269 | 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" |
278 | 271 | del task_args["use_complement_as_test"] |
279 | 272 |
|
280 | 273 | # Preprocess the database format parameters |
@@ -826,11 +819,7 @@ def train_predictor( |
826 | 819 | _run_task("train_predictor", task_args) |
827 | 820 |
|
828 | 821 | # 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" |
834 | 823 | reports_file_path = fs.get_child_path(results_dir, reports_file_name) |
835 | 824 |
|
836 | 825 | if target_variable != "": |
@@ -953,11 +942,7 @@ def evaluate_predictor( |
953 | 942 | _run_task("evaluate_predictor", task_args) |
954 | 943 |
|
955 | 944 | # 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" |
961 | 946 |
|
962 | 947 | return fs.get_child_path(results_dir, report_file_name) |
963 | 948 |
|
@@ -1169,11 +1154,7 @@ def train_recoder( |
1169 | 1154 | _run_task("train_recoder", task_args) |
1170 | 1155 |
|
1171 | 1156 | # 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" |
1177 | 1158 | reports_file_path = fs.get_child_path(results_dir, reports_file_name) |
1178 | 1159 | modeling_dictionary_file_path = fs.get_child_path( |
1179 | 1160 | results_dir, f"{results_prefix}Modeling.kdic" |
|
0 commit comments