[instancer.solver] Test more
This commit is contained in:
parent
17ac8d9f28
commit
6210e7d331
@ -61,7 +61,8 @@ def _solveWithGain(tent, axisLimit):
|
|||||||
# we clamp +2.0 to the max F2Dot14 (~1.99994) for convenience
|
# we clamp +2.0 to the max F2Dot14 (~1.99994) for convenience
|
||||||
upper = axisDef + (axisMax - axisDef) * MAX_F2DOT14
|
upper = axisDef + (axisMax - axisDef) * MAX_F2DOT14
|
||||||
|
|
||||||
out.append((1 - gain, (axisDef, peak, upper)))
|
if upper > axisDef:
|
||||||
|
out.append((0 - gain, (axisDef, peak, upper)))
|
||||||
|
|
||||||
# case 4: new limit doesn't fit; we need to chop the deltaset into two 'tents',
|
# case 4: new limit doesn't fit; we need to chop the deltaset into two 'tents',
|
||||||
# because the shape of a triangle with part of one side cut off cannot be
|
# because the shape of a triangle with part of one side cut off cannot be
|
||||||
@ -70,7 +71,7 @@ def _solveWithGain(tent, axisLimit):
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
loc1 = (axisDef, peak, axisMax)
|
loc1 = (axisDef, peak, axisMax)
|
||||||
scalar1 = 1
|
scalar1 = 0
|
||||||
|
|
||||||
loc2 = (peak, axisMax, axisMax)
|
loc2 = (peak, axisMax, axisMax)
|
||||||
scalar2 = supportScalar({'tag': axisMax}, {'tag': tent})
|
scalar2 = supportScalar({'tag': axisMax}, {'tag': tent})
|
||||||
|
@ -84,12 +84,22 @@ class RebaseTentTest(object):
|
|||||||
# With gain:
|
# With gain:
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Case 1neg
|
||||||
|
pytest.param(
|
||||||
|
(.0, .5, 1), (0, .5, 1),
|
||||||
|
[
|
||||||
|
(1, (-1, 0, 1)),
|
||||||
|
(-1, (0, 0, 1)),
|
||||||
|
(-1, (-1, -1, 0)),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
|
||||||
# Case 1neg
|
# Case 1neg
|
||||||
pytest.param(
|
pytest.param(
|
||||||
(.0, .5, 1), (0, .25, .5),
|
(.0, .5, 1), (0, .25, .5),
|
||||||
[
|
[
|
||||||
(.5, (-1, 0, 1)),
|
(.5, (-1, 0, 1)),
|
||||||
(.5, (0, 1, 1)),
|
(-.5, (0, 1, 1)),
|
||||||
(-.5, (-1, -1, 0)),
|
(-.5, (-1, -1, 0)),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
@ -98,8 +108,8 @@ class RebaseTentTest(object):
|
|||||||
pytest.param(
|
pytest.param(
|
||||||
(.05, .55, 1), (0, .25, .5),
|
(.05, .55, 1), (0, .25, .5),
|
||||||
[
|
[
|
||||||
(.4, (-1, 0, 1)),
|
(.4, (-1.0, 0.0, 1.0)),
|
||||||
(.5, (0, 1, 1)),
|
(-.4, (0.0, 1.0, 1.0)),
|
||||||
(-.4, (-1, -.8, 0)),
|
(-.4, (-1, -.8, 0)),
|
||||||
(-.4, (-1, -1, -.8)),
|
(-.4, (-1, -1, -.8)),
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user