Skip to content
New issue

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

Point to updated adam core and quivr #165

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/conda-build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
sed -e '2d' ObsCodes.html | grep -v "<" > OBSCODE.dat
rm -f ObsCodes.html
cp OBSCODE.dat $CONDA_PREFIX/share/openorb/OBSCODE.dat
- name: Install adam_core and quivr
- name: Install adam_core and adam-pyoorb
run: |
pip install adam-core@git+https://github.com/B612-Asteroid-Institute/adam_core@main
pip install quivr@git+https://github.com/moeyensj/quivr@concatenate-empty-attributes
pip install adam-core>=0.2.0
pip install git+https://github.com/B612-Asteroid-Institute/adam-pyoorb@main#egg=adam-pyoorb
- name: Build and install
run: pip install . --no-deps
- name: Lint
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "thor/version.py"
write_to_template = "__version__ = '{version}'"

[tool.pytest.ini_options]
python_functions = "test_*"
addopts = "-m \"not (integration or memory)\""

[tool.pytest.ini_options.markers]
integration = "Mark a test as an integration test."
memory = "Mark a test as a memory test."
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
adam-core @ git+https://github.com/B612-Asteroid-Institute/adam_core@ef8ee48976dbf9c70580c166de4cc4fd6195fa36
quivr >= 0.7.1
adam-core >= 0.2.0
quivr == 0.7.3a1
astropy >= 5.3.1
astroquery
difi
Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ setup_requires =
wheel
setuptools_scm >= 6.0
install_requires =
adam-core @ git+https://github.com/B612-Asteroid-Institute/adam_core@c8f5aae352308ccd97c512c8d8e0a2e17c86ee18#egg=adam_core
adam-core>=0.2.0
adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb@main
astropy >= 5.3.1
astroquery
difi
Expand All @@ -44,7 +45,7 @@ install_requires =
pyarrow >= 14.0.0
pydantic < 2.0.0
pyyaml >= 5.1
quivr @ git+https://github.com/moeyensj/quivr@concatenate-empty-attributes
quivr == 0.7.3a1
ray[default]
scikit-learn
scipy
Expand All @@ -57,6 +58,7 @@ tests =
pytest-memray
pytest-cov
pre-commit
matplotlib

dev =
ipython
Expand Down
2 changes: 1 addition & 1 deletion thor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import quivr as qv
import ray
from adam_core.propagator import PYOORB
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.ray_cluster import initialize_use_ray

from .checkpointing import create_checkpoint_data, load_initial_checkpoint_values
Expand Down
4 changes: 2 additions & 2 deletions thor/orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
)
from adam_core.observers import Observers
from adam_core.orbits import Ephemeris, Orbits
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.ray_cluster import initialize_use_ray
from adam_core.time import Timestamp

Expand Down Expand Up @@ -231,7 +232,6 @@ def generate_ephemeris(
observers,
max_processes=max_processes,
chunk_size=1,
parallel_backend="ray",
)

def generate_ephemeris_from_observations(
Expand Down
3 changes: 2 additions & 1 deletion thor/orbit_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
from adam_core.coordinates import KeplerianCoordinates
from adam_core.observers import Observers
from adam_core.orbits import Ephemeris, Orbits
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunks
from adam_core.ray_cluster import initialize_use_ray
from adam_core.time import Timestamp
Expand Down
3 changes: 2 additions & 1 deletion thor/orbits/attribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import ray
from adam_core.coordinates.residuals import Residuals
from adam_core.orbits import Orbits
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunk_indices, _iterate_chunks
from adam_core.ray_cluster import initialize_use_ray
from sklearn.neighbors import BallTree
Expand Down
3 changes: 2 additions & 1 deletion thor/orbits/iod.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import ray
from adam_core.coordinates.residuals import Residuals
from adam_core.orbit_determination import OrbitDeterminationObservations
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunk_indices, _iterate_chunks
from adam_core.ray_cluster import initialize_use_ray

Expand Down
3 changes: 2 additions & 1 deletion thor/orbits/od.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from adam_core.coordinates.residuals import Residuals
from adam_core.orbit_determination import OrbitDeterminationObservations
from adam_core.orbits import Orbits
from adam_core.propagator import PYOORB, Propagator, _iterate_chunks
from adam_core.propagator import Propagator, _iterate_chunks
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.propagator.utils import _iterate_chunk_indices
from adam_core.ray_cluster import initialize_use_ray
from scipy.linalg import solve
Expand Down
9 changes: 6 additions & 3 deletions thor/orbits/state_transition.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import numpy as np
from adam_core import dynamics
from adam_core.constants import Constants as c
from adam_core.dynamics.lagrange import (
apply_lagrange_coefficients,
calc_lagrange_coefficients,
)

__all__ = ["calcMMatrix", "calcStateTransitionMatrix"]

Expand Down Expand Up @@ -152,11 +155,11 @@ def calcStateTransitionMatrix(
# Here alpha is defined as 1 / a where a is the semi-major axis of the orbit
alpha = -(v0_mag**2) / mu + 2 / r0_mag

lagrange_coeffs, stumpff_coeffs, chi = dynamics.calc_lagrange_coefficients(
lagrange_coeffs, stumpff_coeffs, chi = calc_lagrange_coefficients(
r0, v0, dt, mu=mu, max_iter=max_iter, tol=tol
)
f, g, f_dot, g_dot = lagrange_coeffs
r1, v1 = dynamics.apply_lagrange_coefficients(r0, v0, *lagrange_coeffs)
r1, v1 = apply_lagrange_coefficients(r0, v0, *lagrange_coeffs)
M = calcMMatrix(r0, r1, lagrange_coeffs, stumpff_coeffs, chi, alpha, mu=mu)

# Construct the 3 x 2 state matrices with the position vector
Expand Down
3 changes: 2 additions & 1 deletion thor/range_and_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
OriginCodes,
transform_coordinates,
)
from adam_core.propagator import PYOORB, Propagator
from adam_core.propagator import Propagator
from adam_core.propagator.adam_pyoorb import PYOORBPropagator as PYOORB
from adam_core.ray_cluster import initialize_use_ray

from .observations.observations import Observations
Expand Down
1 change: 1 addition & 0 deletions thor/tests/memory/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
open .cache.bench/memory/[session_name]/[test_name].png

"""

import os
import subprocess
import threading
Expand Down
Loading