Skip to content

Commit d0ef4cb

Browse files
Apply renaming from public api; Improve documentation
1 parent 7b3d0c3 commit d0ef4cb

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

dataikuapi/dss/ml.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,61 +1752,61 @@ def get_diagnostics(self):
17521752
diagnostics = self.details.get("trainDiagnostics", {})
17531753
return [DSSMLDiagnostic(d) for d in diagnostics.get("diagnostics", [])]
17541754

1755-
def export_documentation(self, folder_id=None, path=None):
1755+
def generate_documentation(self, folder_id=None, path=None):
17561756
"""
1757-
Start the export of the model documentation from a template docx file in a managed folder,
1757+
Start the model document generation from a template docx file in a managed folder,
17581758
or from the default template if no folder id and path are specified.
17591759
17601760
:param folder_id: (optional) the id of the managed folder
17611761
:param path: (optional) the path to the file from the root of the folder
17621762
:return: A :class:`~dataikuapi.dss.future.DSSFuture` representing the model document generation process
17631763
"""
17641764
if bool(folder_id) != bool(path):
1765-
raise ValueError("Both folder id and path arguments are required to use a template from folder. Use without argument to export using the default template")
1765+
raise ValueError("Both folder id and path arguments are required to use a template from folder. Use without argument to generate the model documentation using the default template")
17661766

1767-
export_mode_url = "default-template" if folder_id is None and path is None else "template-in-folder"
1767+
template_mode_url = "default-template" if folder_id is None and path is None else "template-in-folder"
17681768

17691769
if self.mltask is not None:
17701770
f = self.mltask.client._perform_json(
1771-
"POST", "/projects/%s/models/lab/%s/%s/models/%s/export-documentation-from-%s" %
1772-
(self.mltask.project_key, self.mltask.analysis_id, self.mltask.mltask_id, self.mltask_model_id, export_mode_url),
1771+
"POST", "/projects/%s/models/lab/%s/%s/models/%s/generate-documentation-from-%s" %
1772+
(self.mltask.project_key, self.mltask.analysis_id, self.mltask.mltask_id, self.mltask_model_id, template_mode_url),
17731773
params={"folderId": folder_id, "path": path})
17741774
return DSSFuture(self.mltask.client, f["jobId"])
17751775
else:
17761776
f = self.saved_model.client._perform_json(
1777-
"POST", "/projects/%s/savedmodels/%s/versions/%s/export-documentation-from-%s" %
1778-
(self.saved_model.project_key, self.saved_model.sm_id, self.saved_model_version, export_mode_url),
1777+
"POST", "/projects/%s/savedmodels/%s/versions/%s/generate-documentation-from-%s" %
1778+
(self.saved_model.project_key, self.saved_model.sm_id, self.saved_model_version, template_mode_url),
17791779
params={"folderId": folder_id, "path": path})
17801780
return DSSFuture(self.saved_model.client, job_id=f["jobId"])
17811781

1782-
def export_documentation_from_custom_template(self, fp):
1782+
def generate_documentation_from_custom_template(self, fp):
17831783
"""
1784-
Start the export of the model documentation from a docx template (as a file object).
1784+
Start the model document generation from a docx template (as a file object).
17851785
17861786
:param object fp: A file-like object pointing to a template docx file
17871787
:return: A :class:`~dataikuapi.dss.future.DSSFuture` representing the model document generation process
17881788
"""
17891789
files = {'file': fp}
17901790
if self.mltask is not None:
17911791
f = self.mltask.client._perform_json(
1792-
"POST", "/projects/%s/models/lab/%s/%s/models/%s/export-documentation-from-custom-template" %
1792+
"POST", "/projects/%s/models/lab/%s/%s/models/%s/generate-documentation-from-custom-template" %
17931793
(self.mltask.project_key, self.mltask.analysis_id, self.mltask.mltask_id, self.mltask_model_id),
17941794
files=files)
17951795
return DSSFuture(self.mltask.client, f["jobId"])
17961796
else:
17971797
f = self.saved_model.client._perform_json(
1798-
"POST", "/projects/%s/savedmodels/%s/versions/%s/export-documentation-from-custom-template" %
1798+
"POST", "/projects/%s/savedmodels/%s/versions/%s/generate-documentation-from-custom-template" %
17991799
(self.saved_model.project_key, self.saved_model.sm_id, self.saved_model_version),
18001800
files=files)
18011801
return DSSFuture(self.saved_model.client, job_id=f["jobId"])
18021802

18031803
def download_documentation_stream(self, export_id):
18041804
"""
1805-
Download a exported model documentation, as a binary stream.
1805+
Download a model documentation, as a binary stream.
18061806
18071807
Warning: this stream will monopolize the DSSClient until closed.
18081808
1809-
:param exportId: the template id of the generated model documentation returned as the result of the future
1809+
:param export_id: the id of the generated model documentation returned as the result of the future
18101810
:return: A :class:`~dataikuapi.dss.future.DSSFuture` representing the model document generation process
18111811
"""
18121812
if self.mltask is not None:
@@ -1818,9 +1818,9 @@ def download_documentation_stream(self, export_id):
18181818

18191819
def download_documentation_to_file(self, export_id, path):
18201820
"""
1821-
Download an exported model documentation into the given output file.
1821+
Download a model documentation into the given output file.
18221822
1823-
:param export_id: the template id of the generated model documentation returned as the result of the future
1823+
:param export_id: the id of the generated model documentation returned as the result of the future
18241824
:param path: the path where to download the model documentation
18251825
:return: None
18261826
"""

0 commit comments

Comments
 (0)