Demand axisRanges is given when extrapolate is True
This commit is contained in:
parent
e02e9dc295
commit
b073fb8f6f
@ -150,7 +150,7 @@ def supportScalar(location, support, ot=True, extrapolate=False, axisRanges=None
|
||||
-0.5
|
||||
"""
|
||||
if extrapolate and axisRanges is None:
|
||||
axisRanges = {}
|
||||
raise TypeError("axisRanges must be passed when extrapolate is True")
|
||||
scalar = 1.0
|
||||
for axis, (lower, peak, upper) in support.items():
|
||||
if ot:
|
||||
|
@ -42,6 +42,8 @@ def test_supportScalar():
|
||||
assert supportScalar({"wght": 3}, {"wght": (0, 1, 2)}, extrapolate=True, axisRanges={"wght": (0, 2)}) == -1.0
|
||||
assert supportScalar({"wght": -1}, {"wght": (0, 1, 2)}, extrapolate=True, axisRanges={"wght": (0, 2)}) == -1.0
|
||||
assert supportScalar({"wght": 2}, {"wght": (0, 0.75, 1)}, extrapolate=True, axisRanges={"wght": (0, 1)}) == -4.0
|
||||
with pytest.raises(TypeError):
|
||||
supportScalar({"wght": 2}, {"wght": (0, 0.75, 1)}, extrapolate=True, axisRanges=None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
Loading…
x
Reference in New Issue
Block a user