|
22 | 22 | from khiops.core.internals.runner import get_runner |
23 | 23 |
|
24 | 24 |
|
25 | | -def build_multi_table_dictionary_domain( |
| 25 | +def _build_multi_table_dictionary_domain( |
26 | 26 | dictionary_domain, root_dictionary_name, secondary_table_variable_name |
27 | 27 | ): |
28 | | - """Builds a multi-table dictionary domain from a dictionary with a key |
| 28 | + """Builds a multi-table dictionary domain from a dictionary with a key""" |
| 29 | + # This is a special-purpose function whose goal is to assist in preparing the |
| 30 | + # coclustering deployment. |
| 31 | + # This function builds a new root dictionary and adds it to an existing dictionary |
| 32 | + # domain. |
| 33 | + # The new root dictionary only contains one field, which references a preexisting |
| 34 | + # dictionary from the input dictionary domain as a new (secondary) Table variable. |
| 35 | + # The preexisting dictionary must have a key set on it, as this is the join key |
| 36 | + # with the new root table. |
29 | 37 |
|
30 | | - Parameters |
31 | | - ---------- |
32 | | - dictionary_domain : `.DictionaryDomain` |
33 | | - DictionaryDomain object. Its root dictionary must have its key set. |
34 | | - root_dictionary_name : str |
35 | | - Name for the new root dictionary |
36 | | - secondary_table_variable_name : str |
37 | | - Name, in the root dictionary, for the "table" variable of the secondary table. |
38 | | -
|
39 | | - Raises |
40 | | - ------ |
41 | | - `TypeError` |
42 | | - Invalid type of an argument |
43 | | - `ValueError` |
44 | | - Invalid values of an argument: |
45 | | - - the dictionary domain doesn't contain at least a dictionary |
46 | | - - the dictionary domain's root dictionary doesn't have a key set |
47 | | - """ |
48 | 38 | # Check that `dictionary_domain` is a `DictionaryDomain` |
49 | 39 | if not isinstance(dictionary_domain, DictionaryDomain): |
50 | 40 | raise TypeError( |
@@ -279,7 +269,7 @@ def deploy_coclustering( |
279 | 269 | # Create a root dictionary containing the keys |
280 | 270 | root_dictionary_name = "CC_" + dictionary_name |
281 | 271 | table_variable_name = "Table_" + dictionary_name |
282 | | - domain = build_multi_table_dictionary_domain( |
| 272 | + domain = _build_multi_table_dictionary_domain( |
283 | 273 | tmp_domain, root_dictionary_name, table_variable_name |
284 | 274 | ) |
285 | 275 |
|
|
0 commit comments