Skip to content

Commit

Permalink
Update to use new standalone propagator packages
Browse files Browse the repository at this point in the history
  • Loading branch information
akoumjian committed Dec 4, 2024
1 parent f9dac60 commit b3ba5a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 51 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ import numpy as np
from astropy import units as u

from adam_core.orbits.query import query_horizons
from adam_core.propagator.adam_assist import ASSISTPropagator
from adam_assist import ASSISTPropagator
from adam_core.time import Timestamp

# Get orbits to propagate
Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
]
description = "Core libraries for the ADAM platform"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.10,<3.13"
classifiers = [
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
Expand Down Expand Up @@ -60,7 +60,6 @@ build-backend = "pdm.backend"


[dependency-groups]
dev = ["ipython>=8.28.0"]
test = [
"pytest-benchmark",
"pytest-cov",
Expand All @@ -70,7 +69,8 @@ test = [
"isort",
"mypy",
"ruff",
"black"
"black",
"adam-assist>=0.2.0",
]

[tool.black]
Expand Down Expand Up @@ -116,5 +116,3 @@ benchmark = "pytest --benchmark-only"
coverage = "pytest --cov=adam_core --cov-report=xml"


[tool.pdm.dev-dependencies]
dev = ["-e git+https://github.com/B612-Asteroid-Institute/adam-assist.git@main#egg=adam-assist"]
24 changes: 1 addition & 23 deletions src/adam_core/orbit_determination/tests/test_iod.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import pyarrow.compute as pc
import pytest
from adam_assist import ASSISTPropagator

from ...coordinates import CoordinateCovariances, SphericalCoordinates
from ...coordinates.origin import Origin
Expand All @@ -14,27 +15,6 @@
from ..evaluate import OrbitDeterminationObservations
from ..iod import iod

# Specify the path to `adam_assist` in `site-packages`
site_packages_path = next(
(p for p in sys.path if "__pypackages__" in p and p.endswith("lib")), None
)

try:
assist_path = os.path.join(
site_packages_path, "adam_core", "propagator", "adam_assist.py"
)
# Import `adam_assist` from `site-packages`
spec = importlib.util.spec_from_file_location(
"adam_core.propagator.adam_assist", assist_path
)
adam_assist = importlib.util.module_from_spec(spec)
sys.modules["adam_core.propagator.adam_assist"] = adam_assist
spec.loader.exec_module(adam_assist)
from adam_core.propagator.adam_assist import ASSISTPropagator # noqa: E402
except Exception as e:
ASSISTPropagator = None
print(e)


@pytest.fixture
def real_data():
Expand Down Expand Up @@ -80,8 +60,6 @@ def real_data():

return orbit, observations


@pytest.mark.skipif(ASSISTPropagator is None, reason="ASSISTPropagator not available")
def test_iod(real_data):
orbit, observations = real_data
# Call the iod function
Expand Down
23 changes: 1 addition & 22 deletions src/adam_core/orbit_determination/tests/test_od.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
import pyarrow.compute as pc
import pytest
from adam_assist import ASSISTPropagator

from ...coordinates import CoordinateCovariances, SphericalCoordinates
from ...coordinates.origin import Origin
Expand All @@ -15,27 +16,6 @@
from ..fitted_orbits import FittedOrbitMembers, FittedOrbits
from ..od import od

# Specify the path to `adam_assist` in `site-packages`
site_packages_path = next(
(p for p in sys.path if "__pypackages__" in p and p.endswith("lib")), None
)

try:
assist_path = os.path.join(
site_packages_path, "adam_core", "propagator", "adam_assist.py"
)
# Import `adam_assist` from `site-packages`
spec = importlib.util.spec_from_file_location(
"adam_core.propagator.adam_assist", assist_path
)
adam_assist = importlib.util.module_from_spec(spec)
sys.modules["adam_core.propagator.adam_assist"] = adam_assist
spec.loader.exec_module(adam_assist)
from adam_core.propagator.adam_assist import ASSISTPropagator # noqa: E402
except Exception as e:
ASSISTPropagator = None
print(e)


@pytest.fixture
def real_data():
Expand Down Expand Up @@ -84,7 +64,6 @@ def real_data():
return starting_orbit, observations


@pytest.mark.skipif(ASSISTPropagator is None, reason="ASSISTPropagator not available")
def test_od(real_data):
starting_orbit, observations = real_data

Expand Down

0 comments on commit b3ba5a3

Please sign in to comment.