Skip to content

Commit 888280d

Browse files
authored
Merge pull request #451 from KhiopsML/dev-v10
Dev v10
2 parents 49400ed + e531c2e commit 888280d

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
- Example: 10.2.1.4 is the 5th version that supports khiops 10.2.1.
77
- Internals: Changes in *Internals* sections are unlikely to be of interest for data scientists.
88

9+
## 10.3.2.1 - 2025-08-08
10+
11+
### Fixed
12+
- (`core`) Memory profiling log parsing bug.
13+
- (`core`) Bug in the Core API `train_predictor` with the
14+
`use_complement_as_test` option set to `True`.
15+
916
## 10.3.2.0 - 2025-07-03
1017

1118
### Fixed

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"

khiops/core/internals/runner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,10 @@ def _initialize_khiops_version(self):
949949

950950
# On success parse and save the version
951951
if return_code == 0:
952-
# Skip potential non-version lines (ex: Completed loading of file driver...)
953-
for line in stdout.split(os.linesep):
952+
# Skip potential non-version lines
953+
# (ex: Completed loading of file driver, debug info ...)
954+
for line in stdout.split("\n"):
955+
line = line.strip("\r") # remove Windows-specific Carriage-Return
954956
if line.startswith("Khiops"):
955957
khiops_version_str = line.rstrip().split(" ")[1]
956958
break

tests/test_samples.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import unittest
99

1010
import khiops.core as kh
11+
from khiops.core.internals.version import KhiopsVersion
1112
from khiops.samples import samples, samples_sklearn
1213
from tests.test_helper import KhiopsTestHelper
1314

@@ -22,8 +23,8 @@ def test_samples(self):
2223
"""Test if all samples run without problems"""
2324
# Obtain the runner version and set the minimal requirements for some samples
2425
min_version = {
25-
samples.detect_data_table_format: kh.KhiopsVersion("10.0.1"),
26-
samples.deploy_coclustering: kh.KhiopsVersion("10.0.1"),
26+
samples.detect_data_table_format: KhiopsVersion("10.0.1"),
27+
samples.deploy_coclustering: KhiopsVersion("10.0.1"),
2728
}
2829

2930
# Run the samples

0 commit comments

Comments
 (0)