Skip to content

Commit 326d0ae

Browse files
committed
fix: fixed conflicts to comply with latest version
1 parent ffc7fdb commit 326d0ae

File tree

16 files changed

+49
-30
lines changed

16 files changed

+49
-30
lines changed

src/sagemaker/algorithm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ def _parse_hyperparameters(self):
495495
return definitions
496496

497497
def _hyperparameter_range_and_class(self, parameter_type, hyperparameter):
498+
"""Placeholder docstring."""
498499
if parameter_type in self._hyperpameters_with_range:
499500
range_name = parameter_type + "ParameterRangeSpecification"
500501

src/sagemaker/amazon/knn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ def __init__(
235235
class KNNModel(Model):
236236
"""Reference S3 model data created by KNN estimator.
237237
238-
Calling :meth:`~sagemaker.model.Model.deploy` creates an Endpoint and returns :class:`KNNPredictor`.
238+
Calling :meth:`~sagemaker.model.Model.deploy` creates an Endpoint
239+
and returns :class:`KNNPredictor`.
239240
"""
240241

241242
def __init__(self, model_data, role, sagemaker_session=None, **kwargs):

src/sagemaker/cli/compatibility/v2/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class FileUpdater(object):
2929
"""An abstract class for updating files."""
3030

3131
def __init__(self, input_path, output_path):
32-
"""Creates a ``FileUpdater`` for updating a file to be compatible with version 2.0 and later.
32+
"""Creates ``FileUpdater`` for updating a file to be compatible with version 2.0 and later.
3333
3434
Args:
3535
input_path (str): Location of the input file.

src/sagemaker/cli/compatibility/v2/modifiers/modifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
class Modifier(object):
20-
"""Abstract class to check if an AST node needs modification, and potentially modify the node."""
20+
"""Abstract class to check if an AST node needs modification, potentially modify the node."""
2121

2222
def check_and_modify_node(self, node):
2323
"""Check an AST node, and modify, replace, or remove it if applicable."""

src/sagemaker/git_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def _insert_token_to_repo_url(url, token):
307307

308308

309309
def _insert_username_and_password_to_repo_url(url, username, password):
310-
"""Insert username and password to the Git repo url, to make a component of the git clone command.
310+
"""Insert username and password to the Git repo url to make a component of git clone command.
311311
312312
This method can only be called when repo_url is an https url.
313313

src/sagemaker/local/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ def pad(self, file, size=6):
379379

380380

381381
def _payload_size_within_limit(payload, size):
382+
"""Placeholder docstring."""
382383
size_in_bytes = size * 1024 * 1024
383384
if size == 0:
384385
return True

src/sagemaker/local/entities.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def __init__(self, container):
5454
self.end_time = None
5555

5656
def start(self, input_data_config, output_data_config, hyperparameters, job_name):
57+
"""Placeholder docstring."""
5758
for channel in input_data_config:
5859
if channel["DataSource"] and "S3DataSource" in channel["DataSource"]:
5960
data_distribution = channel["DataSource"]["S3DataSource"]["S3DataDistributionType"]
@@ -466,6 +467,7 @@ def describe(self):
466467

467468

468469
def _wait_for_serving_container(serving_port):
470+
"""Placeholder docstring."""
469471
i = 0
470472
http = urllib3.PoolManager()
471473

@@ -486,6 +488,7 @@ def _wait_for_serving_container(serving_port):
486488

487489

488490
def _perform_request(endpoint_url, pool_manager=None):
491+
"""Placeholder docstring."""
489492
http = pool_manager or urllib3.PoolManager()
490493
try:
491494
r = http.request("GET", endpoint_url)

src/sagemaker/model.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _get_model_package_args(
246246
return model_package_args
247247

248248
def _init_sagemaker_session_if_does_not_exist(self, instance_type):
249-
"""Set ``self.sagemaker_session`` to be a ``LocalSession`` or ``Session`` if it is not already.
249+
"""Set ``self.sagemaker_session`` to ``LocalSession`` or ``Session`` if it's not already.
250250
251251
The type of session object is determined by the instance type.
252252
"""
@@ -1060,8 +1060,9 @@ def __init__(
10601060
self.repacked_model_data = None
10611061

10621062
def prepare_container_def(self, instance_type=None, accelerator_type=None):
1063-
"""Return a container definition with framework configuration set in model environment variables.
1063+
"""Return a container definition with framework configuration.
10641064
1065+
Framework configuration is set in model environment variables.
10651066
This also uploads user-supplied code to S3.
10661067
10671068
Args:

src/sagemaker/model_monitor/cron_expression_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
class CronExpressionGenerator(object):
22-
"""Generates cron expression strings for use with the SageMaker Model Monitoring Schedule API."""
22+
"""Generates cron expression strings for the SageMaker Model Monitoring Schedule API."""
2323

2424
@staticmethod
2525
def hourly():

src/sagemaker/mxnet/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ def register(
211211
)
212212

213213
def prepare_container_def(self, instance_type=None, accelerator_type=None):
214-
"""Return a container definition with framework configuration set in model environment variables.
214+
"""Return a container definition with framework configuration.
215+
216+
Framework configuration is set in model environment variables.
215217
216218
Args:
217219
instance_type (str): The EC2 instance type to deploy this Model to.
@@ -273,7 +275,7 @@ def serving_image_uri(self, region_name, instance_type, accelerator_type=None):
273275
)
274276

275277
def _is_mms_version(self):
276-
"""Whether the framework version corresponds to an inference image using the Multi-Model Server.
278+
"""Whether the framework version corresponds to an inference image using the MMS.
277279
278280
MMS Server: (https://github.com/awslabs/multi-model-server).
279281

src/sagemaker/predictor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +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"
129+
"""Placeholder docstring"""
130130
response_body = response["Body"]
131131
content_type = response.get("ContentType", "application/octet-stream")
132132
return self.deserializer.deserialize(response_body, content_type)
133133

134134
def _create_request_args(self, data, initial_args=None, target_model=None, target_variant=None):
135-
"Placeholder docstring"
135+
"""Placeholder docstring"""
136136
args = dict(initial_args) if initial_args else {}
137137

138138
if "EndpointName" not in args:

src/sagemaker/rl/estimator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ def hyperparameters(self):
344344

345345
@classmethod
346346
def _toolkit_and_version_from_tag(cls, image_tag):
347+
"""Placeholder docstring."""
347348
tag_pattern = re.compile(
348349
"^([A-Z]*|[a-z]*)(\d.*)-(cpu|gpu)-(py2|py3)$" # noqa: W605,E501 pylint: disable=anomalous-backslash-in-string
349350
)
@@ -354,6 +355,7 @@ def _toolkit_and_version_from_tag(cls, image_tag):
354355

355356
@classmethod
356357
def _validate_framework_format(cls, framework):
358+
"""Placeholder docstring."""
357359
if framework and framework not in list(RLFramework):
358360
raise ValueError(
359361
"Invalid type: {}, valid RL frameworks types are: {}".format(
@@ -363,13 +365,15 @@ def _validate_framework_format(cls, framework):
363365

364366
@classmethod
365367
def _validate_toolkit_format(cls, toolkit):
368+
"""Placeholder docstring."""
366369
if toolkit and toolkit not in list(RLToolkit):
367370
raise ValueError(
368371
"Invalid type: {}, valid RL toolkits types are: {}".format(toolkit, list(RLToolkit))
369372
)
370373

371374
@classmethod
372375
def _validate_images_args(cls, toolkit, toolkit_version, framework, image_uri):
376+
"""Placeholder docstring."""
373377
cls._validate_toolkit_format(toolkit)
374378
cls._validate_framework_format(framework)
375379

@@ -404,6 +408,7 @@ def _validate_images_args(cls, toolkit, toolkit_version, framework, image_uri):
404408

405409
@classmethod
406410
def _is_combination_supported(cls, toolkit, toolkit_version, framework):
411+
"""Placeholder docstring."""
407412
supported_versions = TOOLKIT_FRAMEWORK_VERSION_MAP.get(toolkit, None)
408413
if supported_versions:
409414
supported_frameworks = supported_versions.get(toolkit_version, None)
@@ -413,6 +418,7 @@ def _is_combination_supported(cls, toolkit, toolkit_version, framework):
413418

414419
@classmethod
415420
def _validate_toolkit_support(cls, toolkit, toolkit_version, framework):
421+
"""Placeholder docstring."""
416422
if not cls._is_combination_supported(toolkit, toolkit_version, framework):
417423
raise AttributeError(
418424
"Provided `{}-{}` and `{}` combination is not supported.".format(

src/sagemaker/session.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ def delete_monitoring_schedule(self, monitoring_schedule_name):
13531353
)
13541354

13551355
def describe_monitoring_schedule(self, monitoring_schedule_name):
1356-
"""Calls the DescribeMonitoringSchedule API for given monitoring schedule name and returns the response.
1356+
"""Calls the DescribeMonitoringSchedule API for given name and returns the response.
13571357
13581358
Args:
13591359
monitoring_schedule_name (str): The name of the processing job to describe.
@@ -1427,7 +1427,9 @@ def list_monitoring_schedules(
14271427
return response
14281428

14291429
def was_processing_job_successful(self, job_name):
1430-
"""Calls the DescribeProcessingJob API for the given job name and returns True if job was successful.
1430+
"""Calls the DescribeProcessingJob API for the given job name.
1431+
1432+
It returns True if job was successful.
14311433
14321434
Args:
14331435
job_name (str): The name of the processing job to describe.
@@ -1614,7 +1616,7 @@ def wait_for_auto_ml_job(self, job, poll=5):
16141616
def logs_for_auto_ml_job( # noqa: C901 - suppress complexity warning for this method
16151617
self, job_name, wait=False, poll=10
16161618
):
1617-
"""Display the logs for a given AutoML job, optionally tailing them until the job is complete.
1619+
"""Display logs for a given AutoML job, optionally tailing them until job is complete.
16181620
16191621
If the output is a tty or a Jupyter cell, it will be color-coded
16201622
based on which instance the log entry is from.
@@ -1943,7 +1945,7 @@ def create_tuning_job(
19431945

19441946
def describe_tuning_job(self, job_name):
19451947
"""
1946-
Calls the DescribeHyperParameterTuningJob API for the given job name and returns the response.
1948+
Calls the DescribeHyperParameterTuningJob API for the given job name, returns the response.
19471949
19481950
Args:
19491951
job_name (str): The name of the hyperparameter tuning job to describe.
@@ -2861,7 +2863,7 @@ def create_endpoint_config_from_existing(
28612863
self.sagemaker_client.create_endpoint_config(**request)
28622864

28632865
def create_endpoint(self, endpoint_name, config_name, tags=None, wait=True):
2864-
"""Create an Amazon SageMaker ``Endpoint`` according to the endpoint configuration in the request.
2866+
"""Create an Amazon SageMaker ``Endpoint`` according to the configuration in the request.
28652867
28662868
Once the ``Endpoint`` is created, client applications can send requests to obtain
28672869
inferences. The endpoint configuration is created using the ``CreateEndpointConfig`` API.
@@ -2888,9 +2890,9 @@ def create_endpoint(self, endpoint_name, config_name, tags=None, wait=True):
28882890
return endpoint_name
28892891

28902892
def update_endpoint(self, endpoint_name, endpoint_config_name, wait=True):
2891-
"""Update an Amazon SageMaker ``Endpoint`` according to the endpoint configuration in the request.
2893+
"""Update an Amazon SageMaker ``Endpoint`` , Raise an error endpoint_name does not exist.
28922894
2893-
Raise an error if endpoint with endpoint_name does not exist.
2895+
Update happens according to the endpoint configuration in the request.
28942896
28952897
Args:
28962898
endpoint_name (str): Name of the Amazon SageMaker ``Endpoint`` to update.
@@ -3436,7 +3438,7 @@ def get_caller_identity_arn(self):
34363438
def logs_for_job( # noqa: C901 - suppress complexity warning for this method
34373439
self, job_name, wait=False, poll=10, log_type="All"
34383440
):
3439-
"""Display the logs for a given training job, optionally tailing them until the job is complete.
3441+
"""Display the for a given training job, optionally tailing them until job is complete.
34403442
34413443
If the output is a tty or a Jupyter cell, it will be color-coded
34423444
based on which instance the log entry is from.
@@ -3555,7 +3557,7 @@ def logs_for_job( # noqa: C901 - suppress complexity warning for this method
35553557
print("Managed Spot Training savings: {:.1f}%".format(saving))
35563558

35573559
def logs_for_processing_job(self, job_name, wait=False, poll=10):
3558-
"""Display the logs for a given processing job, optionally tailing them until the job is complete.
3560+
"""Display logs for a given processing job, optionally tailing them until the is complete.
35593561
35603562
Args:
35613563
job_name (str): Name of the processing job to display the logs for.
@@ -3633,7 +3635,7 @@ def logs_for_processing_job(self, job_name, wait=False, poll=10):
36333635
print()
36343636

36353637
def logs_for_transform_job(self, job_name, wait=False, poll=10):
3636-
"""Display the logs for a given transform job, optionally tailing them until the job is complete.
3638+
"""Display logs for a given transform job, optionally tailing them until job is complete.
36373639
36383640
If the output is a tty or a Jupyter cell, it will be color-coded
36393641
based on which instance the log entry is from.

src/sagemaker/sklearn/estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def _prepare_init_params_from_job_description(cls, job_details, model_channel_na
260260

261261

262262
def _validate_not_gpu_instance_type(training_instance_type):
263-
263+
"""Placeholder docstring."""
264264
gpu_instance_types = [
265265
"ml.p2.xlarge",
266266
"ml.p2.8xlarge",

src/sagemaker/tuner.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,13 +1247,14 @@ def create(
12471247
):
12481248
"""Factory method to create a ``HyperparameterTuner`` instance.
12491249
1250-
It takes one or more estimators to obtain configuration information for training jobs that are
1251-
created as the result of a hyperparameter tuning job. The estimators are provided through a dictionary
1252-
(i.e. ``estimator_dict``) with unique estimator names as the keys. For individual
1253-
estimators separate objective metric names and hyperparameter ranges should be provided in
1254-
two dictionaries, i.e. ``objective_metric_name_dict`` and ``hyperparameter_ranges_dict``,
1255-
with the same estimator names as the keys. Optional metrics definitions could also be
1256-
provided for individual estimators via another dictionary ``metric_definitions_dict``.
1250+
It takes one or more estimators to obtain configuration information for training jobs
1251+
that are created as the result of a hyperparameter tuning job. The estimators are provided
1252+
through a dictionary (i.e. ``estimator_dict``) with unique estimator names as the keys.
1253+
For individual estimators separate objective metric names and hyperparameter ranges
1254+
should be provided in two dictionaries, i.e. ``objective_metric_name_dict`` and
1255+
``hyperparameter_ranges_dict``, with the same estimator names as the keys. Optional
1256+
metrics definitions could also be provided for individual estimators via another dictionary
1257+
``metric_definitions_dict``.
12571258
12581259
Args:
12591260
estimator_dict (dict[str, sagemaker.estimator.EstimatorBase]): Dictionary of estimator

src/sagemaker/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@ def create_tar_file(source_files, target=None):
340340

341341
@contextlib.contextmanager
342342
def _tmpdir(suffix="", prefix="tmp"):
343-
"""Create a temporary directory with a context manager. The file is deleted when the context exits.
343+
"""Create a temporary directory with a context manager.
344344
345+
The file is deleted when the context exits.
345346
The prefix, suffix, and dir arguments are the same as for mkstemp().
346347
347348
Args:

0 commit comments

Comments
 (0)