Skip to content

Commit ffc7fdb

Browse files
committed
doc: modified docstrings to comply with PEP257 standards
1 parent c49aafe commit ffc7fdb

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

src/sagemaker/algorithm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ def fit(self, inputs=None, wait=True, logs=True, job_name=None):
423423
super(AlgorithmEstimator, self).fit(inputs, wait, logs, job_name)
424424

425425
def _validate_input_channels(self, channels):
426+
"""Placeholder docstring"""
426427
train_spec = self.algorithm_spec["TrainingSpecification"]
427428
algorithm_name = self.algorithm_spec["AlgorithmName"]
428429
training_channels = {c["Name"]: c for c in train_spec["TrainingChannels"]}
@@ -440,6 +441,7 @@ def _validate_input_channels(self, channels):
440441
raise ValueError("Required input channel: %s Was not provided." % (name))
441442

442443
def _validate_and_cast_hyperparameter(self, name, v):
444+
"""Placeholder docstring"""
443445
algorithm_name = self.algorithm_spec["AlgorithmName"]
444446

445447
if name not in self.hyperparameter_definitions:
@@ -533,6 +535,7 @@ def _hyperparameter_range_and_class(self, parameter_type, hyperparameter):
533535
return parameter_class, parameter_range
534536

535537
def _algorithm_training_input_modes(self, training_channels):
538+
"""Placeholder docstring"""
536539
current_input_modes = {"File", "Pipe"}
537540
for channel in training_channels:
538541
supported_input_modes = set(channel["SupportedInputModes"])

src/sagemaker/multidatamodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
class MultiDataModel(Model):
30-
"""A SageMaker ``MultiDataModel`` that can be used to deploy multiple models to the same ``Endpoint``.
30+
"""SageMaker ``MultiDataModel`` can be used to deploy multiple models to the same ``Endpoint``.
3131
3232
And also deploy additional models to an existing SageMaker multi-model ``Endpoint``
3333
"""
@@ -44,7 +44,7 @@ def __init__(
4444
):
4545
"""Initialize a ``MultiDataModel``.
4646
47-
In addition to these arguments, it supports all arguments supported by ``Model`` constructor.
47+
Addition to these arguments, it supports all arguments supported by ``Model`` constructor.
4848
4949
Args:
5050
name (str): The model name.

src/sagemaker/parameter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def cast_to_type(cls, value):
5757
def as_tuning_range(self, name):
5858
"""Represent the parameter range as a dictionary.
5959
60-
Dictionary is suitable for a request to create an Amazon SageMaker hyperparameter tuning job.
60+
It is suitable for a request to create an Amazon SageMaker hyperparameter tuning job.
6161
6262
Args:
6363
name (str): The name of the hyperparameter.
@@ -110,7 +110,7 @@ def __init__(self, values): # pylint: disable=super-init-not-called
110110
def as_tuning_range(self, name):
111111
"""Represent the parameter range as a dictionary.
112112
113-
Dictionary is suitable for a request to create an Amazon SageMaker hyperparameter tuning job.
113+
It is suitable for a request to create an Amazon SageMaker hyperparameter tuning job.
114114
115115
Args:
116116
name (str): The name of the hyperparameter.

src/sagemaker/predictor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ def predict(self, data, initial_args=None, target_model=None, target_variant=Non
126126
return self._handle_response(response)
127127

128128
def _handle_response(self, response):
129+
"Placeholder docstring"
129130
response_body = response["Body"]
130131
content_type = response.get("ContentType", "application/octet-stream")
131132
return self.deserializer.deserialize(response_body, content_type)
132133

133134
def _create_request_args(self, data, initial_args=None, target_model=None, target_variant=None):
135+
"Placeholder docstring"
134136
args = dict(initial_args) if initial_args else {}
135137

136138
if "EndpointName" not in args:

src/sagemaker/transformer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,9 @@ def attach(cls, transform_job_name, sagemaker_session=None):
301301

302302
@classmethod
303303
def _prepare_init_params_from_job_description(cls, job_details):
304-
"""Convert the transform job description to init params that can be handled by the class constructor.
304+
"""Convert the transform job description to init params.
305+
306+
It can be handled by the class constructor.
305307
306308
Args:
307309
job_details (dict): the returned job details from a

0 commit comments

Comments
 (0)