Skip to content

Commit d14cda0

Browse files
committed
fix: remove D212 from ignore to comply with PEP257 standards.
1 parent 01c6ee3 commit d14cda0

21 files changed

+42
-73
lines changed

.pydocstylerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[pydocstyle]
22
inherit = false
3-
ignore = D104,D107,D202,D203,D212,D213,D214,D400,D401,D404,D406,D407,D411,D413,D414,D415,D417
3+
ignore = D104,D107,D202,D203,D213,D214,D400,D401,D404,D406,D407,D411,D413,D414,D415,D417
44
match = (?!record_pb2).*\.py

src/sagemaker/amazon/factorization_machines.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ def __init__(
290290
serializer=RecordSerializer(),
291291
deserializer=RecordDeserializer(),
292292
):
293-
"""
294-
Initialization for FactorizationMachinesPredictor class.
293+
"""Initialization for FactorizationMachinesPredictor class.
295294
296295
Args:
297296
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
@@ -321,8 +320,7 @@ class FactorizationMachinesModel(Model):
321320
"""
322321

323322
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
324-
"""
325-
Initialization for FactorizationMachinesModel class.
323+
"""Initialization for FactorizationMachinesModel class.
326324
327325
Args:
328326
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/ipinsights.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ def __init__(
193193
serializer=CSVSerializer(),
194194
deserializer=JSONDeserializer(),
195195
):
196-
"""
197-
Args:
196+
"""Creates object to be used to get dot product of entity nad IP address.
198197
198+
Args:
199199
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
200200
requests are sent.
201201
sagemaker_session (sagemaker.session.Session): A SageMaker Session
@@ -223,9 +223,9 @@ class IPInsightsModel(Model):
223223
"""
224224

225225
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
226-
"""
227-
Args:
226+
"""Creates object to get insights on S3 model data.
228227
228+
Args:
229229
model_data (str): The S3 location of a SageMaker model data
230230
``.tar.gz`` file.
231231
role (str): An AWS IAM role (either name or full ARN). The Amazon

src/sagemaker/amazon/kmeans.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ def __init__(
217217
serializer=RecordSerializer(),
218218
deserializer=RecordDeserializer(),
219219
):
220-
"""
221-
Initialization for KMeansPredictor class.
220+
"""Initialization for KMeansPredictor class.
222221
223222
Args:
224223
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
@@ -248,8 +247,7 @@ class KMeansModel(Model):
248247
"""
249248

250249
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
251-
"""
252-
Initialization for KMeansModel class.
250+
"""Initialization for KMeansModel class.
253251
254252
Args:
255253
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/knn.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ def __init__(
209209
serializer=RecordSerializer(),
210210
deserializer=RecordDeserializer(),
211211
):
212-
"""
213-
Function to initialize KNNPredictor.
212+
"""Function to initialize KNNPredictor.
214213
215214
Args:
216215
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
@@ -240,8 +239,7 @@ class KNNModel(Model):
240239
"""
241240

242241
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
243-
"""
244-
Function to initialize KNNModel.
242+
"""Function to initialize KNNModel.
245243
246244
Args:
247245
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/lda.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ def __init__(
5353
tol=None,
5454
**kwargs
5555
):
56-
"""
57-
Latent Dirichlet Allocation (LDA) is :class:`Estimator` used for unsupervised learning.
56+
"""Latent Dirichlet Allocation (LDA) is :class:`Estimator` used for unsupervised learning.
5857
5958
Amazon SageMaker Latent Dirichlet Allocation is an unsupervised
6059
learning algorithm that attempts to describe a set of observations as a
@@ -192,9 +191,9 @@ def __init__(
192191
serializer=RecordSerializer(),
193192
deserializer=RecordDeserializer(),
194193
):
195-
"""
196-
Args:
194+
"""Creates "LDAPredictor" object to be used for transforming input vectors.
197195
196+
Args:
198197
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
199198
requests are sent.
200199
sagemaker_session (sagemaker.session.Session): A SageMaker Session
@@ -222,8 +221,7 @@ class LDAModel(Model):
222221
"""
223222

224223
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
225-
"""
226-
Initialization for LDAModel class.
224+
"""Initialization for LDAModel class.
227225
228226
Args:
229227
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/linear_learner.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,7 @@ def __init__(
452452
serializer=RecordSerializer(),
453453
deserializer=RecordDeserializer(),
454454
):
455-
"""
456-
Initialization for LinearLearnerPredictor.
455+
"""Initialization for LinearLearnerPredictor.
457456
458457
Args:
459458
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
@@ -483,8 +482,7 @@ class LinearLearnerModel(Model):
483482
"""
484483

485484
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
486-
"""
487-
Initialization for LinearLearnerModel.
485+
"""Initialization for LinearLearnerModel.
488486
489487
Args:
490488
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/ntm.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,7 @@ def __init__(
220220
serializer=RecordSerializer(),
221221
deserializer=RecordDeserializer(),
222222
):
223-
"""
224-
Initialization for NTMPredictor class.
223+
"""Initialization for NTMPredictor class.
225224
226225
Args:
227226
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
@@ -251,8 +250,7 @@ class NTMModel(Model):
251250
"""
252251

253252
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
254-
"""
255-
Initialization for NTMModel class.
253+
"""Initialization for NTMModel class.
256254
257255
Args:
258256
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/object2vec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ class Object2VecModel(Model):
345345
"""
346346

347347
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
348-
"""
349-
Initialization for Object2VecModel class.
348+
"""Initialization for Object2VecModel class.
350349
351350
Args:
352351
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/pca.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ def __init__(
208208
serializer=RecordSerializer(),
209209
deserializer=RecordDeserializer(),
210210
):
211-
"""
212-
Initialization for PCAPredictor.
211+
"""Initialization for PCAPredictor.
213212
214213
Args:
215214
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
@@ -239,8 +238,7 @@ class PCAModel(Model):
239238
"""
240239

241240
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
242-
"""
243-
Initialization for PCAModel.
241+
"""Initialization for PCAModel.
244242
245243
Args:
246244
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/amazon/randomcutforest.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ def __init__(
180180
serializer=RecordSerializer(),
181181
deserializer=RecordDeserializer(),
182182
):
183-
"""
184-
Initialization for RandomCutForestPredictor class.
183+
"""Initialization for RandomCutForestPredictor class.
185184
186185
Args:
187186
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
@@ -211,8 +210,7 @@ class RandomCutForestModel(Model):
211210
"""
212211

213212
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
214-
"""
215-
Initialization for RandomCutForestModel class.
213+
"""Initialization for RandomCutForestModel class.
216214
217215
Args:
218216
model_data (str): The S3 location of a SageMaker model data

src/sagemaker/clarify.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,7 @@ def __init__(
262262
use_logit=False,
263263
save_local_shap_values=True,
264264
):
265-
"""
266-
Initializes config for SHAP.
265+
"""Initializes config for SHAP.
267266
268267
Args:
269268
baseline (str or list): A list of rows (at least one) or S3 object URI to be used as

src/sagemaker/debugger/framework_profile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838

3939

4040
class FrameworkProfile:
41-
"""
42-
Sets up the profiling configuration for framework metrics.
41+
"""Sets up the profiling configuration for framework metrics.
4342
4443
Validates user inputs and fills in default values if no input is provided.
4544
There are three main profiling options to choose from:

src/sagemaker/estimator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,8 +1570,7 @@ def _get_update_args(cls, estimator, profiler_rule_configs, profiler_config):
15701570
return update_args
15711571

15721572
def wait(self, logs="All"):
1573-
"""
1574-
Placeholder docstring.
1573+
"""Placeholder docstring.
15751574
15761575
Args:
15771576
logs ([str]): A list of strings specifying which logs to print. Acceptable

src/sagemaker/pytorch/estimator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ def __init__(
5151
distribution=None,
5252
**kwargs
5353
):
54-
"""
55-
This ``Estimator`` executes an PyTorch script in a managed PyTorch execution environment.
54+
"""This ``Estimator`` executes a PyTorch script in a managed PyTorch execution environment.
5655
5756
The managed PyTorch environment is an Amazon-built Docker container that executes functions
5857
defined in the supplied ``entry_point`` Python script within a SageMaker Training Job.

src/sagemaker/pytorch/model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ def serving_image_uri(self, region_name, instance_type, accelerator_type=None):
272272
)
273273

274274
def _is_mms_version(self):
275-
"""
276-
Determines if the framework corresponds to an and using MMS.
275+
"""Determines if the framework corresponds to an and using MMS.
277276
278277
Whether the framework version corresponds to an inference image using
279278
the Multi-Model Server (https://github.com/awslabs/multi-model-server).

src/sagemaker/session.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,14 +2029,13 @@ def create_tuning_job(
20292029
self.sagemaker_client.create_hyper_parameter_tuning_job(**tune_request)
20302030

20312031
def describe_tuning_job(self, job_name):
2032-
"""
2033-
Calls the DescribeHyperParameterTuningJob API for the given job name, returns the response.
2032+
"""Calls DescribeHyperParameterTuningJob API for the given job name, returns the response.
20342033
2035-
Args:
2036-
job_name (str): The name of the hyperparameter tuning job to describe.
2034+
Args:
2035+
job_name (str): The name of the hyperparameter tuning job to describe.
20372036
2038-
Returns:
2039-
dict: A dictionary response with the hyperparameter tuning job description.
2037+
Returns:
2038+
dict: A dictionary response with the hyperparameter tuning job description.
20402039
"""
20412040
return self.sagemaker_client.describe_hyper_parameter_tuning_job(
20422041
HyperParameterTuningJobName=job_name
@@ -2053,8 +2052,7 @@ def _map_tuning_config(
20532052
objective_metric_name=None,
20542053
parameter_ranges=None,
20552054
):
2056-
"""
2057-
Construct tuning job configuration dictionary.
2055+
"""Construct tuning job configuration dictionary.
20582056
20592057
Args:
20602058
strategy (str): Strategy to be used for hyperparameter estimations.
@@ -2097,8 +2095,7 @@ def _map_tuning_config(
20972095

20982096
@classmethod
20992097
def _map_tuning_objective(cls, objective_type, objective_metric_name):
2100-
"""
2101-
Construct a dictionary of tuning objective from the arguments.
2098+
"""Construct a dictionary of tuning objective from the arguments.
21022099
21032100
Args:
21042101
objective_type (str): The type of the objective metric for evaluating training jobs.
@@ -2148,8 +2145,7 @@ def _map_training_config(
21482145
checkpoint_s3_uri=None,
21492146
checkpoint_local_path=None,
21502147
):
2151-
"""
2152-
Construct a dictionary of training job configuration from the arguments.
2148+
"""Construct a dictionary of training job configuration from the arguments.
21532149
21542150
Args:
21552151
static_hyperparameters (dict): Hyperparameters for model training. These

src/sagemaker/sklearn/estimator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def __init__(
4545
image_uri=None,
4646
**kwargs
4747
):
48-
"""
49-
Creates a SKLearn Estimator for Scikit-learn environment.
48+
"""Creates a SKLearn Estimator for Scikit-learn environment.
5049
5150
It will execute an Scikit-learn script within a SageMaker Training Job. The managed
5251
Scikit-learn environment is an Amazon-built Docker container that executes functions

src/sagemaker/tensorflow/estimator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ def create_model(
265265
dependencies=None,
266266
**kwargs
267267
):
268-
"""
269-
Create a ``TensorFlowModel`` object that can be used for creating SageMaker model entities.
268+
"""Creates ``TensorFlowModel`` object to be used for creating SageMaker model entities.
270269
271270
This can be done by deploying it to a SageMaker endpoint,
272271
or starting SageMaker Batch Transform jobs.

src/sagemaker/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,7 @@ def _botocore_resolver():
570570

571571

572572
def _aws_partition(region):
573-
"""
574-
Given a region name (ex: "cn-north-1"), return the corresponding aws partition ("aws-cn").
573+
"""Given a region name (ex: "cn-north-1"), return the corresponding aws partition ("aws-cn").
575574
576575
Args:
577576
region (str): The region name for which to return the corresponding partition.

src/sagemaker/workflow/airflow.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ def _extract_training_config_from_estimator(tuner, inputs, include_cls_metadata,
388388
def _extract_training_config_list_from_estimator_dict(
389389
tuner, inputs, include_cls_metadata, mini_batch_size
390390
):
391-
"""
392-
Extracts a list of training job configs from a Hyperparameter Tuner.
391+
"""Extracts a list of training job configs from a Hyperparameter Tuner.
393392
394393
It uses the ``estimator_dict`` field.
395394
"""
@@ -511,8 +510,7 @@ def update_estimator_from_task(estimator, task_id, task_type):
511510

512511

513512
def prepare_framework_container_def(model, instance_type, s3_operations):
514-
"""
515-
This prepares the framework model container information and specifies related S3 operations.
513+
"""This prepares the framework model container information and specifies related S3 operations.
516514
517515
Prepare the framework model container information. Specify related S3
518516
operations for Airflow to perform. (Upload `source_dir` )

0 commit comments

Comments
 (0)