88import os
99import platform
1010import subprocess
11+ import warnings
1112
1213import khiops .core .internals .filesystems as fs
1314from khiops .core import api
1920)
2021from khiops .core .internals .common import (
2122 create_unambiguous_khiops_path ,
23+ deprecation_message ,
2224 is_list_like ,
2325 type_error_message ,
2426)
@@ -29,6 +31,22 @@ def build_multi_table_dictionary_domain(
2931):
3032 """Builds a multi-table dictionary domain from a dictionary with a key
3133
34+ .. note::
35+
36+ This is a special-purpose function whose goal is to assist in preparing the
37+ coclustering deployment.
38+
39+ This function builds a new root dictionary and adds it to an existing dictionary
40+ domain.
41+ The new root dictionary only contains one field, which references a preexisting
42+ dictionary from the input dictionary domain as a new (secondary) Table variable.
43+ The preexisting dictionary must have a key set on it, as this is the join key
44+ with the new root table.
45+
46+ .. warning::
47+ This method is *deprecated* since Khiops 10.3.1.0 and will be removed in Khiops
48+ 11.
49+
3250 Parameters
3351 ----------
3452 dictionary_domain : `.DictionaryDomain`
@@ -38,6 +56,11 @@ def build_multi_table_dictionary_domain(
3856 secondary_table_variable_name : str
3957 Name, in the root dictionary, for the "table" variable of the secondary table.
4058
59+ Returns
60+ -------
61+ `.DictionaryDomain`
62+ The new dictionary domain
63+
4164 Raises
4265 ------
4366 `TypeError`
@@ -47,6 +70,16 @@ def build_multi_table_dictionary_domain(
4770 - the dictionary domain doesn't contain at least a dictionary
4871 - the dictionary domain's root dictionary doesn't have a key set
4972 """
73+ # Warn the user that this helper function is deprecated and will be removed
74+ warnings .warn (deprecation_message ("build_multi_table_dictionary_domain" , "11.0.0" ))
75+ return _build_multi_table_dictionary_domain (
76+ dictionary_domain , root_dictionary_name , secondary_table_variable_name
77+ )
78+
79+
80+ def _build_multi_table_dictionary_domain (
81+ dictionary_domain , root_dictionary_name , secondary_table_variable_name
82+ ):
5083 # Check that `dictionary_domain` is a `DictionaryDomain`
5184 if not isinstance (dictionary_domain , DictionaryDomain ):
5285 raise TypeError (
@@ -266,7 +299,7 @@ def deploy_coclustering(
266299 # Create a root dictionary containing the keys
267300 root_dictionary_name = "CC_" + dictionary_name
268301 table_variable_name = "Table_" + dictionary_name
269- domain = build_multi_table_dictionary_domain (
302+ domain = _build_multi_table_dictionary_domain (
270303 tmp_domain , root_dictionary_name , table_variable_name
271304 )
272305
0 commit comments