Skip to content

Commit 10d5d65

Browse files
authored
Replace param with keyword where applicable (#33508)
1 parent c64ffb6 commit 10d5d65

File tree

1 file changed

+39
-21
lines changed

1 file changed

+39
-21
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_model_operations.py

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ def get(self, name: str, version: Optional[str] = None, label: Optional[str] = N
285285
286286
:param name: Name of the model.
287287
:type name: str
288-
:param version: Version of the model.
289-
:type version: str
290-
:param label: Label of the model. (mutually exclusive with version)
291-
:type label: str
288+
:keyword version: Version of the model.
289+
:paramtype version: str
290+
:keyword label: Label of the model. (mutually exclusive with version)
291+
:paramtype label: str
292292
:raises ~azure.ai.ml.exceptions.ValidationException: Raised if Model cannot be successfully validated.
293293
Details will be provided in the error message.
294294
:return: Model asset object.
@@ -329,9 +329,9 @@ def download(self, name: str, version: str, download_path: Union[PathLike, str]
329329
:type name: str
330330
:param version: Version of the model.
331331
:type version: str
332-
:param download_path: Local path as download destination, defaults to current working directory of the current
332+
:keyword download_path: Local path as download destination, defaults to current working directory of the current
333333
user. Contents will be overwritten.
334-
:type download_path: Union[PathLike, str]
334+
:paramtype download_path: Union[PathLike, str]
335335
:raises ResourceNotFoundError: if can't find a model matching provided name.
336336
"""
337337

@@ -403,10 +403,19 @@ def archive(
403403
404404
:param name: Name of model asset.
405405
:type name: str
406-
:param version: Version of model asset.
407-
:type version: str
408-
:param label: Label of the model asset. (mutually exclusive with version)
409-
:type label: str
406+
:keyword version: Version of model asset.
407+
:paramtype version: str
408+
:keyword label: Label of the model asset. (mutually exclusive with version)
409+
:paramtype label: str
410+
411+
.. admonition:: Example:
412+
413+
.. literalinclude:: ../samples/ml_samples_misc.py
414+
:start-after: [START model_operations_archive]
415+
:end-before: [END model_operations_archive]
416+
:language: python
417+
:dedent: 8
418+
:caption: Archive a model example.
410419
"""
411420
_archive_or_restore(
412421
asset_operations=self,
@@ -430,10 +439,19 @@ def restore(
430439
431440
:param name: Name of model asset.
432441
:type name: str
433-
:param version: Version of model asset.
434-
:type version: str
435-
:param label: Label of the model asset. (mutually exclusive with version)
436-
:type label: str
442+
:keyword version: Version of model asset.
443+
:paramtype version: str
444+
:keyword label: Label of the model asset. (mutually exclusive with version)
445+
:paramtype label: str
446+
447+
.. admonition:: Example:
448+
449+
.. literalinclude:: ../samples/ml_samples_misc.py
450+
:start-after: [START model_operations_restore]
451+
:end-before: [END model_operations_restore]
452+
:language: python
453+
:dedent: 8
454+
:caption: Restore a model example.
437455
"""
438456
_archive_or_restore(
439457
asset_operations=self,
@@ -455,13 +473,13 @@ def list(
455473
) -> Iterable[Model]:
456474
"""List all model assets in workspace.
457475
458-
:param name: Name of the model.
459-
:type name: Optional[str]
460-
:param stage: The Model stage
461-
:type stage: Optional[str]
462-
:keyword list_view_type: View type for including/excluding (for example) archived models. Defaults to
463-
:attr:`ListViewType.ACTIVE_ONLY`.
464-
:type list_view_type: ListViewType
476+
:keyword name: Name of the model.
477+
:paramtype name: Optional[str]
478+
:keyword stage: The Model stage
479+
:paramtype stage: Optional[str]
480+
:keyword list_view_type: View type for including/excluding (for example) archived models.
481+
Defaults to :attr:`ListViewType.ACTIVE_ONLY`.
482+
:paramtype list_view_type: ListViewType
465483
:return: An iterator like instance of Model objects
466484
:rtype: ~azure.core.paging.ItemPaged[~azure.ai.ml.entities.Model]
467485
"""

0 commit comments

Comments
 (0)