Skip to content

doc: remove D212 from ignore to comply with PEP257 standards #2065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pydocstylerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[pydocstyle]
inherit = false
ignore = D104,D107,D202,D203,D212,D213,D214,D400,D401,D404,D406,D407,D411,D413,D414,D415,D417
ignore = D104,D107,D202,D203,D213,D214,D400,D401,D404,D406,D407,D411,D413,D414,D415,D417
match = (?!record_pb2).*\.py
6 changes: 2 additions & 4 deletions src/sagemaker/amazon/factorization_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Initialization for FactorizationMachinesPredictor class.
"""Initialization for FactorizationMachinesPredictor class.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
Expand Down Expand Up @@ -321,8 +320,7 @@ class FactorizationMachinesModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for FactorizationMachinesModel class.
"""Initialization for FactorizationMachinesModel class.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
8 changes: 4 additions & 4 deletions src/sagemaker/amazon/ipinsights.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ def __init__(
serializer=CSVSerializer(),
deserializer=JSONDeserializer(),
):
"""
Args:
"""Creates object to be used to get dot product of entity nad IP address.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
requests are sent.
sagemaker_session (sagemaker.session.Session): A SageMaker Session
Expand Down Expand Up @@ -223,9 +223,9 @@ class IPInsightsModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Args:
"""Creates object to get insights on S3 model data.

Args:
model_data (str): The S3 location of a SageMaker model data
``.tar.gz`` file.
role (str): An AWS IAM role (either name or full ARN). The Amazon
Expand Down
6 changes: 2 additions & 4 deletions src/sagemaker/amazon/kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Initialization for KMeansPredictor class.
"""Initialization for KMeansPredictor class.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
Expand Down Expand Up @@ -248,8 +247,7 @@ class KMeansModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for KMeansModel class.
"""Initialization for KMeansModel class.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
6 changes: 2 additions & 4 deletions src/sagemaker/amazon/knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Function to initialize KNNPredictor.
"""Function to initialize KNNPredictor.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
Expand Down Expand Up @@ -240,8 +239,7 @@ class KNNModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Function to initialize KNNModel.
"""Function to initialize KNNModel.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
10 changes: 4 additions & 6 deletions src/sagemaker/amazon/lda.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ def __init__(
tol=None,
**kwargs
):
"""
Latent Dirichlet Allocation (LDA) is :class:`Estimator` used for unsupervised learning.
"""Latent Dirichlet Allocation (LDA) is :class:`Estimator` used for unsupervised learning.

Amazon SageMaker Latent Dirichlet Allocation is an unsupervised
learning algorithm that attempts to describe a set of observations as a
Expand Down Expand Up @@ -192,9 +191,9 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Args:
"""Creates "LDAPredictor" object to be used for transforming input vectors.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
requests are sent.
sagemaker_session (sagemaker.session.Session): A SageMaker Session
Expand Down Expand Up @@ -222,8 +221,7 @@ class LDAModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for LDAModel class.
"""Initialization for LDAModel class.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
6 changes: 2 additions & 4 deletions src/sagemaker/amazon/linear_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,7 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Initialization for LinearLearnerPredictor.
"""Initialization for LinearLearnerPredictor.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
Expand Down Expand Up @@ -483,8 +482,7 @@ class LinearLearnerModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for LinearLearnerModel.
"""Initialization for LinearLearnerModel.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
6 changes: 2 additions & 4 deletions src/sagemaker/amazon/ntm.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Initialization for NTMPredictor class.
"""Initialization for NTMPredictor class.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
Expand Down Expand Up @@ -251,8 +250,7 @@ class NTMModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for NTMModel class.
"""Initialization for NTMModel class.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/amazon/object2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ class Object2VecModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for Object2VecModel class.
"""Initialization for Object2VecModel class.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
6 changes: 2 additions & 4 deletions src/sagemaker/amazon/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Initialization for PCAPredictor.
"""Initialization for PCAPredictor.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
Expand Down Expand Up @@ -239,8 +238,7 @@ class PCAModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for PCAModel.
"""Initialization for PCAModel.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
6 changes: 2 additions & 4 deletions src/sagemaker/amazon/randomcutforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ def __init__(
serializer=RecordSerializer(),
deserializer=RecordDeserializer(),
):
"""
Initialization for RandomCutForestPredictor class.
"""Initialization for RandomCutForestPredictor class.

Args:
endpoint_name (str): Name of the Amazon SageMaker endpoint to which
Expand Down Expand Up @@ -211,8 +210,7 @@ class RandomCutForestModel(Model):
"""

def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
"""
Initialization for RandomCutForestModel class.
"""Initialization for RandomCutForestModel class.

Args:
model_data (str): The S3 location of a SageMaker model data
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/clarify.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ def __init__(
use_logit=False,
save_local_shap_values=True,
):
"""
Initializes config for SHAP.
"""Initializes config for SHAP.

Args:
baseline (str or list): A list of rows (at least one) or S3 object URI to be used as
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/debugger/framework_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@


class FrameworkProfile:
"""
Sets up the profiling configuration for framework metrics.
"""Sets up the profiling configuration for framework metrics.

Validates user inputs and fills in default values if no input is provided.
There are three main profiling options to choose from:
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1570,8 +1570,7 @@ def _get_update_args(cls, estimator, profiler_rule_configs, profiler_config):
return update_args

def wait(self, logs="All"):
"""
Placeholder docstring.
"""Placeholder docstring.

Args:
logs ([str]): A list of strings specifying which logs to print. Acceptable
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/pytorch/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def __init__(
distribution=None,
**kwargs
):
"""
This ``Estimator`` executes an PyTorch script in a managed PyTorch execution environment.
"""This ``Estimator`` executes a PyTorch script in a managed PyTorch execution environment.

The managed PyTorch environment is an Amazon-built Docker container that executes functions
defined in the supplied ``entry_point`` Python script within a SageMaker Training Job.
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/pytorch/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ def serving_image_uri(self, region_name, instance_type, accelerator_type=None):
)

def _is_mms_version(self):
"""
Determines if the framework corresponds to an and using MMS.
"""Determines if the framework corresponds to an and using MMS.

Whether the framework version corresponds to an inference image using
the Multi-Model Server (https://github.com/awslabs/multi-model-server).
Expand Down
20 changes: 8 additions & 12 deletions src/sagemaker/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2029,14 +2029,13 @@ def create_tuning_job(
self.sagemaker_client.create_hyper_parameter_tuning_job(**tune_request)

def describe_tuning_job(self, job_name):
"""
Calls the DescribeHyperParameterTuningJob API for the given job name, returns the response.
"""Calls DescribeHyperParameterTuningJob API for the given job name, returns the response.

Args:
job_name (str): The name of the hyperparameter tuning job to describe.
Args:
job_name (str): The name of the hyperparameter tuning job to describe.

Returns:
dict: A dictionary response with the hyperparameter tuning job description.
Returns:
dict: A dictionary response with the hyperparameter tuning job description.
"""
return self.sagemaker_client.describe_hyper_parameter_tuning_job(
HyperParameterTuningJobName=job_name
Expand All @@ -2053,8 +2052,7 @@ def _map_tuning_config(
objective_metric_name=None,
parameter_ranges=None,
):
"""
Construct tuning job configuration dictionary.
"""Construct tuning job configuration dictionary.

Args:
strategy (str): Strategy to be used for hyperparameter estimations.
Expand Down Expand Up @@ -2097,8 +2095,7 @@ def _map_tuning_config(

@classmethod
def _map_tuning_objective(cls, objective_type, objective_metric_name):
"""
Construct a dictionary of tuning objective from the arguments.
"""Construct a dictionary of tuning objective from the arguments.

Args:
objective_type (str): The type of the objective metric for evaluating training jobs.
Expand Down Expand Up @@ -2148,8 +2145,7 @@ def _map_training_config(
checkpoint_s3_uri=None,
checkpoint_local_path=None,
):
"""
Construct a dictionary of training job configuration from the arguments.
"""Construct a dictionary of training job configuration from the arguments.

Args:
static_hyperparameters (dict): Hyperparameters for model training. These
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/sklearn/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def __init__(
image_uri=None,
**kwargs
):
"""
Creates a SKLearn Estimator for Scikit-learn environment.
"""Creates a SKLearn Estimator for Scikit-learn environment.

It will execute an Scikit-learn script within a SageMaker Training Job. The managed
Scikit-learn environment is an Amazon-built Docker container that executes functions
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/tensorflow/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ def create_model(
dependencies=None,
**kwargs
):
"""
Create a ``TensorFlowModel`` object that can be used for creating SageMaker model entities.
"""Creates ``TensorFlowModel`` object to be used for creating SageMaker model entities.

This can be done by deploying it to a SageMaker endpoint,
or starting SageMaker Batch Transform jobs.
Expand Down
3 changes: 1 addition & 2 deletions src/sagemaker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,7 @@ def _botocore_resolver():


def _aws_partition(region):
"""
Given a region name (ex: "cn-north-1"), return the corresponding aws partition ("aws-cn").
"""Given a region name (ex: "cn-north-1"), return the corresponding aws partition ("aws-cn").

Args:
region (str): The region name for which to return the corresponding partition.
Expand Down
6 changes: 2 additions & 4 deletions src/sagemaker/workflow/airflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,7 @@ def _extract_training_config_from_estimator(tuner, inputs, include_cls_metadata,
def _extract_training_config_list_from_estimator_dict(
tuner, inputs, include_cls_metadata, mini_batch_size
):
"""
Extracts a list of training job configs from a Hyperparameter Tuner.
"""Extracts a list of training job configs from a Hyperparameter Tuner.

It uses the ``estimator_dict`` field.
"""
Expand Down Expand Up @@ -511,8 +510,7 @@ def update_estimator_from_task(estimator, task_id, task_type):


def prepare_framework_container_def(model, instance_type, s3_operations):
"""
This prepares the framework model container information and specifies related S3 operations.
"""This prepares the framework model container information and specifies related S3 operations.

Prepare the framework model container information. Specify related S3
operations for Airflow to perform. (Upload `source_dir` )
Expand Down