增加环绕侦察场景适配
This commit is contained in:
@@ -6,12 +6,7 @@ from functools import reduce
|
||||
import numpy as np
|
||||
import numpy.polynomial.chebyshev as cheb
|
||||
from numpy.polynomial.polynomial import polyval
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
)
|
||||
from numpy.testing import assert_, assert_almost_equal, assert_equal, assert_raises
|
||||
|
||||
|
||||
def trim(x):
|
||||
|
||||
@@ -18,12 +18,7 @@ from numpy.polynomial import (
|
||||
Legendre,
|
||||
Polynomial,
|
||||
)
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
)
|
||||
from numpy.testing import assert_, assert_almost_equal, assert_equal, assert_raises
|
||||
|
||||
#
|
||||
# fixtures
|
||||
|
||||
@@ -6,12 +6,7 @@ from functools import reduce
|
||||
import numpy as np
|
||||
import numpy.polynomial.hermite as herm
|
||||
from numpy.polynomial.polynomial import polyval
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
)
|
||||
from numpy.testing import assert_, assert_almost_equal, assert_equal, assert_raises
|
||||
|
||||
H0 = np.array([1])
|
||||
H1 = np.array([0, 2])
|
||||
|
||||
@@ -6,12 +6,7 @@ from functools import reduce
|
||||
import numpy as np
|
||||
import numpy.polynomial.hermite_e as herme
|
||||
from numpy.polynomial.polynomial import polyval
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
)
|
||||
from numpy.testing import assert_, assert_almost_equal, assert_equal, assert_raises
|
||||
|
||||
He0 = np.array([1])
|
||||
He1 = np.array([0, 1])
|
||||
|
||||
@@ -6,12 +6,7 @@ from functools import reduce
|
||||
import numpy as np
|
||||
import numpy.polynomial.laguerre as lag
|
||||
from numpy.polynomial.polynomial import polyval
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
)
|
||||
from numpy.testing import assert_, assert_almost_equal, assert_equal, assert_raises
|
||||
|
||||
L0 = np.array([1]) / 1
|
||||
L1 = np.array([1, -1]) / 1
|
||||
|
||||
@@ -6,12 +6,7 @@ from functools import reduce
|
||||
import numpy as np
|
||||
import numpy.polynomial.legendre as leg
|
||||
from numpy.polynomial.polynomial import polyval
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
)
|
||||
from numpy.testing import assert_, assert_almost_equal, assert_equal, assert_raises
|
||||
|
||||
L0 = np.array([1])
|
||||
L1 = np.array([0, 1])
|
||||
|
||||
@@ -6,9 +6,10 @@ from copy import deepcopy
|
||||
from fractions import Fraction
|
||||
from functools import reduce
|
||||
|
||||
import pytest
|
||||
|
||||
import numpy as np
|
||||
import numpy.polynomial.polynomial as poly
|
||||
import numpy.polynomial.polyutils as pu
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
@@ -16,7 +17,6 @@ from numpy.testing import (
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
assert_raises_regex,
|
||||
assert_warns,
|
||||
)
|
||||
|
||||
|
||||
@@ -656,7 +656,7 @@ class TestMisc:
|
||||
assert_equal(p.coef, [2.])
|
||||
p = poly.Polynomial.fit([1, 1], [2, 2.1], deg=0)
|
||||
assert_almost_equal(p.coef, [2.05])
|
||||
with assert_warns(pu.RankWarning):
|
||||
with pytest.warns(np.exceptions.RankWarning):
|
||||
p = poly.Polynomial.fit([1, 1], [2, 2.1], deg=1)
|
||||
|
||||
def test_result_type(self):
|
||||
@@ -667,3 +667,25 @@ class TestMisc:
|
||||
|
||||
arr = np.polydiv(1, np.float32(1))
|
||||
assert_equal(arr[0].dtype, np.float64)
|
||||
|
||||
class ArrayFunctionInterceptor:
|
||||
def __init__(self):
|
||||
self.called = False
|
||||
|
||||
def __array_function__(self, func, types, args, kwargs):
|
||||
self.called = True
|
||||
return "intercepted"
|
||||
|
||||
def test_polyval2d_array_function_hook():
|
||||
x = ArrayFunctionInterceptor()
|
||||
y = ArrayFunctionInterceptor()
|
||||
c = ArrayFunctionInterceptor()
|
||||
result = np.polynomial.polynomial.polyval2d(x, y, c)
|
||||
assert result == "intercepted"
|
||||
|
||||
def test_polygrid2d_array_function_hook():
|
||||
x = ArrayFunctionInterceptor()
|
||||
y = ArrayFunctionInterceptor()
|
||||
c = ArrayFunctionInterceptor()
|
||||
result = np.polynomial.polynomial.polygrid2d(x, y, c)
|
||||
assert result == "intercepted"
|
||||
|
||||
@@ -3,12 +3,7 @@
|
||||
"""
|
||||
import numpy as np
|
||||
import numpy.polynomial.polyutils as pu
|
||||
from numpy.testing import (
|
||||
assert_,
|
||||
assert_almost_equal,
|
||||
assert_equal,
|
||||
assert_raises,
|
||||
)
|
||||
from numpy.testing import assert_, assert_almost_equal, assert_equal, assert_raises
|
||||
|
||||
|
||||
class TestMisc:
|
||||
|
||||
@@ -246,6 +246,7 @@ class TestLinebreaking:
|
||||
assert_(len(line) < lw)
|
||||
|
||||
|
||||
@pytest.mark.thread_unsafe(reason="set_default_printstyle() is global state")
|
||||
def test_set_default_printoptions():
|
||||
p = poly.Polynomial([1, 2, 3])
|
||||
c = poly.Chebyshev([1, 2, 3])
|
||||
@@ -259,6 +260,7 @@ def test_set_default_printoptions():
|
||||
poly.set_default_printstyle('invalid_input')
|
||||
|
||||
|
||||
@pytest.mark.thread_unsafe(reason="set_default_printstyle() is global state")
|
||||
def test_complex_coefficients():
|
||||
"""Test both numpy and built-in complex."""
|
||||
coefs = [0 + 1j, 1 + 1j, -2 + 2j, 3 + 0j]
|
||||
|
||||
Reference in New Issue
Block a user