Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
- Example: 10.2.1.4 is the 5th version that supports khiops 10.2.1.
- Internals: Changes in *Internals* sections are unlikely to be of interest for data scientists.

## 10.3.2.1 - 2025-08-08

### Fixed
- (`core`) Memory profiling log parsing bug.
- (`core`) Bug in the Core API `train_predictor` with the
`use_complement_as_test` option set to `True`.

## 10.3.2.0 - 2025-07-03

### Fixed
Expand Down
29 changes: 5 additions & 24 deletions khiops/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from khiops.core.internals.io import KhiopsOutputWriter
from khiops.core.internals.runner import get_runner
from khiops.core.internals.task import get_task_registry
from khiops.core.internals.version import KhiopsVersion

# List of all available construction rules in the Khiops tool
all_construction_rules = [
Expand Down Expand Up @@ -266,15 +265,9 @@ def _preprocess_task_arguments(task_args):
# Transform the use_complement_as_test bool parameter to its string counterpart
if "use_complement_as_test" in task_args:
if task_args["use_complement_as_test"]:
if get_khiops_version() < KhiopsVersion("10.0.0"):
task_args["fill_test_database_settings"] = True
else:
task_args["test_database_mode"] = "Complementary"
task_args["test_database_mode"] = "Complementary"
else:
if get_khiops_version() < KhiopsVersion("10"):
task_args["fill_test_database_settings"] = False
else:
task_args["test_database_mode"] = "None"
task_args["test_database_mode"] = "None"
del task_args["use_complement_as_test"]

# Preprocess the database format parameters
Expand Down Expand Up @@ -826,11 +819,7 @@ def train_predictor(
_run_task("train_predictor", task_args)

# Return the paths of the JSON report and modelling dictionary file
reports_file_name = results_prefix
if get_runner().khiops_version < KhiopsVersion("10.0.0"):
reports_file_name += "AllReports.json"
else:
reports_file_name += "AllReports.khj"
reports_file_name = f"{results_prefix}AllReports.khj"
reports_file_path = fs.get_child_path(results_dir, reports_file_name)

if target_variable != "":
Expand Down Expand Up @@ -953,11 +942,7 @@ def evaluate_predictor(
_run_task("evaluate_predictor", task_args)

# Return the path of the JSON report
report_file_name = results_prefix
if get_runner().khiops_version < KhiopsVersion("10.0.0"):
report_file_name += "EvaluationReport.json"
else:
report_file_name += "EvaluationReport.khj"
report_file_name = f"{results_prefix}EvaluationReport.khj"

return fs.get_child_path(results_dir, report_file_name)

Expand Down Expand Up @@ -1169,11 +1154,7 @@ def train_recoder(
_run_task("train_recoder", task_args)

# Return the paths of the JSON report and modelling dictionary file
reports_file_name = f"{results_prefix}AllReports"
if get_runner().khiops_version < KhiopsVersion("10.0.0"):
reports_file_name += ".json"
else:
reports_file_name += ".khj"
reports_file_name = f"{results_prefix}AllReports.khj"
reports_file_path = fs.get_child_path(results_dir, reports_file_name)
modeling_dictionary_file_path = fs.get_child_path(
results_dir, f"{results_prefix}Modeling.kdic"
Expand Down
6 changes: 4 additions & 2 deletions khiops/core/internals/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,10 @@ def _initialize_khiops_version(self):

# On success parse and save the version
if return_code == 0:
# Skip potential non-version lines (ex: Completed loading of file driver...)
for line in stdout.split(os.linesep):
# Skip potential non-version lines
# (ex: Completed loading of file driver, debug info ...)
for line in stdout.split("\n"):
line = line.strip("\r") # remove Windows-specific Carriage-Return
if line.startswith("Khiops"):
khiops_version_str = line.rstrip().split(" ")[1]
break
Expand Down
5 changes: 3 additions & 2 deletions tests/test_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import unittest

import khiops.core as kh
from khiops.core.internals.version import KhiopsVersion
from khiops.samples import samples, samples_sklearn
from tests.test_helper import KhiopsTestHelper

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

# Run the samples
Expand Down