open-space-toolkit-physics 6.0.4__py311-none-manylinux2014_aarch64.whl → 11.3.0__py311-none-manylinux2014_aarch64.whl
Sign up to get free protection for your applications and to get access to all the features.
- {open_space_toolkit_physics-6.0.4.dist-info → open_space_toolkit_physics-11.3.0.dist-info}/METADATA +5 -6
- {open_space_toolkit_physics-6.0.4.dist-info → open_space_toolkit_physics-11.3.0.dist-info}/RECORD +50 -26
- {open_space_toolkit_physics-6.0.4.dist-info → open_space_toolkit_physics-11.3.0.dist-info}/WHEEL +1 -1
- ostk/physics/OpenSpaceToolkitPhysicsPy.cpython-311-aarch64-linux-gnu.so +0 -0
- ostk/physics/__init__.pyi +488 -0
- ostk/physics/coordinate/__init__.pyi +1002 -0
- ostk/physics/coordinate/frame/__init__.pyi +30 -0
- ostk/physics/coordinate/frame/provider/__init__.pyi +77 -0
- ostk/physics/coordinate/frame/provider/iau.pyi +64 -0
- ostk/physics/coordinate/frame/provider/iers.pyi +584 -0
- ostk/physics/coordinate/spherical.pyi +421 -0
- ostk/physics/data/__init__.pyi +459 -0
- ostk/physics/data/provider.pyi +21 -0
- ostk/physics/environment/__init__.pyi +108 -0
- ostk/physics/environment/atmospheric/__init__.pyi +181 -0
- ostk/physics/environment/atmospheric/earth.pyi +552 -0
- ostk/physics/environment/gravitational/__init__.pyi +559 -0
- ostk/physics/environment/gravitational/earth.pyi +56 -0
- ostk/physics/environment/magnetic/__init__.pyi +171 -0
- ostk/physics/environment/magnetic/earth.pyi +56 -0
- ostk/physics/environment/object/__init__.pyi +430 -0
- ostk/physics/environment/object/celestial/__init__.pyi +248 -0
- ostk/physics/environment/object/celestial/moon.pyi +2 -0
- ostk/physics/environment/object/celestial/sun.pyi +2 -0
- ostk/physics/libopen-space-toolkit-physics.so.11 +0 -0
- ostk/physics/py.typed +0 -0
- ostk/physics/test/coordinate/frame/provider/iers/test_manager.py +0 -11
- ostk/physics/test/coordinate/spherical/test_lla.py +56 -4
- ostk/physics/test/coordinate/test_position.py +129 -134
- ostk/physics/test/data/conftest.py +3 -1
- ostk/physics/test/data/provider/test_provider.py +34 -0
- ostk/physics/test/data/test_manifest.py +4 -1
- ostk/physics/test/data/test_manifest_manager.py +6 -8
- ostk/physics/test/data/test_scalar.py +2 -2
- ostk/physics/test/data/test_vector.py +2 -2
- ostk/physics/test/environment/atmospheric/earth/test_manager.py +0 -14
- ostk/physics/test/environment/gravitational/earth/test_manager.py +0 -25
- ostk/physics/test/environment/gravitational/test_earth.py +8 -0
- ostk/physics/test/environment/magnetic/earth/test_manager.py +0 -20
- ostk/physics/test/test_environment.py +58 -40
- ostk/physics/test/time/test_duration.py +0 -7
- ostk/physics/test/time/test_instant.py +16 -0
- ostk/physics/test/time/test_interval.py +177 -10
- ostk/physics/test/time/test_time.py +80 -136
- ostk/physics/test/unit/derived/test_angle.py +1 -1
- ostk/physics/test/unit/test_derived.py +36 -0
- ostk/physics/time.pyi +1744 -0
- ostk/physics/unit.pyi +1590 -0
- ostk/physics/libopen-space-toolkit-physics.so.6 +0 -0
- {open_space_toolkit_physics-6.0.4.dist-info → open_space_toolkit_physics-11.3.0.dist-info}/top_level.txt +0 -0
- {open_space_toolkit_physics-6.0.4.dist-info → open_space_toolkit_physics-11.3.0.dist-info}/zip-safe +0 -0
@@ -4,203 +4,198 @@ import pytest
|
|
4
4
|
import numpy as np
|
5
5
|
|
6
6
|
from ostk.core.type import String
|
7
|
-
import ostk.physics as physics
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
from ostk.physics import Environment
|
9
|
+
from ostk.physics.coordinate import Frame
|
10
|
+
from ostk.physics.coordinate import Position
|
11
|
+
from ostk.physics.coordinate.spherical import LLA
|
12
|
+
from ostk.physics.time import Instant
|
13
|
+
from ostk.physics.time import Scale
|
14
|
+
from ostk.physics.time import DateTime
|
15
|
+
from ostk.physics.unit import Length
|
15
16
|
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
unit: Unit = Unit.Meter
|
18
|
+
@pytest.fixture
|
19
|
+
def unit() -> Length.Unit:
|
20
|
+
return Length.Unit.Meter
|
21
21
|
|
22
|
-
# Construction with python lists
|
23
|
-
vector = [1000.0, 0.0, 0.0]
|
24
22
|
|
25
|
-
|
23
|
+
@pytest.fixture
|
24
|
+
def frame() -> Frame:
|
25
|
+
return Frame.GCRF()
|
26
26
|
|
27
|
-
assert position is not None
|
28
|
-
assert isinstance(position, Position)
|
29
|
-
assert position.is_defined()
|
30
27
|
|
31
|
-
|
32
|
-
|
28
|
+
@pytest.fixture
|
29
|
+
def earth():
|
30
|
+
return Environment.default().access_celestial_object_with_name("Earth")
|
33
31
|
|
34
|
-
position: Position = Position(vector, unit, frame)
|
35
32
|
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
@pytest.fixture
|
34
|
+
def lla() -> LLA:
|
35
|
+
return LLA.vector([0.0, 0.0, 0.0])
|
39
36
|
|
40
|
-
# Construction with python numpy arrays
|
41
|
-
vector = np.array((1000.0, 0.0, 0.0))
|
42
37
|
|
43
|
-
|
38
|
+
class TestPosition:
|
44
39
|
|
45
|
-
|
46
|
-
|
47
|
-
|
40
|
+
def test_constructors(self, unit: Length.Unit, frame: Frame):
|
41
|
+
# Construction with python lists
|
42
|
+
vector = [1000.0, 0.0, 0.0]
|
48
43
|
|
49
|
-
|
50
|
-
position: Position = Position.meters(vector, frame)
|
44
|
+
position: Position = Position(vector, unit, frame)
|
51
45
|
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
assert position is not None
|
47
|
+
assert isinstance(position, Position)
|
48
|
+
assert position.is_defined()
|
55
49
|
|
56
|
-
|
57
|
-
|
50
|
+
# Construction with python tuples
|
51
|
+
vector = (1000.0, 0.0, 0.0)
|
58
52
|
|
59
|
-
|
60
|
-
assert isinstance(position, Position)
|
61
|
-
assert position.is_defined() is False
|
53
|
+
position: Position = Position(vector, unit, frame)
|
62
54
|
|
55
|
+
assert position is not None
|
56
|
+
assert isinstance(position, Position)
|
57
|
+
assert position.is_defined()
|
63
58
|
|
64
|
-
|
65
|
-
|
66
|
-
unit: Unit = Unit.Meter
|
67
|
-
vector_1 = [1000.0, 0.0, 0.0]
|
68
|
-
vector_2 = [-450.3, 234.9, -23.0]
|
59
|
+
# Construction with python numpy arrays
|
60
|
+
vector = np.array((1000.0, 0.0, 0.0))
|
69
61
|
|
70
|
-
|
71
|
-
position_2: Position = Position(vector_2, unit, frame)
|
62
|
+
position: Position = Position(vector, unit, frame)
|
72
63
|
|
73
|
-
|
74
|
-
|
75
|
-
|
64
|
+
assert position is not None
|
65
|
+
assert isinstance(position, Position)
|
66
|
+
assert position.is_defined()
|
76
67
|
|
68
|
+
# Construction with meters static constructor
|
69
|
+
position: Position = Position.meters(vector, frame)
|
77
70
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
vector = [1000.0, 0.0, 0.0]
|
82
|
-
position: Position = Position(vector, unit, frame)
|
71
|
+
assert position is not None
|
72
|
+
assert isinstance(position, Position)
|
73
|
+
assert position.is_defined()
|
83
74
|
|
84
|
-
|
85
|
-
|
75
|
+
# Construction with undefined static constructor
|
76
|
+
position: Position = Position.undefined()
|
86
77
|
|
78
|
+
assert position is not None
|
79
|
+
assert isinstance(position, Position)
|
80
|
+
assert position.is_defined() is False
|
87
81
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
unit: Unit = Unit.Meter
|
82
|
+
def test_comparators(self, unit: Length.Unit, frame: Frame):
|
83
|
+
vector_1 = [1000.0, 0.0, 0.0]
|
84
|
+
vector_2 = [-450.3, 234.9, -23.0]
|
92
85
|
|
93
|
-
|
94
|
-
|
86
|
+
position_1: Position = Position(vector_1, unit, frame)
|
87
|
+
position_2: Position = Position(vector_2, unit, frame)
|
95
88
|
|
96
|
-
|
97
|
-
|
89
|
+
assert position_1 == position_1
|
90
|
+
assert position_2 == position_2
|
91
|
+
assert position_1 != position_2
|
98
92
|
|
99
|
-
|
100
|
-
|
93
|
+
def test_is_defined(self, unit: Length.Unit, frame: Frame):
|
94
|
+
vector = [1000.0, 0.0, 0.0]
|
95
|
+
position: Position = Position(vector, unit, frame)
|
101
96
|
|
97
|
+
assert position.is_defined()
|
98
|
+
assert Position.undefined().is_defined() is False
|
102
99
|
|
103
|
-
|
104
|
-
|
105
|
-
unit: Unit = Unit.Meter
|
106
|
-
vector = [1000.0, 0.0, 0.0]
|
100
|
+
@pytest.mark.skip
|
101
|
+
def test_is_near(self, unit: Length.Unit, frame: Frame):
|
107
102
|
|
108
|
-
|
103
|
+
vector_1 = [1000.0, 0.0, 0.0]
|
104
|
+
vector_2 = [1000.00001, 0.0001, 0.0]
|
109
105
|
|
110
|
-
|
106
|
+
position_1: Position = Position(vector_1, unit, frame)
|
107
|
+
position_2: Position = Position(vector_2, unit, frame)
|
111
108
|
|
112
|
-
|
113
|
-
|
114
|
-
assert ans_frame == frame
|
109
|
+
assert position_1.is_near(position_2, Length.Unit.Meter)
|
110
|
+
assert position_2.is_near(position_1, Length.Unit.Meter)
|
115
111
|
|
112
|
+
def test_access_frame(self, unit: Length.Unit, frame: Frame):
|
113
|
+
vector = [1000.0, 0.0, 0.0]
|
116
114
|
|
117
|
-
|
118
|
-
frame: Frame = Frame.GCRF()
|
119
|
-
unit: Unit = Unit.Meter
|
120
|
-
vector = [1000.0, 0.0, 0.0]
|
115
|
+
position: Position = Position(vector, unit, frame)
|
121
116
|
|
122
|
-
|
117
|
+
ans_frame = position.access_frame()
|
123
118
|
|
124
|
-
|
119
|
+
assert ans_frame is not None
|
120
|
+
assert isinstance(ans_frame, Frame)
|
121
|
+
assert ans_frame == frame
|
125
122
|
|
126
|
-
|
127
|
-
|
128
|
-
assert np.array_equal(coordinates, vector)
|
123
|
+
def test_get_coordinates(self, unit: Length.Unit, frame: Frame):
|
124
|
+
vector = [1000.0, 0.0, 0.0]
|
129
125
|
|
126
|
+
position: Position = Position(vector, unit, frame)
|
130
127
|
|
131
|
-
|
132
|
-
frame: Frame = Frame.GCRF()
|
133
|
-
unit: Unit = Unit.Meter
|
134
|
-
vector = [1000.0, 0.0, 0.0]
|
128
|
+
coordinates = position.get_coordinates()
|
135
129
|
|
136
|
-
|
130
|
+
assert coordinates is not None
|
131
|
+
assert isinstance(coordinates, np.ndarray)
|
132
|
+
assert np.array_equal(coordinates, vector)
|
137
133
|
|
138
|
-
|
134
|
+
def test_get_unit(self, unit: Length.Unit, frame: Frame):
|
135
|
+
vector = [1000.0, 0.0, 0.0]
|
139
136
|
|
140
|
-
|
141
|
-
assert isinstance(ans_unit, Unit)
|
142
|
-
assert ans_unit == unit
|
137
|
+
position: Position = Position(vector, unit, frame)
|
143
138
|
|
139
|
+
ans_unit = position.get_unit()
|
144
140
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
vector = [1000.0, 0.0, 0.0]
|
141
|
+
assert ans_unit is not None
|
142
|
+
assert isinstance(ans_unit, Length.Unit)
|
143
|
+
assert ans_unit == unit
|
149
144
|
|
150
|
-
|
145
|
+
def test_in_unit(self, unit: Length.Unit, frame: Frame):
|
146
|
+
vector = [1000.0, 0.0, 0.0]
|
151
147
|
|
152
|
-
|
148
|
+
position: Position = Position(vector, unit, frame)
|
153
149
|
|
154
|
-
|
155
|
-
assert isinstance(new_position, Position)
|
156
|
-
assert new_position == position
|
150
|
+
new_position: Position = position.in_unit(Length.Unit.Meter)
|
157
151
|
|
158
|
-
|
152
|
+
assert new_position is not None
|
153
|
+
assert isinstance(new_position, Position)
|
154
|
+
assert new_position == position
|
159
155
|
|
160
|
-
|
161
|
-
assert isinstance(new_position, Position)
|
162
|
-
# assert new_position == position
|
156
|
+
new_position: Position = position.in_unit(Length.Unit.TerrestrialMile)
|
163
157
|
|
158
|
+
assert new_position is not None
|
159
|
+
assert isinstance(new_position, Position)
|
160
|
+
# assert new_position == position
|
164
161
|
|
165
|
-
def
|
166
|
-
|
167
|
-
unit: Unit = Unit.Meter
|
168
|
-
vector = [1000.0, 0.0, 0.0]
|
162
|
+
def test_in_meters(self, unit: Length.Unit, frame: Frame):
|
163
|
+
vector = [1000.0, 0.0, 0.0]
|
169
164
|
|
170
|
-
|
165
|
+
position: Position = Position(vector, unit, frame)
|
171
166
|
|
172
|
-
|
167
|
+
new_position: Position = position.in_meters()
|
173
168
|
|
174
|
-
|
175
|
-
|
176
|
-
|
169
|
+
assert new_position is not None
|
170
|
+
assert isinstance(new_position, Position)
|
171
|
+
assert new_position == position
|
177
172
|
|
173
|
+
def test_in_frame(self, unit: Length.Unit, frame: Frame):
|
174
|
+
vector = [1000.0, 0.0, 0.0]
|
178
175
|
|
179
|
-
|
180
|
-
frame: Frame = Frame.GCRF()
|
181
|
-
unit: Unit = Unit.Meter
|
182
|
-
vector = [1000.0, 0.0, 0.0]
|
176
|
+
instant: Instant = Instant.date_time(DateTime(2020, 1, 1, 0, 0, 0), Scale.UTC)
|
183
177
|
|
184
|
-
|
178
|
+
position: Position = Position(vector, unit, frame)
|
185
179
|
|
186
|
-
|
180
|
+
new_position: Position = position.in_frame(frame, instant)
|
187
181
|
|
188
|
-
|
182
|
+
assert new_position is not None
|
183
|
+
assert isinstance(new_position, Position)
|
184
|
+
assert new_position == position
|
189
185
|
|
190
|
-
|
191
|
-
|
192
|
-
assert new_position == position
|
186
|
+
def test_to_string(self, unit: Length.Unit, frame: Frame):
|
187
|
+
vector = [1000.0, 0.0, 0.0]
|
193
188
|
|
189
|
+
position: Position = Position(vector, unit, frame)
|
194
190
|
|
195
|
-
|
196
|
-
frame: Frame = Frame.GCRF()
|
197
|
-
unit: Unit = Unit.Meter
|
198
|
-
vector = [1000.0, 0.0, 0.0]
|
191
|
+
string: String = position.to_string()
|
199
192
|
|
200
|
-
|
193
|
+
assert string is not None
|
194
|
+
assert isinstance(string, String)
|
195
|
+
assert string == "[1000.0, 0.0, 0.0] [m] @ GCRF"
|
201
196
|
|
202
|
-
|
197
|
+
def test_from_lla(self, lla: LLA, earth):
|
198
|
+
assert Position.from_lla(lla, earth) is not None
|
203
199
|
|
204
|
-
|
205
|
-
|
206
|
-
assert string == "[1000.0, 0.0, 0.0] [m] @ GCRF"
|
200
|
+
Environment.default(True)
|
201
|
+
assert Position.from_lla(lla) is not None
|
@@ -14,14 +14,17 @@ from ostk.physics.data import Manager, Manifest
|
|
14
14
|
def data_directory_path() -> str:
|
15
15
|
return f"{pathlib.Path(__file__).parent.absolute()}/data"
|
16
16
|
|
17
|
+
|
17
18
|
@pytest.fixture
|
18
19
|
def manifest_file(data_directory_path: str) -> File:
|
19
20
|
return File.path(Path.parse(f"{data_directory_path}/manifest.json"))
|
20
21
|
|
22
|
+
|
21
23
|
@pytest.fixture
|
22
24
|
def manifest(manifest_file: File) -> Manifest:
|
23
25
|
return Manifest.load(manifest_file)
|
24
26
|
|
27
|
+
|
25
28
|
@pytest.fixture
|
26
29
|
def manager() -> Manager:
|
27
30
|
manager = Manager.get()
|
@@ -29,4 +32,3 @@ def manager() -> Manager:
|
|
29
32
|
yield manager
|
30
33
|
|
31
34
|
manager.reset()
|
32
|
-
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Apache License 2.0
|
2
|
+
|
3
|
+
import pytest
|
4
|
+
|
5
|
+
from ostk.physics import Environment
|
6
|
+
from ostk.physics.environment.object import Celestial
|
7
|
+
from ostk.physics.coordinate import Position
|
8
|
+
from ostk.physics.coordinate import Frame
|
9
|
+
from ostk.physics.data import provider
|
10
|
+
|
11
|
+
|
12
|
+
@pytest.fixture
|
13
|
+
def environment() -> Environment:
|
14
|
+
return Environment.default()
|
15
|
+
|
16
|
+
|
17
|
+
@pytest.fixture
|
18
|
+
def celestial(environment: Environment) -> Celestial:
|
19
|
+
return environment.access_celestial_object_with_name("Earth")
|
20
|
+
|
21
|
+
|
22
|
+
@pytest.fixture
|
23
|
+
def position():
|
24
|
+
return Position.meters([6671000.0, 0.0, 0.0], Frame.ITRF())
|
25
|
+
|
26
|
+
|
27
|
+
class TestProvider:
|
28
|
+
def test_nadir(
|
29
|
+
self,
|
30
|
+
celestial: Celestial,
|
31
|
+
position: Position,
|
32
|
+
environment: Environment,
|
33
|
+
):
|
34
|
+
assert provider.nadir(position, celestial, environment) is not None
|
@@ -11,6 +11,7 @@ from ostk.io import URL
|
|
11
11
|
from ostk.physics.data import Manifest
|
12
12
|
from ostk.physics.time import Instant
|
13
13
|
|
14
|
+
|
14
15
|
class TestManifest:
|
15
16
|
def test_is_defined_success(self, manifest: Manifest):
|
16
17
|
assert manifest.is_defined() == True
|
@@ -22,7 +23,9 @@ class TestManifest:
|
|
22
23
|
assert isinstance(manifest.get_last_update_timestamp_for("manifest"), Instant)
|
23
24
|
|
24
25
|
def test_get_next_update_check_timestamp_for_success(self, manifest: Manifest):
|
25
|
-
assert isinstance(
|
26
|
+
assert isinstance(
|
27
|
+
manifest.get_next_update_check_timestamp_for("manifest"), Instant
|
28
|
+
)
|
26
29
|
|
27
30
|
def test_get_remote_data_urls_success(self, manifest: Manifest):
|
28
31
|
test_url: URL = URL.parse("http://test.com")
|
@@ -12,6 +12,7 @@ from ostk.physics.time import Instant
|
|
12
12
|
from ostk.physics.data import Manager
|
13
13
|
from ostk.physics.data import Manifest
|
14
14
|
|
15
|
+
|
15
16
|
class TestManager:
|
16
17
|
def test_get_last_update_timestamp_for_success(self, manager: Manager):
|
17
18
|
assert isinstance(manager.get_last_update_timestamp_for("manifest"), Instant)
|
@@ -19,8 +20,8 @@ class TestManager:
|
|
19
20
|
def test_get_remote_url_success(self, manager: Manager):
|
20
21
|
assert isinstance(manager.get_remote_url(), URL)
|
21
22
|
|
22
|
-
def
|
23
|
-
assert isinstance(manager.
|
23
|
+
def test_get_local_repository_success(self, manager: Manager):
|
24
|
+
assert isinstance(manager.get_local_repository(), Directory)
|
24
25
|
|
25
26
|
def test_get_remote_data_urls_success(self, manager: Manager):
|
26
27
|
assert isinstance(manager.get_remote_data_urls("data_name"), list)
|
@@ -32,10 +33,10 @@ class TestManager:
|
|
32
33
|
manager.set_remote_url(URL.parse("http://example.com"))
|
33
34
|
assert manager.get_remote_url() == URL.parse("http://example.com")
|
34
35
|
|
35
|
-
def
|
36
|
+
def test_set_local_repository_success(self, manager: Manager):
|
36
37
|
directory = Directory.path(Path.parse("./test_directory"))
|
37
|
-
manager.
|
38
|
-
assert manager.
|
38
|
+
manager.set_local_repository(directory)
|
39
|
+
assert manager.get_local_repository() == directory
|
39
40
|
|
40
41
|
def test_find_remote_data_urls_success(self, manager: Manager):
|
41
42
|
assert isinstance(manager.find_remote_data_urls(".*"), list)
|
@@ -59,6 +60,3 @@ class TestManager:
|
|
59
60
|
|
60
61
|
def test_default_remote_url_success(self, manager: Manager):
|
61
62
|
assert isinstance(manager.default_remote_url(), URL)
|
62
|
-
|
63
|
-
def test_default_manifest_repository_success(self, manager: Manager):
|
64
|
-
assert isinstance(manager.default_manifest_repository(), Directory)
|
@@ -28,7 +28,7 @@ def scalar(value: float, unit: Unit) -> Scalar:
|
|
28
28
|
class TestScalar:
|
29
29
|
def test_constructor(self, scalar: Scalar):
|
30
30
|
assert scalar is not None
|
31
|
-
|
31
|
+
|
32
32
|
def test_equals(self, scalar: Scalar):
|
33
33
|
assert scalar == scalar
|
34
34
|
|
@@ -49,6 +49,6 @@ class TestScalar:
|
|
49
49
|
|
50
50
|
def test_to_string(self, scalar: Scalar):
|
51
51
|
assert scalar.to_string() is not None
|
52
|
-
|
52
|
+
|
53
53
|
def test_undefined(self):
|
54
54
|
assert Scalar.undefined() is not None
|
@@ -38,7 +38,7 @@ def vector(value: float, unit: Unit, frame: Frame) -> Vector:
|
|
38
38
|
class TestVector:
|
39
39
|
def test_constructor(self, vector: Vector):
|
40
40
|
assert vector is not None
|
41
|
-
|
41
|
+
|
42
42
|
def test_equals(self, vector: Vector):
|
43
43
|
assert vector == vector
|
44
44
|
|
@@ -65,6 +65,6 @@ class TestVector:
|
|
65
65
|
|
66
66
|
def test_to_string(self, vector: Vector):
|
67
67
|
assert vector.to_string() is not None
|
68
|
-
|
68
|
+
|
69
69
|
def test_undefined(self):
|
70
70
|
assert Vector.undefined() is not None
|
@@ -4,14 +4,11 @@ import pytest
|
|
4
4
|
|
5
5
|
from datetime import datetime
|
6
6
|
import pathlib
|
7
|
-
import os
|
8
7
|
|
9
8
|
from ostk.core.filesystem import Path
|
10
9
|
from ostk.core.filesystem import File
|
11
10
|
from ostk.core.filesystem import Directory
|
12
11
|
|
13
|
-
from ostk.io import URL
|
14
|
-
|
15
12
|
from ostk.physics.time import Scale
|
16
13
|
from ostk.physics.time import Instant
|
17
14
|
from ostk.physics.time import Duration
|
@@ -174,14 +171,3 @@ class TestManager:
|
|
174
171
|
|
175
172
|
def test_get_success(self):
|
176
173
|
assert isinstance(Manager.get(), Manager)
|
177
|
-
|
178
|
-
def test_default_mode_success(self, manager: Manager):
|
179
|
-
assert manager.default_mode() == Manager.Mode.Automatic
|
180
|
-
|
181
|
-
def test_default_local_repository_success(self, manager: Manager):
|
182
|
-
assert isinstance(manager.default_local_repository(), Directory)
|
183
|
-
assert len(str(manager.default_local_repository().to_string())) > 0
|
184
|
-
|
185
|
-
def test_default_local_repository_lock_timeout_success(self, manager: Manager):
|
186
|
-
assert isinstance(manager.default_local_repository_lock_timeout(), Duration)
|
187
|
-
assert manager.default_local_repository_lock_timeout().in_seconds() == 60.0
|
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
import pytest
|
4
4
|
|
5
|
-
import os
|
6
|
-
|
7
5
|
from ostk.core.filesystem import Path, Directory, PermissionSet
|
8
6
|
|
9
|
-
from ostk.io import URL
|
10
|
-
|
11
7
|
from ostk.physics.time import Duration
|
12
8
|
from ostk.physics.environment.gravitational import Earth as EarthGravitationalModel
|
13
9
|
from ostk.physics.environment.gravitational.earth import (
|
@@ -19,10 +15,6 @@ from ostk.physics.environment.gravitational.earth import (
|
|
19
15
|
def manager() -> EarthGravitationalModelManager:
|
20
16
|
manager = EarthGravitationalModelManager.get()
|
21
17
|
|
22
|
-
manager.set_local_repository(
|
23
|
-
EarthGravitationalModelManager.default_local_repository()
|
24
|
-
)
|
25
|
-
|
26
18
|
yield manager
|
27
19
|
|
28
20
|
# This reset is important so that other test modules are not affected
|
@@ -82,20 +74,3 @@ class TestManager:
|
|
82
74
|
manager.get_local_repository().to_string()
|
83
75
|
== "./.open-space-toolkit/physics/environment/gravitational/earth2"
|
84
76
|
)
|
85
|
-
|
86
|
-
def test_default_local_repository_success(
|
87
|
-
self, manager: EarthGravitationalModelManager
|
88
|
-
):
|
89
|
-
assert isinstance(
|
90
|
-
EarthGravitationalModelManager.default_local_repository(), Directory
|
91
|
-
)
|
92
|
-
assert len(str(manager.default_local_repository().to_string())) > 0
|
93
|
-
|
94
|
-
def test_default_mode_success(self, manager: EarthGravitationalModelManager):
|
95
|
-
assert manager.default_mode() == EarthGravitationalModelManager.Mode.Automatic
|
96
|
-
|
97
|
-
def test_default_local_repository_lock_timeout_success(
|
98
|
-
self, manager: EarthGravitationalModelManager
|
99
|
-
):
|
100
|
-
assert isinstance(manager.default_local_repository_lock_timeout(), Duration)
|
101
|
-
assert manager.default_local_repository_lock_timeout().in_seconds() == 60.0
|
@@ -55,6 +55,14 @@ class TestEarth:
|
|
55
55
|
assert isinstance(earth_gravitational_model, EarthGravitationalModel)
|
56
56
|
assert isinstance(earth_gravitational_model, GravitationalModel)
|
57
57
|
|
58
|
+
def test_constructor_success_without_directory_with_degree_and_order(self):
|
59
|
+
earth_gravitational_model = EarthGravitationalModel(
|
60
|
+
EarthGravitationalModel.Type.EGM2008, 2, 2
|
61
|
+
)
|
62
|
+
|
63
|
+
assert isinstance(earth_gravitational_model, EarthGravitationalModel)
|
64
|
+
assert isinstance(earth_gravitational_model, GravitationalModel)
|
65
|
+
|
58
66
|
def test_get_type_success(self, earth_gravitational_model: EarthGravitationalModel):
|
59
67
|
assert (
|
60
68
|
earth_gravitational_model.get_type() == EarthGravitationalModel.Type.EGM2008
|
@@ -2,13 +2,8 @@
|
|
2
2
|
|
3
3
|
import pytest
|
4
4
|
|
5
|
-
import os
|
6
|
-
|
7
5
|
from ostk.core.filesystem import Path, Directory, PermissionSet
|
8
6
|
|
9
|
-
from ostk.io import URL
|
10
|
-
|
11
|
-
from ostk.physics.time import Duration
|
12
7
|
from ostk.physics.environment.magnetic import Earth as EarthMagneticModel
|
13
8
|
from ostk.physics.environment.magnetic.earth import (
|
14
9
|
Manager as EarthMagneticModelManager,
|
@@ -19,8 +14,6 @@ from ostk.physics.environment.magnetic.earth import (
|
|
19
14
|
def manager() -> EarthMagneticModelManager:
|
20
15
|
manager = EarthMagneticModelManager.get()
|
21
16
|
|
22
|
-
manager.set_local_repository(EarthMagneticModelManager.default_local_repository())
|
23
|
-
|
24
17
|
yield manager
|
25
18
|
|
26
19
|
# This reset is important so that other test modules are not affected
|
@@ -69,16 +62,3 @@ class TestManager:
|
|
69
62
|
manager.get_local_repository().to_string()
|
70
63
|
== "./.open-space-toolkit/physics/environment/magnetic/earth2"
|
71
64
|
)
|
72
|
-
|
73
|
-
def test_default_local_repository_success(self, manager: EarthMagneticModelManager):
|
74
|
-
assert isinstance(EarthMagneticModelManager.default_local_repository(), Directory)
|
75
|
-
assert len(str(manager.default_local_repository().to_string())) > 0
|
76
|
-
|
77
|
-
def test_default_mode_success(self, manager: EarthMagneticModelManager):
|
78
|
-
assert manager.default_mode() == EarthMagneticModelManager.Mode.Automatic
|
79
|
-
|
80
|
-
def test_default_local_repository_lock_timeout_success(
|
81
|
-
self, manager: EarthMagneticModelManager
|
82
|
-
):
|
83
|
-
assert isinstance(manager.default_local_repository_lock_timeout(), Duration)
|
84
|
-
assert manager.default_local_repository_lock_timeout().in_seconds() == 60.0
|