Skip to content

Commit

Permalink
Fix floating point rounding on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Apr 28, 2017
1 parent ee119a2 commit 35c190d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ script:

# submit coverage
after_script:
- if [[ $ENV == python=2.7 ]]; then
coveralls;
fi
- coveralls
22 changes: 11 additions & 11 deletions tests/test_modules/test_pmac/test_pmactrajectorypart.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from mock import Mock, call, patch, ANY

from scanpointgenerator import LineGenerator, CompoundGenerator
import pytest

from malcolm.core import call_with_params, Context, Process
from malcolm.modules.pmac.parts import PmacTrajectoryPart
Expand Down Expand Up @@ -102,9 +103,8 @@ def test_configure(self):
call('cs', 'CS1'),
] + self.resolutions_and_use_calls() + [
call('pointsToBuild', 5),
call('positionsA', [
0.44617968749999998, 0.28499999999999998, 0.077499999999999958,
-0.083679687500000072, -0.13750000000000007]),
call('positionsA', pytest.approx([
0.4461796875, 0.285, 0.0775, -0.0836796875, -0.1375])),
call('positionsB', [0.0, 0.0, 0.0, 0.0, 0.0]),
call('timeArray', [207500, 207500, 207500, 207500, 207500]),
call('userPrograms', [8, 8, 8, 8, 8]),
Expand All @@ -113,12 +113,12 @@ def test_configure(self):
call('executeProfile'),
] + self.resolutions_and_use_calls() + [
call('pointsToBuild', 16),
call('positionsA', [
call('positionsA', pytest.approx([
-0.125, 0.0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.6375,
0.625, 0.5, 0.375, 0.25, 0.125, 0.0, -0.125, -0.1375]),
call('positionsB', [
0.625, 0.5, 0.375, 0.25, 0.125, 0.0, -0.125, -0.1375])),
call('positionsB', pytest.approx([
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.05,
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]),
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1])),
call('timeArray', [
100000, 500000, 500000, 500000, 500000, 500000, 500000,
200000, 200000, 500000, 500000, 500000, 500000, 500000,
Expand All @@ -139,8 +139,8 @@ def test_2_axis_move_to_start(self):
call('cs', 'CS1'),
] + self.resolutions_and_use_calls() + [
call('pointsToBuild', 2),
call('positionsA', [-0.068750000000000019, -0.13750000000000001]),
call('positionsB', [0.10000000000000001, 0.0]),
call('positionsA', pytest.approx([-0.06875, -0.1375])),
call('positionsB', pytest.approx([0.1, 0.0])),
call('timeArray', [282843, 282842]),
call('userPrograms', [8, 8]),
call('velocityMode', [0, 2]),
Expand Down Expand Up @@ -202,8 +202,8 @@ def test_multi_run(self):
call('cs', 'CS1'),
] + self.resolutions_and_use_calls(useB=False) + [
call('pointsToBuild', 8),
call('positionsA', [
0.625, 0.5, 0.375, 0.25, 0.125, 0.0, -0.125, -0.1375]),
call('positionsA', pytest.approx([
0.625, 0.5, 0.375, 0.25, 0.125, 0.0, -0.125, -0.1375])),
call('timeArray', [
100000, 500000, 500000, 500000, 500000, 500000, 500000,
100000]),
Expand Down

0 comments on commit 35c190d

Please sign in to comment.