Skip to content

Commit 526cb62

Browse files
authored
change: formatting changes from updates to black (#1855)
1 parent abf67ac commit 526cb62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+271
-115
lines changed

src/sagemaker/amazon/amazon_estimator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def __init__(
9494
def training_image_uri(self):
9595
"""Placeholder docstring"""
9696
return image_uris.retrieve(
97-
self.repo_name, self.sagemaker_session.boto_region_name, version=self.repo_version,
97+
self.repo_name,
98+
self.sagemaker_session.boto_region_name,
99+
version=self.repo_version,
98100
)
99101

100102
def hyperparameters(self):

src/sagemaker/amazon/kmeans.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class KMeans(AmazonAlgorithmEstimatorBase):
2929
3030
As the result of KMeans, members of a group are as similar as possible to one another and as
3131
different as possible from members of other groups. You define the attributes that you want
32-
the algorithm to use to determine similarity. """
32+
the algorithm to use to determine similarity."""
3333

3434
repo_name = "kmeans"
3535
repo_version = 1
@@ -257,7 +257,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
257257
"""
258258
sagemaker_session = sagemaker_session or Session()
259259
image_uri = image_uris.retrieve(
260-
KMeans.repo_name, sagemaker_session.boto_region_name, version=KMeans.repo_version,
260+
KMeans.repo_name,
261+
sagemaker_session.boto_region_name,
262+
version=KMeans.repo_version,
261263
)
262264
super(KMeansModel, self).__init__(
263265
image_uri,

src/sagemaker/amazon/knn.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
246246
"""
247247
sagemaker_session = sagemaker_session or Session()
248248
image_uri = image_uris.retrieve(
249-
KNN.repo_name, sagemaker_session.boto_region_name, version=KNN.repo_version,
249+
KNN.repo_name,
250+
sagemaker_session.boto_region_name,
251+
version=KNN.repo_version,
250252
)
251253
super(KNNModel, self).__init__(
252254
image_uri,

src/sagemaker/amazon/lda.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
class LDA(AmazonAlgorithmEstimatorBase):
2828
"""An unsupervised learning algorithm attempting to describe data as distinct categories.
2929
30-
LDA is most commonly used to discover a
31-
user-specified number of topics shared by documents within a text corpus. Here each
32-
observation is a document, the features are the presence (or occurrence count) of each
33-
word, and the categories are the topics."""
30+
LDA is most commonly used to discover a
31+
user-specified number of topics shared by documents within a text corpus. Here each
32+
observation is a document, the features are the presence (or occurrence count) of each
33+
word, and the categories are the topics."""
3434

3535
repo_name = "lda"
3636
repo_version = 1
@@ -230,7 +230,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
230230
"""
231231
sagemaker_session = sagemaker_session or Session()
232232
image_uri = image_uris.retrieve(
233-
LDA.repo_name, sagemaker_session.boto_region_name, version=LDA.repo_version,
233+
LDA.repo_name,
234+
sagemaker_session.boto_region_name,
235+
version=LDA.repo_version,
234236
)
235237
super(LDAModel, self).__init__(
236238
image_uri,

src/sagemaker/amazon/ntm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
259259
"""
260260
sagemaker_session = sagemaker_session or Session()
261261
image_uri = image_uris.retrieve(
262-
NTM.repo_name, sagemaker_session.boto_region_name, version=NTM.repo_version,
262+
NTM.repo_name,
263+
sagemaker_session.boto_region_name,
264+
version=NTM.repo_version,
263265
)
264266
super(NTMModel, self).__init__(
265267
image_uri,

src/sagemaker/amazon/pca.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ def __init__(self, model_data, role, sagemaker_session=None, **kwargs):
240240
"""
241241
sagemaker_session = sagemaker_session or Session()
242242
image_uri = image_uris.retrieve(
243-
PCA.repo_name, sagemaker_session.boto_region_name, version=PCA.repo_version,
243+
PCA.repo_name,
244+
sagemaker_session.boto_region_name,
245+
version=PCA.repo_version,
244246
)
245247
super(PCAModel, self).__init__(
246248
image_uri,

src/sagemaker/analytics.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,7 @@ def _metric_names_for_training_job(self):
416416

417417

418418
class ExperimentAnalytics(AnalyticsMetricsBase):
419-
"""Fetch trial component data and make them accessible for analytics.
420-
"""
419+
"""Fetch trial component data and make them accessible for analytics."""
421420

422421
MAX_TRIAL_COMPONENTS = 10000
423422

@@ -477,16 +476,14 @@ def __init__(
477476

478477
@property
479478
def name(self):
480-
"""Name of the Experiment being analyzed
481-
"""
479+
"""Name of the Experiment being analyzed"""
482480
return self._experiment_name
483481

484482
def __repr__(self):
485483
return "<sagemaker.ExperimentAnalytics for %s>" % self.name
486484

487485
def clear_cache(self):
488-
"""Clear the object of all local caches of API methods.
489-
"""
486+
"""Clear the object of all local caches of API methods."""
490487
super(ExperimentAnalytics, self).clear_cache()
491488
self._trial_components = None
492489

@@ -570,13 +567,13 @@ def _reshape(self, trial_component):
570567

571568
def _fetch_dataframe(self):
572569
"""Return a pandas dataframe with all the trial_components,
573-
along with their parameters and metrics.
570+
along with their parameters and metrics.
574571
"""
575572
df = pd.DataFrame([self._reshape(component) for component in self._get_trial_components()])
576573
return df
577574

578575
def _get_trial_components(self, force_refresh=False):
579-
""" Get all trial components matching the given search query expression.
576+
"""Get all trial components matching the given search query expression.
580577
581578
Args:
582579
force_refresh (bool): Set to True to fetch the latest data from SageMaker API.

src/sagemaker/automl/automl.py

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

2727

2828
class AutoML(object):
29-
"""A class for creating and interacting with SageMaker AutoML jobs
30-
"""
29+
"""A class for creating and interacting with SageMaker AutoML jobs"""
3130

3231
def __init__(
3332
self,

src/sagemaker/cli/framework_upgrade.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ def add_region(existing_content, region, account):
158158

159159

160160
def add_version(
161-
existing_content, short_version, full_version, scope, processors, py_versions, tag_prefix,
161+
existing_content,
162+
short_version,
163+
full_version,
164+
scope,
165+
processors,
166+
py_versions,
167+
tag_prefix,
162168
):
163169
"""Read framework image uri information from json file to a dictionary, update it with new
164170
framework version information, then write the dictionary back to json file.
@@ -172,7 +178,7 @@ def add_version(
172178
processors (str): Supported processors (e.g. "cpu,gpu").
173179
py_versions (str): Supported Python versions (e.g. "py3,py37").
174180
tag_prefix (str): Algorithm image's tag prefix.
175-
"""
181+
"""
176182
if py_versions:
177183
py_versions = py_versions.split(",")
178184
processors = processors.split(",")

src/sagemaker/local/local_session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,7 @@ class file_input(object):
448448
"""Amazon SageMaker channel configuration for FILE data sources, used in local mode."""
449449

450450
def __init__(self, fileUri, content_type=None):
451-
"""Create a definition for input data used by an SageMaker training job in local mode.
452-
"""
451+
"""Create a definition for input data used by an SageMaker training job in local mode."""
453452
self.config = {
454453
"DataSource": {
455454
"FileDataSource": {

0 commit comments

Comments
 (0)