Skip to content

Commit b0d7030

Browse files
IvyBazanDan Choi
authored and
Dan Choi
committed
documentation: include pipelines docs in rst and add grammatical fixes (aws#468)
1 parent 1f92188 commit b0d7030

File tree

9 files changed

+145
-140
lines changed

9 files changed

+145
-140
lines changed

doc/workflows/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ The SageMaker Python SDK supports managed training and inference for a variety o
99

1010
airflow/index
1111
step_functions/index
12+
.. pipelines/index

src/sagemaker/workflow/condition_step.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535

3636

3737
class ConditionStep(Step):
38-
"""Conditional step for workflow to support branches in execution of steps.
38+
"""Conditional step for pipelines to support conditional branching in the execution of steps.
3939
4040
Attributes:
4141
name (str): The name of the condition step.
4242
step_type (StepTypeEnum): The type of the step with value `StepTypeEnum.CONDITION`.
43-
conditions (List[Condition]): A list of `sagemaker.workflow.conditions.Condition`.
43+
conditions (List[Condition]): A list of `sagemaker.workflow.conditions.Condition` instances.
4444
if_steps (List[Union[Step, StepCollection]]): A list of `sagemaker.workflow.steps.Step`
4545
and `sagemaker.workflow.step_collections.StepCollection` instances.
4646
else_steps (List[Union[Step, StepCollection]]): A list of `sagemaker.workflow.steps.Step`
@@ -54,9 +54,9 @@ def __init__(
5454
if_steps: List[Union[Step, StepCollection]] = None,
5555
else_steps: List[Union[Step, StepCollection]] = None,
5656
):
57-
"""Constructs a ConditionStep for branch execution.
57+
"""Constructs a ConditionStep for conditional execution branching.
5858
59-
If all the conditions in the condition list evaluate to True, the `if_steps` are
59+
If all of the conditions in the condition list evaluate to True, the `if_steps` are
6060
marked as ready for execution. Otherwise, the `else_steps` are marked as ready for
6161
execution.
6262
@@ -65,11 +65,11 @@ def __init__(
6565
conditions (List[Condition]): A list of `sagemaker.workflow.conditions.Condition`
6666
instances.
6767
if_steps (List[Union[Step, StepCollection]]): A list of `sagemaker.workflow.steps.Step`
68-
and `sagemaker.workflow.step_collections.StepCollection` instances that will be
69-
marked ready for execution if the list of conditions evaluates to True.
68+
and `sagemaker.workflow.step_collections.StepCollection` instances that are
69+
marked as ready for execution if the list of conditions evaluates to True.
7070
else_steps (List[Union[Step, StepCollection]]): A list of `sagemaker.workflow.steps.Step`
71-
and `sagemaker.workflow.step_collections.StepCollection` instances that will be
72-
marked ready for execution if the list of conditions evaluates to True.
71+
and `sagemaker.workflow.step_collections.StepCollection` instances that are
72+
marked as ready for execution if the list of conditions evaluates to True.
7373
"""
7474
super(ConditionStep, self).__init__(name, StepTypeEnum.CONDITION)
7575
self.conditions = conditions or []
@@ -83,7 +83,7 @@ def __init__(
8383

8484
@property
8585
def arguments(self) -> RequestType:
86-
"""The arguments dict that are used to define the condition branching in the pipeline."""
86+
"""The arguments dict that is used to define the conditional branching in the pipeline."""
8787
return dict(
8888
Conditions=[condition.to_request() for condition in self.conditions],
8989
IfSteps=list_to_request(self.if_steps),
@@ -98,13 +98,13 @@ def properties(self):
9898

9999
@attr.s
100100
class JsonGet(Expression):
101-
"""A function to get json properties from PropertyFiles.
101+
"""A function to get JSON properties from PropertyFiles.
102102
103103
Attributes:
104-
step (Step): The step from which to get the property file
104+
step (Step): The step from which to get the property file.
105105
property_file (Union[PropertyFile, str]): Either a PropertyFile instance
106-
or a name of a property file.
107-
json_path (str): The json path expression to the value of interest.
106+
or the name of a property file.
107+
json_path (str): The JSON path expression to the requested value.
108108
"""
109109

110110
step: Step = attr.ib()

src/sagemaker/workflow/conditions.py

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class ConditionComparison(Condition):
6868
Attributes:
6969
condition_type (ConditionTypeEnum): The type of condition.
7070
left (ConditionValueType): The execution variable, parameter, or
71-
property to use in comparison.
71+
property to use in the comparison.
7272
right (Union[ConditionValueType, PrimitiveType]): The execution variable,
73-
parameter, property, or python primitive value to compare to.
73+
parameter, property, or Python primitive value to compare to.
7474
"""
7575

7676
left: ConditionValueType = attr.ib(default=None)
@@ -91,19 +91,19 @@ class ConditionEquals(ConditionComparison):
9191
Attributes:
9292
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.EQ` type of condition.
9393
left (ConditionValueType): The execution variable, parameter, or
94-
property to use in comparison.
94+
property to use in the comparison.
9595
right (Union[ConditionValueType, PrimitiveType]): The execution variable,
96-
parameter, property, or python primitive value to compare to.
96+
parameter, property, or Python primitive value to compare to.
9797
"""
9898

9999
def __init__(self, left: ConditionValueType, right: Union[ConditionValueType, PrimitiveType]):
100100
"""Constructs an instance of ConditionEquals.
101101
102102
Args:
103103
left (ConditionValueType): The execution variable, parameter,
104-
or property to use in comparison.
104+
or property to use in the comparison.
105105
right (Union[ConditionValueType, PrimitiveType]): The execution
106-
variable, parameter, property, or python primitive value to compare to.
106+
variable, parameter, property, or Python primitive value to compare to.
107107
"""
108108

109109
super(ConditionEquals, self).__init__(ConditionTypeEnum.EQ, left, right)
@@ -115,19 +115,19 @@ class ConditionGreaterThan(ConditionComparison):
115115
Attributes:
116116
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.GT` type of condition.
117117
left (ConditionValueType): The execution variable, parameter, or
118-
property to use in comparison.
118+
property to use in the comparison.
119119
right (Union[ConditionValueType, PrimitiveType]): The execution variable,
120-
parameter, property, or python primitive value to compare to.
120+
parameter, property, or Python primitive value to compare to.
121121
"""
122122

123123
def __init__(self, left: ConditionValueType, right: Union[ConditionValueType, PrimitiveType]):
124124
"""Constructs an instance of ConditionGreaterThan.
125125
126126
Args:
127127
left (ConditionValueType): The execution variable, parameter,
128-
or property to use in comparison.
128+
or property to use in the comparison.
129129
right (Union[ConditionValueType, PrimitiveType]): The execution
130-
variable, parameter, property, or python primitive value to compare to.
130+
variable, parameter, property, or Python primitive value to compare to.
131131
"""
132132

133133
super(ConditionGreaterThan, self).__init__(ConditionTypeEnum.GT, left, right)
@@ -139,19 +139,19 @@ class ConditionGreaterThanOrEqualTo(ConditionComparison):
139139
Attributes:
140140
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.GTE` type of condition.
141141
left (ConditionValueType): The execution variable, parameter, or
142-
property to use in comparison.
142+
property to use in the comparison.
143143
right (Union[ConditionValueType, PrimitiveType]): The execution variable,
144-
parameter, property, or python primitive value to compare to.
144+
parameter, property, or Python primitive value to compare to.
145145
"""
146146

147147
def __init__(self, left: ConditionValueType, right: Union[ConditionValueType, PrimitiveType]):
148148
"""Constructs an instance of ConditionGreaterThanOrEqualTo.
149149
150150
Args:
151151
left (ConditionValueType): The execution variable, parameter,
152-
or property to use in comparison.
152+
or property to use in the comparison.
153153
right (Union[ConditionValueType, PrimitiveType]): The execution
154-
variable, parameter, property, or python primitive value to compare to.
154+
variable, parameter, property, or Python primitive value to compare to.
155155
"""
156156

157157
super(ConditionGreaterThanOrEqualTo, self).__init__(ConditionTypeEnum.GTE, left, right)
@@ -163,19 +163,19 @@ class ConditionLessThan(ConditionComparison):
163163
Attributes:
164164
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.LT` type of condition.
165165
left (ConditionValueType): The execution variable, parameter, or
166-
property to use in comparison.
166+
property to use in the comparison.
167167
right (Union[ConditionValueType, PrimitiveType]): The execution variable,
168-
parameter, property, or python primitive value to compare to.
168+
parameter, property, or Python primitive value to compare to.
169169
"""
170170

171171
def __init__(self, left: ConditionValueType, right: Union[ConditionValueType, PrimitiveType]):
172172
"""Constructs an instance of ConditionLessThan.
173173
174174
Args:
175175
left (ConditionValueType): The execution variable, parameter,
176-
or property to use in comparison.
176+
or property to use in the comparison.
177177
right (Union[ConditionValueType, PrimitiveType]): The execution
178-
variable, parameter, property, or python primitive value to compare to.
178+
variable, parameter, property, or Python primitive value to compare to.
179179
"""
180180

181181
super(ConditionLessThan, self).__init__(ConditionTypeEnum.LT, left, right)
@@ -187,26 +187,26 @@ class ConditionLessThanOrEqualTo(ConditionComparison):
187187
Attributes:
188188
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.LTE` type of condition.
189189
left (ConditionValueType): The execution variable, parameter, or
190-
property to use in comparison.
190+
property to use in the comparison.
191191
right (Union[ConditionValueType, PrimitiveType]): The execution variable,
192-
parameter, property, or python primitive value to compare to.
192+
parameter, property, or Python primitive value to compare to.
193193
"""
194194

195195
def __init__(self, left: ConditionValueType, right: Union[ConditionValueType, PrimitiveType]):
196196
"""Constructs an instance of ConditionLessThanOrEqualTo.
197197
198198
Args:
199199
left (ConditionValueType): The execution variable, parameter,
200-
or property to use in comparison.
200+
or property to use in the comparison.
201201
right (Union[ConditionValueType, PrimitiveType]): The execution
202-
variable, parameter, property, or python primitive value to compare to.
202+
variable, parameter, property, or Python primitive value to compare to.
203203
"""
204204

205205
super(ConditionLessThanOrEqualTo, self).__init__(ConditionTypeEnum.LTE, left, right)
206206

207207

208208
class ConditionIn(Condition):
209-
"""An In condition for negating another `Condition`.
209+
"""A condition to check membership.
210210
211211
Attributes:
212212
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.IN` type of condition.
@@ -224,7 +224,7 @@ def __init__(
224224
value (ConditionValueType): The execution variable,
225225
parameter, or property to use for the in comparison.
226226
in_values (List[Union[ConditionValueType, PrimitiveType]]): The list
227-
of values to check the in comparison of.
227+
of values to check for membership in.
228228
"""
229229
super(ConditionIn, self).__init__(ConditionTypeEnum.IN)
230230
self.value = value
@@ -240,7 +240,7 @@ def to_request(self) -> RequestType:
240240

241241

242242
class ConditionNot(Condition):
243-
"""A Not condition for negating another `Condition`.
243+
"""A condition for negating another `Condition`.
244244
245245
Attributes:
246246
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.NOT` type of condition.
@@ -262,11 +262,11 @@ def to_request(self) -> RequestType:
262262

263263

264264
class ConditionOr(Condition):
265-
"""An Or condition for logical OR of a list of `Condition` instances.
265+
"""A condition for taking the logical OR of a list of `Condition` instances.
266266
267267
Attributes:
268268
condition_type (ConditionTypeEnum): A `ConditionTypeEnum.OR` type of condition.
269-
conditions (List[Condition]): A list of `Condition` to logically OR.
269+
conditions (List[Condition]): A list of `Condition` instances to logically OR.
270270
"""
271271

272272
def __init__(self, conditions: List[Condition] = None):
@@ -292,8 +292,7 @@ def primitive_or_expr(
292292
"""Provides the expression of the value or leaves the primitive value alone.
293293
294294
Args:
295-
value (Union[ConditionValueType, PrimitiveType]): If it is a
296-
PrimitiveType, leave it be. Otherwise, get the expr of the instance.
295+
value (Union[ConditionValueType, PrimitiveType]): The value to evaluate..
297296
298297
Returns:
299298
Either the expression of the value or the primitive value.

src/sagemaker/workflow/execution_variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __new__(cls, *args, **kwargs): # pylint: disable=unused-argument
3838
return str.__new__(cls, ExecutionVariable._expr(value))
3939

4040
def __init__(self, name: str):
41-
"""Create a pipeline execution variable.
41+
"""Creates a pipeline execution variable.
4242
4343
Args:
4444
name (str): The name of the execution variable.

0 commit comments

Comments
 (0)