Skip to content
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

Fix build failing with float precision mismatch #3002

Merged
merged 4 commits into from
Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from 2 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
20 changes: 10 additions & 10 deletions speech/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,10 @@ def test_sync_recognize_with_gax(self):

alternatives = [{
'transcript': 'testing 1 2 3',
'confidence': 0.9224355,
'confidence': 0.125,
}, {
'transcript': 'testing 4 5 6',
'confidence': 0.0123456,
'confidence': 0.125,

This comment was marked as spam.

}]
result = _make_result(alternatives)

Expand Down Expand Up @@ -500,16 +500,16 @@ def test_stream_recognize_interim_results(self):

alternatives = [{
'transcript': 'testing streaming 1 2 3',
'confidence': 0.9224355,
'confidence': 0.125,
}, {
'transcript': 'testing streaming 4 5 6',
'confidence': 0.0123456,
'confidence': 0.125,

This comment was marked as spam.

}]
first_response = _make_streaming_response(
_make_streaming_result([], is_final=False, stability=0.122435))
_make_streaming_result([], is_final=False, stability=0.125))
second_response = _make_streaming_response(
_make_streaming_result(alternatives, is_final=False,
stability=0.1432343))
stability=0.125))
last_response = _make_streaming_response(
_make_streaming_result(alternatives, is_final=True,
stability=0.9834534))
Expand Down Expand Up @@ -542,8 +542,8 @@ def speech_api(channel=None):
self.assertIsInstance(results[0], StreamingSpeechResult)
self.assertEqual(results[0].alternatives, [])
self.assertFalse(results[0].is_final)
self.assertEqual(results[0].stability, 0.122435)
self.assertEqual(results[1].stability, 0.1432343)
self.assertEqual(results[0].stability, 0.125)
self.assertEqual(results[1].stability, 0.125)
self.assertFalse(results[1].is_final)
self.assertEqual(results[1].transcript,
results[1].alternatives[0].transcript,
Expand Down Expand Up @@ -580,10 +580,10 @@ def test_stream_recognize(self):

alternatives = [{
'transcript': 'testing streaming 1 2 3',
'confidence': 0.9224355,
'confidence': 0.125,
}, {
'transcript': 'testing streaming 4 5 6',
'confidence': 0.0123456,
'confidence': 0.125,
}]

first_response = _make_streaming_response(
Expand Down
6 changes: 3 additions & 3 deletions vision/unit_tests/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _make_pb_entity():
description = 'testing 1 2 3'
locale = 'US'
mid = 'm/w/45342234'
score = 0.235434231
score = 0.125

entity_annotation = image_annotator_pb2.EntityAnnotation(
mid=mid,
Expand Down Expand Up @@ -108,7 +108,7 @@ def test_it(self):
description = 'testing 1 2 3'
locale = 'US'
mid = 'm/w/45342234'
score = 0.235434231
score = 0.125
entity_annotation = _make_pb_entity()
entities = self._call_fut([entity_annotation])
self.assertEqual(len(entities), 1)
Expand Down Expand Up @@ -183,7 +183,7 @@ def test_it(self):
description = 'testing 1 2 3'
locale = 'US'
mid = 'm/w/45342234'
score = 0.235434231
score = 0.125
entity_annotation = _make_pb_entity()

image_response = image_annotator_pb2.AnnotateImageResponse(
Expand Down
2 changes: 1 addition & 1 deletion vision/unit_tests/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_logo_pb_annotation(self):
description = 'testing 1 2 3'
locale = 'US'
mid = 'm/w/45342234'
score = 0.235434231
score = 0.125
entity_annotation = image_annotator_pb2.EntityAnnotation()
entity_annotation.mid = mid
entity_annotation.locale = locale
Expand Down