We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
tests/test_accel.py ...........F.. [ 25%] tests/test_frame.py .s. [ 30%] tests/test_linker.py ss [ 34%] tests/test_orbit.py .....s...F.....F.F..F [ 72%] tests/test_orbit_solver.py ...... [ 83%] tests/test_particles.py s [ 85%] tests/test_sampler.py ..... [ 94%] tests/test_utils.py ... [100%] ============================================== FAILURES =============================================== ______________________________________________ test_RK78 ______________________________________________ @timer def test_RK78(): # Test that analytic Keplerian propagation matches RK78 propagator when # acceleration is purely Keplerian np.random.seed(5772156) t0 = Time("1982-03-14", scale='utc') # times = t0 + np.linspace(0, 24, 1000)*u.h times = t0 + np.arange(1000)*70*u.s for _ in range(10): while True: # Pick a distance near GEO r = np.random.uniform(4e7, 5e7) # Pick a random direction (not uniform on sphere) theta = np.random.uniform(0, 2*np.pi) phi = np.random.uniform(0, np.pi) x = r * np.cos(theta) * np.sin(phi) y = r * np.sin(theta) * np.sin(phi) z = r * np.cos(phi) r = np.array([x, y, z]) # Pick a velocity near VGEO v = np.random.uniform(2.7e3, 3.3e3) # and a randomish direction theta = np.random.uniform(0, 2*np.pi) phi = np.random.uniform(0, np.pi) vx = v * np.cos(theta) * np.sin(phi) vy = v * np.sin(theta) * np.sin(phi) vz = v * np.cos(phi) v = np.array([vx, vy, vz]) orbit = ssapy.Orbit(r, v, t0) if norm(orbit.periapsis) > 1e7: break r1, v1 = ssapy.rv(orbit, times) r2, v2 = ssapy.rv( orbit, times, propagator=ssapy.RK78Propagator( ssapy.AccelKepler(), h=60.0, tol=(1e-6,)*3+(1e-9,)*3 ) ) > np.testing.assert_allclose(r1, r2, rtol=0, atol=1e-2) tests/test_accel.py:966: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (<function assert_allclose.<locals>.compare at 0x173daea60>, array([[ 1870289.48279425, 2811083.2705752 , 40623249.72...00.12911878, 46108402.25304425, -2325857.1730373 ], [ 5726276.56217508, 46101666.99857446, -2126942.010325 ]])) kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0, atol=0.01', 'verbose': True} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Not equal to tolerance rtol=0, atol=0.01 E E Mismatched elements: 3 / 3000 (0.1%) E Max absolute difference: 0.01011332 E Max relative difference: 4.71202718e-09 E x: array([[ 1870289.482794, 2811083.270575, 40623249.721042], E [ 1842038.995281, 2585895.461168, 40626138.312491], E [ 1813735.340139, 2360633.014728, 40627854.289834],... E y: array([[ 1870289.482794, 2811083.270575, 40623249.721042], E [ 1842038.995281, 2585895.461168, 40626138.312491], E [ 1813735.340139, 2360633.014729, 40627854.289834],... /opt/homebrew/Cellar/[email protected]/3.8.18/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py:75: AssertionError __________________________________________ test_groundTrack ___________________________________________ a = [Orbit(r=array([ -5645090.63554971, -26450217.65414144, -39779723.24259774]), v=array([ 1310.5600129 , -1984.05092597,...17925.07085068, -10007020.38624488]), v=array([ 1758.44040144, 1256.81795235, -1880.37705403]), t=630763148.816), ...] @array_function_dispatch(_shape_dispatcher) def shape(a): """ Return the shape of an array. Parameters ---------- a : array_like Input array. Returns ------- shape : tuple of ints The elements of the shape tuple give the lengths of the corresponding array dimensions. See Also -------- len : ``len(a)`` is equivalent to ``np.shape(a)[0]`` for N-D arrays with ``N>=1``. ndarray.shape : Equivalent array method. Examples -------- >>> np.shape(np.eye(3)) (3, 3) >>> np.shape([[1, 3]]) (1, 2) >>> np.shape([0]) (1,) >>> np.shape(0) () >>> a = np.array([(1, 2), (3, 4), (5, 6)], ... dtype=[('x', 'i4'), ('y', 'i4')]) >>> np.shape(a) (3,) >>> a.shape (3,) """ try: > result = a.shape E AttributeError: 'list' object has no attribute 'shape' ../.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/numpy/core/fromnumeric.py:2033: AttributeError During handling of the above exception, another exception occurred: @timer def test_groundTrack(): np.random.seed(5772156) NORBIT = 30 NTIME = 300 orbits = [] for _ in range(NORBIT): # Pick a distance near GEO r = np.random.uniform(4e7, 5e7) # Pick a random direction (not uniform on sphere) theta = np.random.uniform(0, 2*np.pi) phi = np.random.uniform(0, np.pi) x = r * np.cos(theta) * np.sin(phi) y = r * np.sin(theta) * np.sin(phi) z = r * np.cos(phi) r = np.array([x, y, z]) # Pick a velocity near VGEO v = np.random.uniform(2.7e3, 3.3e3) # and a randomish direction theta = np.random.uniform(0, 2*np.pi) phi = np.random.uniform(0, np.pi) vx = v * np.cos(theta) * np.sin(phi) vy = v * np.sin(theta) * np.sin(phi) vz = v * np.cos(phi) v = np.array([vx, vy, vz]) orbits.append(ssapy.Orbit(r, v, Time("J2000"))) for prop in [ ssapy.KeplerianPropagator(), ssapy.SeriesPropagator(0), ssapy.SeriesPropagator(1), ssapy.SeriesPropagator(2) ]: print("testing propagator: ", prop) times = Time("J2000") + np.linspace(-2, 2, NTIME)*u.year > lat, lon, h = ssapy.groundTrack(orbits, times, propagator=prop) tests/test_orbit.py:772: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ssapy/compute.py:309: in groundTrack nOrbit, squeezeOrbit, r = _countR(orbit) # (n, m, 3) ssapy/compute.py:115: in _countR if np.shape(r)[-1] == 3: <__array_function__ internals>:200: in shape ??? ../.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/numpy/core/fromnumeric.py:2035: in shape result = asarray(a).shape _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Orbit(r=array([ -5645090.63554971, -26450217.65414144, -39779723.24259774]), v=array([ 1310.5600129 , -1984.05092597, -2241.90971411]), t=630763148.816) def __next__(self): if self._iter < len(self): # propagate kozai directly if possible if 'kozaiMeanKeplerianElements' in self.__dict__: kMKE = self.__dict__['kozaiMeanKeplerianElements'] else: kMKE = None out = Orbit( self.r[self._iter], self.v[self._iter], > self.t[self._iter], propkw={k: v[self._iter] for k, v in self.propkw.items()} ) E IndexError: invalid index to scalar variable. ssapy/orbit.py:702: IndexError ---------------------------------------- Captured stdout call ----------------------------------------- testing propagator: KeplerianPropagator() _____________________________________________ test_kozai ______________________________________________ @timer def test_kozai(): np.random.seed(5772156649015 % 2**32) # Start with 100 ~GEO orbits # import tqdm # for _ in tqdm.tqdm(range(10_000)): for _ in range(100): # Random point near GEO sphere: a = np.random.uniform(-1e3, 1e3) + ssapy.constants.RGEO u = np.random.uniform(0, 2*np.pi) v = np.random.uniform(-1, 1) r = np.array([np.sqrt(1-v*v)*np.cos(u), np.sqrt(1-v*v)*np.sin(u), v]) # Orthogonal velocity of correct magnitude. # Generate another point on the unit sphere then subtract component along r u = np.random.uniform(0, 2*np.pi) v = np.random.uniform(-1, 1) n = np.array([np.sqrt(1-v*v)*np.cos(u), np.sqrt(1-v*v)*np.sin(u), v]) n -= np.dot(r, n) * r r *= a v = normed(n) * ssapy.constants.VGEO + np.random.uniform(-5, 5, size=3) orbit = ssapy.Orbit(r, v, 0.0, mu=ssapy.constants.WGS72_EARTH_MU) # Test round trip elements = orbit.kozaiMeanKeplerianElements newOrbit = ssapy.Orbit.fromKozaiMeanKeplerianElements(*elements, t=0.0) np.testing.assert_allclose(orbit.r, newOrbit.r, rtol=0, atol=1e-6) np.testing.assert_allclose(orbit.v, newOrbit.v, rtol=0, atol=1e-10) # How far off are we over 1/3 period ? r0, v0 = ssapy.rv(orbit, orbit.period/3) r1, v1 = ssapy.rv(newOrbit, orbit.period/3) > np.testing.assert_allclose(r0, r1, rtol=0, atol=1e-5) tests/test_orbit.py:1523: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (<function assert_allclose.<locals>.compare at 0x17273b310>, array([-19761191.61566088, 14046761.50802184, -34329345.07587284]), array([-19761184.2004245 , 14046760.28182712, -34329361.1148786 ])) kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0, atol=1e-05', 'verbose': True} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Not equal to tolerance rtol=0, atol=1e-05 E E Mismatched elements: 3 / 3 (100%) E Max absolute difference: 16.03900576 E Max relative difference: 4.67209562e-07 E x: array([-19761191.615661, 14046761.508022, -34329345.075873]) E y: array([-19761184.200424, 14046760.281827, -34329361.114879]) /opt/homebrew/Cellar/[email protected]/3.8.18/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py:75: AssertionError ______________________________________________ test_sgp4 ______________________________________________ @timer def test_sgp4(): import os from sgp4.api import Satrec for i in range(1,3): tle_file = os.path.join(os.path.dirname(__file__), "data", f"aeroTLE_{i}.txt") with open(tle_file, 'r') as fd: line1, line2 = fd.readlines() orbit = ssapy.Orbit.fromTLETuple((line1, line2)) r, v = ssapy.rv(orbit, orbit.t, propagator=ssapy.SGP4Propagator()) > np.testing.assert_allclose( orbit.r, r, rtol=0, atol=1e-6 ) tests/test_orbit.py:1656: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (<function assert_allclose.<locals>.compare at 0x33635b940>, array([-41379294.80632839, -285843.38933783, 8218521.28120114]), array([-41379292.79246487, -285843.37492187, 8218520.88022589])) kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=0, atol=1e-06', 'verbose': True} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Not equal to tolerance rtol=0, atol=1e-06 E E Mismatched elements: 3 / 3 (100%) E Max absolute difference: 2.01386352 E Max relative difference: 5.04330841e-08 E x: array([-41379294.806328, -285843.389338, 8218521.281201]) E y: array([-41379292.792465, -285843.374922, 8218520.880226]) /opt/homebrew/Cellar/[email protected]/3.8.18/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py:75: AssertionError _____________________________________________ test_musun ______________________________________________ def test_musun(): # Travis & Nate discovered mu wasn't always being propagated. Here's an previously # failing example. a = u.AU.to(u.m) > mu = ssapy.constants.GM_SUN E AttributeError: module 'ssapy.constants' has no attribute 'GM_SUN' tests/test_orbit.py:1889: AttributeError ========================================== warnings summary =========================================== ../.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/PyPDF2/__init__.py:21 /Users/rusu1/.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/PyPDF2/__init__.py:21: DeprecationWarning: PyPDF2 is deprecated. Please move to the pypdf library instead. warnings.warn( ../.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/traitlets/__init__.py:28 /Users/rusu1/.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/traitlets/__init__.py:28: DeprecationWarning: Sentinel is not a public part of the traitlets API. It was published by mistake, and may be removed in the future. warn( ../.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/traittypes/traittypes.py:188 /Users/rusu1/.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/traittypes/traittypes.py:188: DeprecationWarning: metadata {'dtype': None} was set from the constructor. With traitlets 4.1, metadata should be set using the .tag() method, e.g., Int().tag(key1='value1', key2='value2') super(DataFrame, self).__init__( ssapy/plotUtils.py:1276: 190 warnings /Users/rusu1/SSAPy/ssapy/plotUtils.py:1276: DeprecationWarning: Starting with ImageIO v3 the behavior of this function will switch to that of iio.v3.imread. To keep the current behavior (and make this warning disappear) use `import imageio.v2 as imageio` or call `imageio.v2.imread` directly. image = imageio.imread(filename) ../.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/erfa/core.py:154 /Users/rusu1/.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/erfa/core.py:154: ErfaWarning: ERFA function "dtf2d" yielded 1423 of "dubious year (Note 6)" warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg), ../.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/erfa/core.py:154 /Users/rusu1/.virtual_envs/v_ssapy_38/lib/python3.8/site-packages/erfa/core.py:154: ErfaWarning: ERFA function "dtf2d" yielded 1 of "dubious year (Note 6)" warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg), tests/test_orbit.py: 102 warnings /Users/rusu1/SSAPy/ssapy/compute.py:73: DeprecationWarning: list of Orbit syntax is deprecated. Please use a vector Orbit instead. warnings.warn( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================================= short test summary info ======================================= FAILED tests/test_accel.py::test_RK78 - AssertionError: FAILED tests/test_orbit.py::test_groundTrack - IndexError: invalid index to scalar variable. FAILED tests/test_orbit.py::test_kozai - AssertionError: FAILED tests/test_orbit.py::test_sgp4 - AssertionError: FAILED tests/test_orbit.py::test_musun - AttributeError: module 'ssapy.constants' has no attribute 'GM_SUN'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: