Skip to content

Commit bb38ebe

Browse files
committed
Skip currently failed linting issues
1 parent 5d9d45b commit bb38ebe

File tree

46 files changed

+220
-242
lines changed

Some content is hidden

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

46 files changed

+220
-242
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ build --experimental_cc_shared_library
9090
# uses TensorFlow for all IO operations.
9191
build --define=use_tensorflow_io=1
9292

93-
# TensorFlow Decision Forests need absl::anyInvocable support for new versions
93+
# TensorFlow Decision Forests need absl::anyInvocable support for new versions
9494
# of Tensorflow.
9595
build --define use_absl_anyinvocable=1
9696

WORKSPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,3 @@ load(
130130
)
131131

132132
nccl_configure(name = "local_config_nccl")
133-

ruff.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ ignore = [
7878
"PT027", # Use `pytest.raises` instead of unittest-style `assertRaisesRegex`
7979
"UP028", # Replace `yield` over `for` loop with `yield from`
8080
"UP029", # Unnecessary builtin import
81+
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
8182
]
8283

8384
[lint.pyupgrade]
@@ -86,4 +87,4 @@ ignore = [
8687
keep-runtime-typing = true
8788

8889
[lint.pydocstyle]
89-
convention = "google"
90+
convention = "google"

tensorflow_serving/apis/model_service_pb2.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,25 @@
1818
# python -m grpc.tools.protoc --python_out=. --grpc_python_out=. -I. tensorflow_serving/apis/model_service.proto
1919

2020
import sys
21+
2122
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
2223
from google.protobuf import descriptor as _descriptor
24+
from google.protobuf import descriptor_pb2
2325
from google.protobuf import message as _message
2426
from google.protobuf import reflection as _reflection
2527
from google.protobuf import symbol_database as _symbol_database
26-
from google.protobuf import descriptor_pb2
28+
2729
# @@protoc_insertion_point(imports)
2830

2931
_sym_db = _symbol_database.Default()
3032

3133

32-
from tensorflow_serving.apis import get_model_status_pb2 as tensorflow__serving_dot_apis_dot_get__model__status__pb2
33-
from tensorflow_serving.apis import model_management_pb2 as tensorflow__serving_dot_apis_dot_model__management__pb2
34+
from tensorflow_serving.apis import (
35+
get_model_status_pb2 as tensorflow__serving_dot_apis_dot_get__model__status__pb2,
36+
)
37+
from tensorflow_serving.apis import (
38+
model_management_pb2 as tensorflow__serving_dot_apis_dot_model__management__pb2,
39+
)
3440

3541
DESCRIPTOR = _descriptor.FileDescriptor(
3642
name='tensorflow_serving/apis/model_service.proto',

tensorflow_serving/apis/model_service_pb2_grpc.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@
1919

2020
import grpc
2121

22-
from tensorflow_serving.apis import get_model_status_pb2 as tensorflow__serving_dot_apis_dot_get__model__status__pb2
23-
from tensorflow_serving.apis import model_management_pb2 as tensorflow__serving_dot_apis_dot_model__management__pb2
22+
from tensorflow_serving.apis import (
23+
get_model_status_pb2 as tensorflow__serving_dot_apis_dot_get__model__status__pb2,
24+
)
25+
from tensorflow_serving.apis import (
26+
model_management_pb2 as tensorflow__serving_dot_apis_dot_model__management__pb2,
27+
)
2428

2529

26-
class ModelServiceStub(object):
30+
class ModelServiceStub:
2731
"""ModelService provides methods to query and update the state of the server,
2832
e.g. which models/versions are being served.
29-
"""
33+
""" # noqa: D205
3034

3135
def __init__(self, channel):
3236
"""Constructor.
@@ -50,26 +54,26 @@ def __init__(self, channel):
5054
)
5155

5256

53-
class ModelServiceServicer(object):
57+
class ModelServiceServicer:
5458
"""ModelService provides methods to query and update the state of the server,
5559
e.g. which models/versions are being served.
56-
"""
60+
""" # noqa: D205
5761

58-
def GetModelStatus(self, request, context):
62+
def GetModelStatus(self, request, context): # noqa: ARG002
5963
"""Gets status of model. If the ModelSpec in the request does not specify
6064
version, information about all versions of the model will be returned. If
6165
the ModelSpec in the request does specify a version, the status of only
6266
that version will be returned.
63-
"""
67+
""" # noqa: D205
6468
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
6569
context.set_details('Method not implemented!')
6670
raise NotImplementedError('Method not implemented!')
6771

68-
def HandleReloadConfigRequest(self, request, context):
72+
def HandleReloadConfigRequest(self, request, context): # noqa: ARG002
6973
"""Reloads the set of served models. The new config supersedes the old one,
7074
so if a model is omitted from the new config it will be unloaded and no
7175
longer served.
72-
"""
76+
""" # noqa: D205
7377
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
7478
context.set_details('Method not implemented!')
7579
raise NotImplementedError('Method not implemented!')

tensorflow_serving/apis/prediction_service_pb2.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,34 @@
2222
# source: tensorflow_serving/apis/prediction_service.proto
2323

2424
import sys
25+
2526
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
2627
from google.protobuf import descriptor as _descriptor
28+
from google.protobuf import descriptor_pb2
2729
from google.protobuf import message as _message
2830
from google.protobuf import reflection as _reflection
2931
from google.protobuf import symbol_database as _symbol_database
30-
from google.protobuf import descriptor_pb2
32+
3133
# @@protoc_insertion_point(imports)
3234

3335
_sym_db = _symbol_database.Default()
3436

3537

36-
from tensorflow_serving.apis import classification_pb2 as tensorflow__serving_dot_apis_dot_classification__pb2
37-
from tensorflow_serving.apis import get_model_metadata_pb2 as tensorflow__serving_dot_apis_dot_get__model__metadata__pb2
38-
from tensorflow_serving.apis import inference_pb2 as tensorflow__serving_dot_apis_dot_inference__pb2
39-
from tensorflow_serving.apis import predict_pb2 as tensorflow__serving_dot_apis_dot_predict__pb2
40-
from tensorflow_serving.apis import regression_pb2 as tensorflow__serving_dot_apis_dot_regression__pb2
41-
38+
from tensorflow_serving.apis import (
39+
classification_pb2 as tensorflow__serving_dot_apis_dot_classification__pb2,
40+
)
41+
from tensorflow_serving.apis import (
42+
get_model_metadata_pb2 as tensorflow__serving_dot_apis_dot_get__model__metadata__pb2,
43+
)
44+
from tensorflow_serving.apis import (
45+
inference_pb2 as tensorflow__serving_dot_apis_dot_inference__pb2,
46+
)
47+
from tensorflow_serving.apis import (
48+
predict_pb2 as tensorflow__serving_dot_apis_dot_predict__pb2,
49+
)
50+
from tensorflow_serving.apis import (
51+
regression_pb2 as tensorflow__serving_dot_apis_dot_regression__pb2,
52+
)
4253

4354
DESCRIPTOR = _descriptor.FileDescriptor(
4455
name='tensorflow_serving/apis/prediction_service.proto',

tensorflow_serving/apis/prediction_service_pb2_grpc.py

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,28 @@
1818
# python -m grpc.tools.protoc --python_out=. --grpc_python_out=. -I. tensorflow_serving/apis/prediction_service.proto
1919
import grpc
2020

21-
from tensorflow_serving.apis import classification_pb2 as tensorflow__serving_dot_apis_dot_classification__pb2
22-
from tensorflow_serving.apis import get_model_metadata_pb2 as tensorflow__serving_dot_apis_dot_get__model__metadata__pb2
23-
from tensorflow_serving.apis import inference_pb2 as tensorflow__serving_dot_apis_dot_inference__pb2
24-
from tensorflow_serving.apis import predict_pb2 as tensorflow__serving_dot_apis_dot_predict__pb2
25-
from tensorflow_serving.apis import regression_pb2 as tensorflow__serving_dot_apis_dot_regression__pb2
21+
from tensorflow_serving.apis import (
22+
classification_pb2 as tensorflow__serving_dot_apis_dot_classification__pb2,
23+
)
24+
from tensorflow_serving.apis import (
25+
get_model_metadata_pb2 as tensorflow__serving_dot_apis_dot_get__model__metadata__pb2,
26+
)
27+
from tensorflow_serving.apis import (
28+
inference_pb2 as tensorflow__serving_dot_apis_dot_inference__pb2,
29+
)
30+
from tensorflow_serving.apis import (
31+
predict_pb2 as tensorflow__serving_dot_apis_dot_predict__pb2,
32+
)
33+
from tensorflow_serving.apis import (
34+
regression_pb2 as tensorflow__serving_dot_apis_dot_regression__pb2,
35+
)
2636

2737

28-
class PredictionServiceStub(object):
38+
class PredictionServiceStub:
2939
"""open source marker; do not remove
3040
PredictionService provides access to machine-learned models loaded by
3141
model_servers.
32-
"""
42+
""" # noqa: D205
3343

3444
def __init__(self, channel):
3545
"""Constructor.
@@ -64,43 +74,43 @@ def __init__(self, channel):
6474
)
6575

6676

67-
class PredictionServiceServicer(object):
77+
class PredictionServiceServicer:
6878
"""open source marker; do not remove
6979
PredictionService provides access to machine-learned models loaded by
7080
model_servers.
71-
"""
81+
""" # noqa: D205
7282

73-
def Classify(self, request, context):
83+
def Classify(self, request, context): # noqa: ARG002
7484
"""Classify.
75-
"""
85+
""" # noqa: D200
7686
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
7787
context.set_details('Method not implemented!')
7888
raise NotImplementedError('Method not implemented!')
7989

80-
def Regress(self, request, context):
90+
def Regress(self, request, context): # noqa: ARG002
8191
"""Regress.
82-
"""
92+
""" # noqa: D200
8393
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
8494
context.set_details('Method not implemented!')
8595
raise NotImplementedError('Method not implemented!')
8696

87-
def Predict(self, request, context):
97+
def Predict(self, request, context): # noqa: ARG002
8898
"""Predict -- provides access to loaded TensorFlow model.
89-
"""
99+
""" # noqa: D200
90100
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
91101
context.set_details('Method not implemented!')
92102
raise NotImplementedError('Method not implemented!')
93103

94-
def MultiInference(self, request, context):
104+
def MultiInference(self, request, context): # noqa: ARG002
95105
"""MultiInference API for multi-headed models.
96-
"""
106+
""" # noqa: D200
97107
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
98108
context.set_details('Method not implemented!')
99109
raise NotImplementedError('Method not implemented!')
100110

101-
def GetModelMetadata(self, request, context):
111+
def GetModelMetadata(self, request, context): # noqa: ARG002
102112
"""GetModelMetadata - provides access to metadata for loaded models.
103-
"""
113+
""" # noqa: D200
104114
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
105115
context.set_details('Method not implemented!')
106116
raise NotImplementedError('Method not implemented!')

tensorflow_serving/batching/test_util/matrix_half_plus_two_saved_model.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# ==============================================================================
1515

1616
import tensorflow.compat.v1 as tf
17+
1718
FLAGS = tf.app.flags.FLAGS
1819

1920
tf.app.flags.DEFINE_string("output_dir", "/tmp/matrix_half_plus_two/1",
@@ -22,13 +23,14 @@
2223

2324
def _generate_saved_model_for_matrix_half_plus_two(export_dir):
2425
"""Creates SavedModel for half plus two model that accepts batches of
25-
3*3 matrices.
26-
The model divides all elements in each matrix by 2 and adds 2 to them.
27-
So, for one input matrix [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
28-
the result will be [[2.5, 3, 3.5], [4, 4.5, 5], [5.5, 6, 6.5]].
29-
Args:
30-
export_dir: The directory where to write SavedModel files.
31-
"""
26+
3*3 matrices.
27+
The model divides all elements in each matrix by 2 and adds 2 to them.
28+
So, for one input matrix [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
29+
the result will be [[2.5, 3, 3.5], [4, 4.5, 5], [5.5, 6, 6.5]].
30+
31+
Args:
32+
export_dir: The directory where to write SavedModel files.
33+
""" # noqa: D205
3234
builder = tf.saved_model.builder.SavedModelBuilder(export_dir)
3335
with tf.Session() as session:
3436
x = tf.placeholder(tf.float32, shape=[None, 3, 3], name="x")

tensorflow_serving/example/mnist_client.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,17 @@
2525
mnist_client.py --num_tests=100 --server=localhost:9000
2626
"""
2727

28-
from __future__ import print_function
2928

3029
import sys
3130
import threading
3231

3332
# This is a placeholder for a Google-internal import.
34-
3533
import grpc
34+
import mnist_input_data
3635
import numpy
3736
import tensorflow as tf
3837

39-
from tensorflow_serving.apis import predict_pb2
40-
from tensorflow_serving.apis import prediction_service_pb2_grpc
41-
import mnist_input_data
42-
38+
from tensorflow_serving.apis import predict_pb2, prediction_service_pb2_grpc
4339

4440
tf.compat.v1.app.flags.DEFINE_integer(
4541
'concurrency', 1, 'maximum number of concurrent inference requests')
@@ -50,7 +46,7 @@
5046
FLAGS = tf.compat.v1.app.flags.FLAGS
5147

5248

53-
class _ResultCounter(object):
49+
class _ResultCounter:
5450
"""Counter for the prediction results."""
5551

5652
def __init__(self, num_tests, concurrency):
@@ -94,6 +90,7 @@ def _create_rpc_callback(label, result_counter):
9490
Args:
9591
label: The correct label for the predicted example.
9692
result_counter: Counter for the prediction result.
93+
9794
Returns:
9895
The callback function.
9996
"""

0 commit comments

Comments
 (0)