Skip to content

Commit 63833fd

Browse files
authored
[ml] Fix apiview 1.10.0 comments, round 2 (Azure#31917)
* Re-introduce ivars for Signals classes * Move docstring from class level to constructor level * Reintroduce ivars for SystemData class
1 parent a6bb4d6 commit 63833fd

File tree

3 files changed

+83
-64
lines changed

3 files changed

+83
-64
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_inputs_outputs/output.py

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,50 @@
1818

1919

2020
class Output(_InputOutputBase):
21-
"""Define an output.
22-
23-
:keyword type: The type of the data output. Accepted values are 'uri_folder', 'uri_file', 'mltable', 'mlflow_model',
24-
'custom_model', and user-defined types. Defaults to 'uri_folder'.
25-
:paramtype type: str
26-
:keyword path: The remote path where the output should be stored.
27-
:paramtype path: Optional[str]
28-
:keyword mode: The access mode of the data output. Accepted values are
29-
* 'rw_mount': Read-write mount the data
30-
* 'upload': Upload the data from the compute target
31-
* 'direct': Pass in the URI as a string
32-
:paramtype mode: Optional[str]
33-
:keyword description: The description of the output.
34-
:paramtype description: Optional[str]
35-
:keyword name: The name to be used to register the output as a Data or Model asset. A name can be set without
36-
setting a version.
37-
:paramtype name: str
38-
:keyword version: The version used to register the output as a Data or Model asset. A version can be set only
39-
when name is set.
40-
:paramtype version: str
41-
:keyword is_control: Determine if the output is a control output.
42-
:paramtype is_control: bool
43-
:keyword early_available: Mark the output for early node orchestration.
44-
:paramtype early_available: bool
45-
:keyword intellectual_property: Intellectual property associated with the output.
46-
It can be an instance of `IntellectualProperty` or a dictionary that will be used to create an instance.
47-
:paramtype intellectual_property: Union[~azure.ai.ml.entities._assets.intellectual_property.IntellectualProperty,
48-
dict]
49-
50-
.. admonition:: Example:
51-
52-
.. literalinclude:: ../../../../../samples/ml_samples_misc.py
53-
:start-after: [START create_inputs_outputs]
54-
:end-before: [END create_inputs_outputs]
55-
:language: python
56-
:dedent: 8
57-
:caption: Creating a CommandJob with a folder output.
58-
"""
59-
6021
_IO_KEYS = ["name", "version", "path", "type", "mode", "description", "early_available"]
6122

6223
@overload
6324
def __init__(self, type: Literal["uri_folder"] = "uri_folder", path=None, mode=None, description=None) -> None:
64-
""""""
25+
# pylint: disable=line-too-long
26+
"""Define an output.
27+
28+
:keyword type: The type of the data output. Accepted values are 'uri_folder', 'uri_file', 'mltable',
29+
'mlflow_model', 'custom_model', and user-defined types. Defaults to 'uri_folder'.
30+
:paramtype type: str
31+
:keyword path: The remote path where the output should be stored.
32+
:paramtype path: Optional[str]
33+
:keyword mode: The access mode of the data output. Accepted values are
34+
* 'rw_mount': Read-write mount the data
35+
* 'upload': Upload the data from the compute target
36+
* 'direct': Pass in the URI as a string
37+
:paramtype mode: Optional[str]
38+
:keyword description: The description of the output.
39+
:paramtype description: Optional[str]
40+
:keyword name: The name to be used to register the output as a Data or Model asset. A name can be set without
41+
setting a version.
42+
:paramtype name: str
43+
:keyword version: The version used to register the output as a Data or Model asset. A version can be set only
44+
when name is set.
45+
:paramtype version: str
46+
:keyword is_control: Determine if the output is a control output.
47+
:paramtype is_control: bool
48+
:keyword early_available: Mark the output for early node orchestration.
49+
:paramtype early_available: bool
50+
:keyword intellectual_property: Intellectual property associated with the output.
51+
It can be an instance of `IntellectualProperty` or a dictionary that will be used to create an instance.
52+
:paramtype intellectual_property: Union[~azure.ai.ml.entities._assets.intellectual_property.IntellectualProperty,
53+
54+
dict]
55+
56+
.. admonition:: Example:
57+
58+
.. literalinclude:: ../../../../../samples/ml_samples_misc.py
59+
:start-after: [START create_inputs_outputs]
60+
:end-before: [END create_inputs_outputs]
61+
:language: python
62+
:dedent: 8
63+
:caption: Creating a CommandJob with a folder output.
64+
"""
6565

6666
@overload
6767
def __init__(self, type: Literal["uri_file"] = "uri_file", path=None, mode=None, description=None):

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_monitoring/signals.py

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,61 @@
44

55
# pylint: disable=protected-access
66

7-
from typing import Dict, List, Optional, Union
87
import datetime
9-
import isodate
8+
from typing import Dict, List, Optional, Union
109

10+
import isodate
1111
from typing_extensions import Literal
1212

13-
from azure.ai.ml.entities._inputs_outputs import Input
14-
from azure.ai.ml.entities._mixins import RestTranslatableMixin
15-
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
16-
MonitoringInputDataBase as RestMonitoringInputData,
17-
)
13+
from azure.ai.ml._restclient.v2023_06_01_preview.models import AllFeatures as RestAllFeatures
14+
from azure.ai.ml._restclient.v2023_06_01_preview.models import CustomMonitoringSignal as RestCustomMonitoringSignal
1815
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
19-
MonitoringSignalBase as RestMonitoringSignalBase,
2016
DataDriftMonitoringSignal as RestMonitoringDataDriftSignal,
2117
)
2218
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
2319
DataQualityMonitoringSignal as RestMonitoringDataQualitySignal,
2420
)
2521
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
2622
FeatureAttributionDriftMonitoringSignal as RestFeatureAttributionDriftMonitoringSignal,
27-
ModelPerformanceSignal as RestModelPerformanceSignal,
28-
CustomMonitoringSignal as RestCustomMonitoringSignal,
29-
MonitoringDataSegment as RestMonitoringDataSegment,
23+
)
24+
from azure.ai.ml._restclient.v2023_06_01_preview.models import FeatureSubset as RestFeatureSubset
25+
from azure.ai.ml._restclient.v2023_06_01_preview.models import ModelPerformanceSignal as RestModelPerformanceSignal
26+
from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringDataSegment as RestMonitoringDataSegment
27+
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
3028
MonitoringFeatureFilterBase as RestMonitoringFeatureFilterBase,
3129
)
30+
from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringInputDataBase as RestMonitoringInputData
3231
from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringNotificationMode
32+
from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringSignalBase as RestMonitoringSignalBase
3333
from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringSignalType
34+
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
35+
MonitoringWorkspaceConnection as RestMonitoringWorkspaceConnection,
36+
)
3437
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
3538
PredictionDriftMonitoringSignal as RestPredictionDriftMonitoringSignal,
3639
)
3740
from azure.ai.ml._restclient.v2023_06_01_preview.models import (
3841
TopNFeaturesByAttribution as RestTopNFeaturesByAttribution,
39-
AllFeatures as RestAllFeatures,
40-
FeatureSubset as RestFeatureSubset,
41-
MonitoringWorkspaceConnection as RestMonitoringWorkspaceConnection,
4242
)
4343
from azure.ai.ml._utils._experimental import experimental
4444
from azure.ai.ml.constants._monitoring import (
45-
MonitorSignalType,
4645
ALL_FEATURES,
47-
MonitorModelType,
4846
MonitorDatasetContext,
4947
MonitorFeatureDataType,
48+
MonitorModelType,
49+
MonitorSignalType,
5050
)
51-
from azure.ai.ml.entities._monitoring.input_data import (
52-
FixedInputData,
53-
TrailingInputData,
54-
StaticInputData,
55-
)
51+
from azure.ai.ml.entities._inputs_outputs import Input
52+
from azure.ai.ml.entities._mixins import RestTranslatableMixin
53+
from azure.ai.ml.entities._monitoring.input_data import FixedInputData, StaticInputData, TrailingInputData
5654
from azure.ai.ml.entities._monitoring.thresholds import (
55+
CustomMonitoringMetricThreshold,
5756
DataDriftMetricThreshold,
5857
DataQualityMetricThreshold,
59-
PredictionDriftMetricThreshold,
6058
FeatureAttributionDriftMetricThreshold,
6159
MetricThreshold,
6260
ModelPerformanceMetricThreshold,
63-
CustomMonitoringMetricThreshold,
61+
PredictionDriftMetricThreshold,
6462
)
6563

6664

@@ -482,6 +480,8 @@ def _get_default_data_drift_signal(cls) -> "DataDriftSignal":
482480
class PredictionDriftSignal(MonitoringSignal):
483481
"""Prediction drift signal.
484482
483+
:ivar type: The type of the signal. Set to "prediction_drift" for this class.
484+
:vartype type: str
485485
:keyword baseline_dataset: The dataset to calculate drift against.
486486
:paramtype baseline_dataset: ~azure.ai.ml.entities.MonitorInputData
487487
:keyword target_dataset: The dataset for which drift will be calculated.
@@ -546,7 +546,8 @@ def _get_default_prediction_drift_signal(cls) -> "PredictionDriftSignal":
546546
class DataQualitySignal(DataSignal):
547547
"""Data quality signal
548548
549-
549+
:ivar type: The type of the signal. Set to "data_quality" for this class.
550+
:vartype type: str
550551
:keyword target_dataset: The data for which quality will be calculated.
551552
:paramtype target_dataset: ~azure.ai.ml.entities.TargetDataset
552553
:keyword baseline_dataset: The data to calculate quality against.
@@ -714,6 +715,8 @@ def _from_rest_object(cls, obj: RestMonitoringInputData) -> "FADProductionData":
714715
class FeatureAttributionDriftSignal(RestTranslatableMixin):
715716
"""Feature attribution drift signal
716717
718+
:ivar type: The type of the signal. Set to "feature_attribution_drift" for this class.
719+
:vartype type: str
717720
:keyword target_dataset: The data for which drift will be calculated.
718721
:paramtype target_dataset: ~azure.ai.ml.entities.TargetDataset
719722
:keyword baseline_dataset: The data to calculate drift against.
@@ -861,6 +864,8 @@ def _from_rest_object(cls, obj: RestMonitoringWorkspaceConnection) -> "Workspace
861864
class CustomMonitoringSignal(RestTranslatableMixin):
862865
"""Custom monitoring signal.
863866
867+
:ivar type: The type of the signal. Set to "custom" for this class.
868+
:vartype type: str
864869
:keyword input_datasets: A dictionary of input datasets for monitoring.
865870
Each key is the component input port name, and its value is the data asset.
866871
:paramtype input_datasets: Optional[dict[str, ~azure.ai.ml.entities.MonitorInputData]]

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_system_data.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
class SystemData(RestTranslatableMixin):
1010
"""Metadata related to the creation and most recent modification of a resource.
1111
12+
:ivar created_by: The identity that created the resource.
13+
:vartype created_by: str
14+
:ivar created_by_type: The type of identity that created the resource. Possible values include:
15+
"User", "Application", "ManagedIdentity", "Key".
16+
:vartype created_by_type: str or ~azure.ai.ml.entities.CreatedByType
17+
:ivar created_at: The timestamp of resource creation (UTC).
18+
:vartype created_at: ~datetime.datetime
19+
:ivar last_modified_by: The identity that last modified the resource.
20+
:vartype last_modified_by: str
21+
:ivar last_modified_by_type: The type of identity that last modified the resource. Possible
22+
values include: "User", "Application", "ManagedIdentity", "Key".
23+
:vartype last_modified_by_type: str or ~azure.ai.ml.entities.CreatedByType
24+
:ivar last_modified_at: The timestamp of resource last modification (UTC).
25+
:vartype last_modified_at: ~datetime.datetime
1226
:keyword created_by: The identity that created the resource.
1327
:paramtype created_by: str
1428
:keyword created_by_type: The type of identity that created the resource. Accepted values are

0 commit comments

Comments
 (0)