From 9150755148dd6952bd467252a4c49a2f7b65abcb Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Wed, 15 May 2024 09:19:55 -0400 Subject: [PATCH 01/15] starting to remove pyoorb --- README.md | 5 +- adam_core/propagator/__init__.py | 6 +- adam_core/propagator/pyoorb.py | 541 ------------------------------- adam_core/tests/test_imports.py | 4 +- pyproject.toml | 4 +- 5 files changed, 11 insertions(+), 549 deletions(-) delete mode 100644 adam_core/propagator/pyoorb.py diff --git a/README.md b/README.md index dab0e649..225411a0 100644 --- a/README.md +++ b/README.md @@ -150,8 +150,9 @@ spherical_elements = orbits.coordinates.to_spherical() ``` ### Propagator -The propagator class in `adam_core` provides a generalized interface to the supported orbit integrators and ephemeris generators. By default, -`adam_core` ships with PYOORB. +The propagator class in `adam_core` provides a generalized interface to the supported orbit integrators and ephemeris generators. The propagator class is designed to be used with the `Orbits` class and can handle multiple orbits and times. + +You will need to install either adam_core[pyoorb] or adam_core[assist], or another compatible propagator in order to use propagation, ephemeris generation, or impact analysis. #### Propagation To propagate orbits with PYOORB (here we grab some orbits from Horizons first): diff --git a/adam_core/propagator/__init__.py b/adam_core/propagator/__init__.py index 8cc2c9ee..bd1ab456 100644 --- a/adam_core/propagator/__init__.py +++ b/adam_core/propagator/__init__.py @@ -1,9 +1,11 @@ # flake8: noqa: F401 -from .propagator import Propagator -from .pyoorb import PYOORB +from .propagator import EphemerisMixin, EphemerisType, OrbitType, Propagator from .utils import _iterate_chunks __all__ = [ "Propagator", + "EphemerisMixin", + "OrbitType", + "EphemerisType", "PYOORB", ] diff --git a/adam_core/propagator/pyoorb.py b/adam_core/propagator/pyoorb.py deleted file mode 100644 index 63bfa045..00000000 --- a/adam_core/propagator/pyoorb.py +++ /dev/null @@ -1,541 +0,0 @@ -try: - import pyoorb as oo -except ImportError: - raise ImportError("PYOORB is not installed.") - -import enum -import logging -import os -from typing import Optional, Union - -import numpy as np -import quivr as qv - -from ..coordinates.cartesian import CartesianCoordinates -from ..coordinates.origin import Origin -from ..coordinates.spherical import SphericalCoordinates -from ..observers.observers import Observers -from ..orbits.ephemeris import Ephemeris -from ..orbits.orbits import Orbits -from ..orbits.variants import VariantEphemeris, VariantOrbits -from ..time import Timestamp -from .propagator import EphemerisMixin, EphemerisType, OrbitType, Propagator -from .utils import _assert_times_almost_equal - -logger = logging.getLogger(__name__) - - -class OpenOrbTimescale(enum.Enum): - UTC = 1 - UT1 = 2 - TT = 3 - TAI = 4 - - -class OpenOrbOrbitType(enum.Enum): - CARTESIAN = 1 - COMETARY = 2 - KEPLERIAN = 3 - - -PYOORB_INIT_CACHCE = {} - - -def process_safe_oorb_init(ephfile): - """ - Initializes pyoorb only if it hasn't been initialized in this process before - """ - pid = os.getpid() - if pid in PYOORB_INIT_CACHCE: - logger.debug(f"PYOORB already initialized for process {pid}") - return - - logger.debug(f"Initializing PYOORB for process {pid}") - PYOORB_INIT_CACHCE[pid] = True - err = oo.pyoorb.oorb_init(ephfile) - if err != 0: - raise RuntimeError(f"PYOORB returned error code: {err}") - - -class PYOORB(Propagator, EphemerisMixin): - def __init__( - self, *, dynamical_model: str = "N", ephemeris_file: str = "de430.dat" - ): - self.dynamical_model = dynamical_model - self.ephemeris_file = ephemeris_file - - if os.environ.get("OORB_DATA") is None: - if os.environ.get("CONDA_PREFIX") is None: - raise RuntimeError( - "Cannot find OORB_DATA directory. Please set the OORB_DATA environment variable." - ) - else: - os.environ["OORB_DATA"] = os.path.join( - os.environ["CONDA_PREFIX"], "share/openorb" - ) - - oorb_data = os.environ["OORB_DATA"] - - # Prepare pyoorb - ephfile = os.path.join(oorb_data, self.ephemeris_file) - process_safe_oorb_init(ephfile) - - return - - @staticmethod - def _configure_orbits( - orbits: np.ndarray, - t0: np.ndarray, - orbit_type: OpenOrbOrbitType, - time_scale: OpenOrbTimescale, - magnitude: Optional[Union[float, np.ndarray]] = None, - slope: Optional[Union[float, np.ndarray]] = None, - ) -> np.ndarray: - """ - Convert an array of orbits into the format expected by PYOORB. - - Parameters - ---------- - orbits : `~numpy.ndarray` (N, 6) - Orbits to convert. See orbit_type for expected input format. - t0 : `~numpy.ndarray` (N) - Epoch in MJD at which the orbits are defined. - orbit_type : OpenOrbOrbitType - Orbital element representation of the provided orbits. - If cartesian: - x : heliocentric ecliptic J2000 x position in AU - y : heliocentric ecliptic J2000 y position in AU - z : heliocentric ecliptic J2000 z position in AU - vx : heliocentric ecliptic J2000 x velocity in AU per day - vy : heliocentric ecliptic J2000 y velocity in AU per day - vz : heliocentric ecliptic J2000 z velocity in AU per day - If keplerian: - a : semi-major axis in AU - e : eccentricity in degrees - i : inclination in degrees - Omega : longitude of the ascending node in degrees - omega : argument of periapsis in degrees - M0 : mean anomaly in degrees - If cometary: - p : perihelion distance in AU - e : eccentricity in degrees - i : inclination in degrees - Omega : longitude of the ascending node in degrees - omega : argument of periapsis in degrees - T0 : time of perihelion passage in MJD - time_scale : OpenOrbTimescale - Time scale of the MJD epochs. - magnitude : float or `~numpy.ndarray` (N), optional - Absolute H-magnitude or M1 magnitude. - slope : float or `~numpy.ndarray` (N), optional - Photometric slope parameter G or K1. - - Returns - ------- - orbits_pyoorb : `~numpy.ndarray` (N, 12) - Orbits formatted in the format expected by PYOORB. - orbit_id : index of input orbits - elements x6: orbital elements of propagated orbits - orbit_type : orbit type - epoch_mjd : epoch of the propagate orbit - time_scale : time scale of output epochs - H/M1 : absolute magnitude - G/K1 : photometric slope parameter - """ - orbits_ = orbits.copy() - num_orbits = orbits_.shape[0] - - orbit_type_ = np.array([orbit_type.value for i in range(num_orbits)]) - - time_scale_ = np.array([time_scale.value for i in range(num_orbits)]) - - if isinstance(slope, (float, int)): - slope_ = np.array([slope for i in range(num_orbits)]) - elif isinstance(slope, list): - slope_ = np.array(slope) - elif isinstance(slope, np.ndarray): - slope_ = slope - else: - slope_ = np.array([0.15 for i in range(num_orbits)]) - - if isinstance(magnitude, (float, int)): - magnitude_ = np.array([magnitude for i in range(num_orbits)]) - elif isinstance(magnitude, list): - magnitude_ = np.array(magnitude) - elif isinstance(magnitude, np.ndarray): - magnitude_ = magnitude - else: - magnitude_ = np.array([20.0 for i in range(num_orbits)]) - - ids = np.array([i for i in range(num_orbits)]) - - orbits_pyoorb = np.zeros((num_orbits, 12), dtype=np.double, order="F") - orbits_pyoorb[:, 0] = ids - orbits_pyoorb[:, 1:7] = orbits_ - orbits_pyoorb[:, 7] = orbit_type_ - orbits_pyoorb[:, 8] = t0 - orbits_pyoorb[:, 9] = time_scale_ - orbits_pyoorb[:, 10] = magnitude_ - orbits_pyoorb[:, 11] = slope_ - - return orbits_pyoorb - - @staticmethod - def _configure_epochs( - epochs: np.ndarray, time_scale: OpenOrbTimescale - ) -> np.ndarray: - """ - Convert an array of times into the format expected by PYOORB. - - Parameters - ---------- - epochs : `~numpy.ndarray` (N) - Epoch in MJD to convert. - time_scale : OpenOrbTimescale - Time scale of the MJD epochs. - - Returns - ------- - epochs_pyoorb : `~numpy.ndarray` (N, 2) - Epochs converted into the PYOORB format. - """ - num_times = len(epochs) - time_scale_list = [time_scale.value for i in range(num_times)] - epochs_pyoorb = np.array( - list(np.vstack([epochs, time_scale_list]).T), dtype=np.double, order="F" - ) - return epochs_pyoorb - - def _propagate_orbits(self, orbits: OrbitType, times: Timestamp) -> OrbitType: - """ - Propagate orbits using PYOORB. - - Parameters - ---------- - orbits : {`~adam_core.orbits.orbits.Orbits`, `~adam_core.orbits.orbits.VariantOrbits`} (N) - Orbits to propagate. - times : Timestamp (M) - Times to which to propagate orbits. - - Returns - ------- - propagated : {`~adam_core.orbits.orbits.Orbits`, `~adam_core.orbits.orbits.VariantOrbits`} (N * M) - Orbits propagated to each time in times. - """ - # Convert orbits into PYOORB format - orbits_pyoorb = self._configure_orbits( - orbits.coordinates.values, - orbits.coordinates.time.rescale("tt").mjd(), - OpenOrbOrbitType.CARTESIAN, - OpenOrbTimescale.TT, - magnitude=None, - slope=None, - ) - - # Convert epochs into PYOORB format - epochs_pyoorb = self._configure_epochs( - times.rescale("tt").mjd(), OpenOrbTimescale.TT - ) - - # Propagate orbits to each epoch and append to list - # of new states - states_list = [] - orbits_pyoorb_i = orbits_pyoorb.copy() - for epoch in epochs_pyoorb: - orbits_pyoorb_i, err = oo.pyoorb.oorb_propagation( - in_orbits=orbits_pyoorb_i, - in_epoch=epoch, - in_dynmodel=self.dynamical_model, - ) - states_list.append(orbits_pyoorb_i) - - if err != 0: - raise RuntimeError(f"PYOORB propagation failed with error code {err}.") - - # Convert list of new states into a pandas data frame - # These states at the moment will always be return as cartesian - # state vectors - # elements = ["x", "y", "z", "vx", "vy", "vz"] - # Other PYOORB state vector representations: - # "keplerian": - # elements = ["a", "e", "i", "Omega", "omega", "M0"] - # "cometary": - # elements = ["q", "e", "i", "Omega", "omega", "T0"] - states = np.concatenate(states_list) - - # Extract cartesian states from PYOORB results - orbit_ids_ = states[:, 0].astype(int) - x = states[:, 1] - y = states[:, 2] - z = states[:, 3] - vx = states[:, 4] - vy = states[:, 5] - vz = states[:, 6] - mjd_tt = states[:, 8] - - # Check to make sure the desired times are within 1 microsecond - # of the times returned by PYOORB - _assert_times_almost_equal( - mjd_tt, np.repeat(epochs_pyoorb[:, 0], len(orbits)), tolerance=0.001 - ) - - # Convert output epochs to TDB - times_ = Timestamp.from_mjd(mjd_tt, scale="tt").rescale("tdb") - - if isinstance(orbits, Orbits): - # Map the object and orbit IDs back to the input arrays - object_ids = orbits.object_id.to_numpy(zero_copy_only=False)[orbit_ids_] - orbit_ids = orbits.orbit_id.to_numpy(zero_copy_only=False)[orbit_ids_] - - propagated_orbits = Orbits.from_kwargs( - orbit_id=orbit_ids, - object_id=object_ids, - coordinates=CartesianCoordinates.from_kwargs( - x=x, - y=y, - z=z, - vx=vx, - vy=vy, - vz=vz, - time=times_, - origin=Origin.from_kwargs(code=["SUN" for i in range(len(times_))]), - frame="ecliptic", - ), - ) - - elif isinstance(orbits, VariantOrbits): - # Map the object and orbit IDs back to the input arrays - object_ids = orbits.object_id.to_numpy(zero_copy_only=False)[orbit_ids_] - orbit_ids = orbits.orbit_id.to_numpy(zero_copy_only=False)[orbit_ids_] - weights = orbits.weights.to_numpy()[orbit_ids_] - weights_cov = orbits.weights_cov.to_numpy()[orbit_ids_] - - propagated_orbits = VariantOrbits.from_kwargs( - orbit_id=orbit_ids, - object_id=object_ids, - weights=weights, - weights_cov=weights_cov, - coordinates=CartesianCoordinates.from_kwargs( - x=x, - y=y, - z=z, - vx=vx, - vy=vy, - vz=vz, - time=times_, - origin=Origin.from_kwargs(code=["SUN" for i in range(len(times_))]), - frame="ecliptic", - ), - ) - - return propagated_orbits - - def _generate_ephemeris( - self, orbits: OrbitType, observers: Observers - ) -> EphemerisType: - """ - Generate ephemerides for orbits as viewed from observers using PYOORB. - - Parameters - ---------- - orbits : {`~adam_core.orbits.orbits.Orbits`, `~adam_core.orbits.orbits.VariantOrbits`} (N) - Orbits to propagate. - observers : `~adam_core.observers.observers.Observers` (M) - Observers to generate ephemerides for. - - Returns - ------- - ephemeris : `~adam_core.orbits.ephemeris.Ephemeris` (M) - Ephemerides for each orbit as viewed from each observer. - """ - # Convert orbits into PYOORB format - orbits_pyoorb = self._configure_orbits( - orbits.coordinates.values, - orbits.coordinates.time.rescale("tt").mjd(), - OpenOrbOrbitType.CARTESIAN, - OpenOrbTimescale.TT, - magnitude=None, - slope=None, - ) - - # Check if observation times are defined in UTC - if observers.coordinates.time.scale != "utc": - observers_utc = Observers.from_kwargs( - code=observers.code, - coordinates=CartesianCoordinates.from_kwargs( - x=observers.coordinates.x, - y=observers.coordinates.y, - z=observers.coordinates.z, - vx=observers.coordinates.vx, - vy=observers.coordinates.vy, - vz=observers.coordinates.vz, - covariance=observers.coordinates.covariance, - time=observers.coordinates.time.rescale("utc"), - origin=observers.coordinates.origin, - frame=observers.coordinates.frame, - ), - ) - else: - observers_utc = observers - - ephemeris_list = [] - # Iterate over unique observatory codes and their times - for code_i, observer_i in observers_utc.iterate_codes(): - # Extract obervation times - mjd_utc = observer_i.coordinates.time.mjd() - - # Convert epochs into PYOORB format (we want UTC as output) - epochs_pyoorb = self._configure_epochs(mjd_utc, OpenOrbTimescale.UTC) - - # Generate ephemeris - ephemeris_array_3D, err = oo.pyoorb.oorb_ephemeris_full( - in_orbits=orbits_pyoorb, - in_obscode=code_i, - in_date_ephems=epochs_pyoorb, - in_dynmodel=self.dynamical_model, - ) - - if err != 0: - raise RuntimeError( - f"PYOORB ephemeris generation failed with error code {err}." - ) - - # Stack 3D ephemeris into single 2D array - ephemeris_array = np.vstack(ephemeris_array_3D) - - # PYOORB returns ephemerides for each orbit, so lets reconstruct orbit IDs - ids = np.arange(0, len(orbits)) - orbit_ids_idx = np.repeat(ids, len(mjd_utc)) - - # Columns returned by PYOORB, we will only use a subset - # columns = [ - # "mjd_utc", - # "RA_deg", - # "Dec_deg", - # "vRAcosDec", - # "vDec", - # "PhaseAngle_deg", - # "SolarElon_deg", - # "r_au", - # "delta_au", - # "VMag", - # "PosAngle_deg", - # "TLon_deg", - # "TLat_deg", - # "TOCLon_deg", - # "TOCLat_deg", - # "HLon_deg", - # "HLat_deg", - # "HOCLon_deg", - # "HOCLat_deg", - # "Alt_deg", - # "SolarAlt_deg", - # "LunarAlt_deg", - # "LunarPhase", - # "LunarElon_deg", - # "obj_x", - # "obj_y", - # "obj_z", - # "obj_vx", - # "obj_vy", - # "obj_vz", - # "obs_x", - # "obs_y", - # "obs_z", - # "TrueAnom", - # ] - codes = np.empty(len(ephemeris_array), dtype=object) - codes[:] = code_i - - # Check to make sure the desired times are within 1 microsecond - # of the times returned by PYOORB - _assert_times_almost_equal( - np.tile(mjd_utc, len(orbits)), - ephemeris_array[:, 0], - tolerance=0.001, # FIXME: This is 0.001 days, which is 86.4 seconds, not 1 microsecond? - ) - - if isinstance(orbits, Orbits): - # Map the object and orbit IDs back to the input arrays - orbit_ids = orbits.orbit_id.to_numpy(zero_copy_only=False)[ - orbit_ids_idx - ] - object_ids = orbits.object_id.to_numpy(zero_copy_only=False)[ - orbit_ids_idx - ] - - ephemeris = Ephemeris.from_kwargs( - orbit_id=orbit_ids, - object_id=object_ids, - coordinates=SphericalCoordinates.from_kwargs( - time=Timestamp.from_mjd( - ephemeris_array[:, 0], - scale="utc", - ), - rho=None, # PYOORB rho (delta_au) is geocentric not topocentric - lon=ephemeris_array[:, 1], - lat=ephemeris_array[:, 2], - vlon=ephemeris_array[:, 3] - / np.cos(np.radians(ephemeris_array[:, 2])), - vlat=ephemeris_array[:, 4], - vrho=None, # PYOORB doesn't calculate observer velocity so it can't calulate vrho - origin=Origin.from_kwargs(code=codes), - frame="equatorial", - ), - alpha=ephemeris_array[:, 5], - aberrated_coordinates=CartesianCoordinates.from_kwargs( - x=ephemeris_array[:, 24], - y=ephemeris_array[:, 25], - z=ephemeris_array[:, 26], - vx=ephemeris_array[:, 27], - vy=ephemeris_array[:, 28], - vz=ephemeris_array[:, 29], - time=Timestamp.from_mjd( - ephemeris_array[:, 0], - scale="utc", - ), - origin=Origin.from_kwargs( - code=["SUN" for i in range(len(ephemeris_array))] - ), - frame="ecliptic", - ), - ) - - ephemeris_list.append(ephemeris) - - elif isinstance(orbits, VariantOrbits): - # Map the object and orbit IDs back to the input arrays - object_ids = orbits.object_id.to_numpy(zero_copy_only=False)[ - orbit_ids_idx - ] - orbit_ids = orbits.orbit_id.to_numpy(zero_copy_only=False)[ - orbit_ids_idx - ] - weights = orbits.weights.to_numpy()[orbit_ids_idx] - weights_cov = orbits.weights_cov.to_numpy()[orbit_ids_idx] - - variant_ephemeris = VariantEphemeris.from_kwargs( - orbit_id=orbit_ids, - object_id=object_ids, - coordinates=SphericalCoordinates.from_kwargs( - time=Timestamp.from_mjd( - ephemeris_array[:, 0], - scale="utc", - ), - rho=None, # PYOORB rho (delta_au) is geocentric not topocentric - lon=ephemeris_array[:, 1], - lat=ephemeris_array[:, 2], - vlon=ephemeris_array[:, 3] - / np.cos(np.radians(ephemeris_array[:, 2])), - vlat=ephemeris_array[:, 4], - vrho=None, # PYOORB doesn't calculate observer velocity so it can't calulate vrho - origin=Origin.from_kwargs(code=codes), - frame="equatorial", - ), - weights=weights, - weights_cov=weights_cov, - ) - - ephemeris_list.append(variant_ephemeris) - - return qv.concatenate(ephemeris_list) diff --git a/adam_core/tests/test_imports.py b/adam_core/tests/test_imports.py index 1f04adc7..80754e68 100644 --- a/adam_core/tests/test_imports.py +++ b/adam_core/tests/test_imports.py @@ -25,8 +25,8 @@ def test_import_coordinates(): ) -def test_import_propagator(): - from adam_core.propagator import PYOORB, Propagator +# def test_import_propagator(): +# from adam_core.propagator import PYOORB, Propagator def test_import_observations(): diff --git a/pyproject.toml b/pyproject.toml index b030c8bd..7742c171 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,8 +29,7 @@ dependencies = [ "jaxlib", "numpy<1.25", "pyarrow>=13.0.0", - # This fork removes errors that occur with true anomaly values - "pyoorb@git+https://github.com/B612-Asteroid-Institute/oorb.git@fork", + # "pyoorb@git+https://github.com/B612-Asteroid-Institute/oorb.git@fork", "pandas", "ray", "requests", @@ -67,6 +66,7 @@ dependencies = [ "mypy", "pytest", "pytest-cov", + "adam-pyoorb@git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@master", "pytest-benchmark", "pytest-doctestplus", "pytest-mock", From 6ad18fe56dcaab480efad56b423a502526b08c42 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Thu, 16 May 2024 13:36:12 -0400 Subject: [PATCH 02/15] Update package settigns --- .github/workflows/docker-build-lint-test.yml | 29 ---- .../pip-build-lint-test-coverage.yml | 11 +- pyproject.toml | 160 ++++++------------ {adam_core => src/adam_core}/__init__.py | 0 {adam_core => src/adam_core}/__version__.py | 0 {adam_core => src/adam_core}/constants.py | 0 .../adam_core}/coordinates/__init__.py | 0 .../adam_core}/coordinates/cartesian.py | 0 .../adam_core}/coordinates/cometary.py | 0 .../adam_core}/coordinates/conversions.py | 0 .../adam_core}/coordinates/covariances.py | 0 .../adam_core}/coordinates/jacobian.py | 0 .../adam_core}/coordinates/keplerian.py | 0 .../adam_core}/coordinates/origin.py | 0 .../adam_core}/coordinates/residuals.py | 0 .../adam_core}/coordinates/spherical.py | 0 .../adam_core}/coordinates/tests/__init__.py | 0 .../adam_core}/coordinates/tests/conftest.py | 0 .../coordinates/tests/test_benchmarks.py | 0 .../coordinates/tests/test_cartesian.py | 0 .../coordinates/tests/test_cometary.py | 0 .../coordinates/tests/test_covariances.py | 0 .../coordinates/tests/test_keplerian.py | 0 .../coordinates/tests/test_origin.py | 0 .../coordinates/tests/test_residuals.py | 0 .../coordinates/tests/test_spherical.py | 0 .../tests/test_transforms_cometary.py | 0 .../tests/test_transforms_keplerian.py | 0 .../tests/test_transforms_rotation.py | 0 .../tests/test_transforms_spherical.py | 0 .../tests/test_transforms_spice.py | 0 .../tests/test_transforms_translation.py | 0 .../adam_core}/coordinates/transform.py | 0 .../adam_core}/coordinates/types.py | 0 .../adam_core}/coordinates/variants.py | 12 +- .../adam_core}/dynamics/__init__.py | 0 .../adam_core}/dynamics/aberrations.py | 0 .../adam_core}/dynamics/barker.py | 0 {adam_core => src/adam_core}/dynamics/chi.py | 0 .../adam_core}/dynamics/ephemeris.py | 0 .../adam_core}/dynamics/impacts.py | 0 .../adam_core}/dynamics/kepler.py | 0 .../adam_core}/dynamics/lagrange.py | 0 {adam_core => src/adam_core}/dynamics/moid.py | 0 .../adam_core}/dynamics/propagation.py | 0 .../adam_core}/dynamics/stumpff.py | 0 .../adam_core}/dynamics/tests/__init__.py | 0 .../adam_core}/dynamics/tests/conftest.py | 0 .../dynamics/tests/test_ephemeris.py | 0 .../adam_core}/dynamics/tests/test_impacts.py | 0 .../adam_core}/dynamics/tests/test_kepler.py | 0 .../adam_core}/dynamics/tests/test_moid.py | 0 .../dynamics/tests/test_propagation.py | 0 .../dynamics/tests/test_tisserand.py | 0 .../adam_core}/dynamics/tisserand.py | 0 .../adam_core}/observations/__init__.py | 0 .../adam_core}/observations/associations.py | 0 .../adam_core}/observations/detections.py | 0 .../adam_core}/observations/exposures.py | 0 .../adam_core}/observations/tests/__init__.py | 0 .../observations/tests/test_associations.py | 0 .../observations/tests/test_detections.py | 0 .../observations/tests/test_exposures.py | 0 .../adam_core}/observers/__init__.py | 0 .../adam_core}/observers/observers.py | 0 .../adam_core}/observers/state.py | 0 .../adam_core}/observers/tests/__init__.py | 0 .../observers/tests/test_benchmarks.py | 0 .../adam_core}/observers/tests/test_state.py | 0 .../observers/tests/testdata/000_ssb.parquet | Bin .../observers/tests/testdata/000_sun.parquet | Bin .../observers/tests/testdata/500_ssb.parquet | Bin .../observers/tests/testdata/500_sun.parquet | Bin .../observers/tests/testdata/F51_ssb.parquet | Bin .../observers/tests/testdata/F51_sun.parquet | Bin .../observers/tests/testdata/I41_ssb.parquet | Bin .../observers/tests/testdata/I41_sun.parquet | Bin .../observers/tests/testdata/README.md | 0 .../observers/tests/testdata/W84_ssb.parquet | Bin .../observers/tests/testdata/W84_sun.parquet | Bin .../observers/tests/testdata/X05_ssb.parquet | Bin .../observers/tests/testdata/X05_sun.parquet | Bin .../observers/tests/testdata/get_states.py | 0 .../orbit_determination/__init__.py | 0 .../differential_correction.py | 0 .../orbit_determination/evaluate.py | 0 .../orbit_determination/fitted_orbits.py | 0 .../orbit_determination/outliers.py | 0 .../orbit_determination/tests/__init__.py | 0 .../orbit_determination/tests/conftest.py | 0 .../tests/data/pure_iod_orbit.parquet | Bin .../tests/data/pure_iod_orbit_members.parquet | Bin .../data/pure_iod_orbit_observations.parquet | Bin .../tests/test_differential_correction.py | 3 +- .../tests/test_evaluate.py | 3 +- .../tests/test_outliers.py | 0 .../adam_core}/orbits/__init__.py | 0 .../adam_core}/orbits/classification.py | 0 .../adam_core}/orbits/ephemeris.py | 0 {adam_core => src/adam_core}/orbits/orbits.py | 0 .../adam_core}/orbits/query/__init__.py | 0 .../adam_core}/orbits/query/horizons.py | 0 .../adam_core}/orbits/query/sbdb.py | 0 .../adam_core}/orbits/query/tests/__init__.py | 0 .../orbits/query/tests/test_sbdb.py | 0 .../query/tests/testdata/sbdb/2001VB.json | 0 .../query/tests/testdata/sbdb/54509.json | 0 .../query/tests/testdata/sbdb/Ceres.json | 0 .../query/tests/testdata/sbdb/README.md | 0 .../query/tests/testdata/sbdb/missing.json | 0 .../adam_core}/orbits/tests/__init__.py | 0 .../orbits/tests/test_benchmarks.py | 0 .../orbits/tests/test_classification.py | 0 .../adam_core}/orbits/tests/test_ephemeris.py | 0 .../adam_core}/orbits/tests/test_orbits.py | 0 .../adam_core}/orbits/tests/test_variants.py | 0 .../orbits/tests/testdata/__init__.py | 0 .../adam_core}/orbits/tests/testdata/amo.csv | 0 .../adam_core}/orbits/tests/testdata/apo.csv | 0 .../adam_core}/orbits/tests/testdata/ast.csv | 0 .../adam_core}/orbits/tests/testdata/ate.csv | 0 .../adam_core}/orbits/tests/testdata/cen.csv | 0 .../adam_core}/orbits/tests/testdata/hya.csv | 0 .../adam_core}/orbits/tests/testdata/ieo.csv | 0 .../adam_core}/orbits/tests/testdata/imb.csv | 0 .../adam_core}/orbits/tests/testdata/mba.csv | 0 .../adam_core}/orbits/tests/testdata/mca.csv | 0 .../adam_core}/orbits/tests/testdata/omb.csv | 0 .../adam_core}/orbits/tests/testdata/tjn.csv | 0 .../adam_core}/orbits/tests/testdata/tno.csv | 0 .../adam_core}/orbits/variants.py | 0 .../adam_core}/propagator/__init__.py | 0 .../adam_core}/propagator/propagator.py | 0 .../adam_core}/propagator/tests/__init__.py | 0 .../propagator/tests/test_propagator.py | 0 .../adam_core}/propagator/tests/test_utils.py | 0 .../adam_core}/propagator/utils.py | 0 {adam_core => src/adam_core}/ray_cluster.py | 0 .../adam_core}/tests/test_imports.py | 0 .../adam_core}/tests/test_ray_cluster.py | 0 {adam_core => src/adam_core}/time/__init__.py | 0 .../adam_core}/time/tests/__init__.py | 0 .../adam_core}/time/tests/test_time.py | 0 {adam_core => src/adam_core}/time/time.py | 0 .../adam_core}/utils/__init__.py | 0 .../adam_core}/utils/helpers/__init__.py | 0 .../adam_core}/utils/helpers/data/README.md | 0 .../adam_core}/utils/helpers/data/__init__.py | 0 .../utils/helpers/data/elements_ssb_ec.csv | 0 .../utils/helpers/data/elements_ssb_eq.csv | 0 .../utils/helpers/data/elements_sun_ec.csv | 0 .../utils/helpers/data/elements_sun_eq.csv | 0 .../utils/helpers/data/ephemeris.csv | 0 .../utils/helpers/data/get_test_data.py | 0 .../adam_core}/utils/helpers/data/objects.csv | 0 .../utils/helpers/data/orbits.parquet | Bin .../helpers/data/propagated_orbits.parquet | Bin .../adam_core}/utils/helpers/observations.py | 6 +- .../adam_core}/utils/helpers/orbits.py | 0 .../utils/helpers/tests/__init__.py | 0 .../utils/helpers/tests/test_observations.py | 0 .../utils/helpers/tests/test_orbits.py | 0 {adam_core => src/adam_core}/utils/mpc.py | 0 {adam_core => src/adam_core}/utils/spice.py | 0 .../adam_core}/utils/tests/__init__.py | 0 .../adam_core}/utils/tests/test_benchmarks.py | 0 .../adam_core}/utils/tests/test_mpc.py | 0 .../adam_core}/utils/tests/test_spice.py | 0 {adam_core => src/adam_core}/version.py | 0 169 files changed, 71 insertions(+), 153 deletions(-) delete mode 100644 .github/workflows/docker-build-lint-test.yml rename {adam_core => src/adam_core}/__init__.py (100%) rename {adam_core => src/adam_core}/__version__.py (100%) rename {adam_core => src/adam_core}/constants.py (100%) rename {adam_core => src/adam_core}/coordinates/__init__.py (100%) rename {adam_core => src/adam_core}/coordinates/cartesian.py (100%) rename {adam_core => src/adam_core}/coordinates/cometary.py (100%) rename {adam_core => src/adam_core}/coordinates/conversions.py (100%) rename {adam_core => src/adam_core}/coordinates/covariances.py (100%) rename {adam_core => src/adam_core}/coordinates/jacobian.py (100%) rename {adam_core => src/adam_core}/coordinates/keplerian.py (100%) rename {adam_core => src/adam_core}/coordinates/origin.py (100%) rename {adam_core => src/adam_core}/coordinates/residuals.py (100%) rename {adam_core => src/adam_core}/coordinates/spherical.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/__init__.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/conftest.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_benchmarks.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_cartesian.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_cometary.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_covariances.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_keplerian.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_origin.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_residuals.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_spherical.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_transforms_cometary.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_transforms_keplerian.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_transforms_rotation.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_transforms_spherical.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_transforms_spice.py (100%) rename {adam_core => src/adam_core}/coordinates/tests/test_transforms_translation.py (100%) rename {adam_core => src/adam_core}/coordinates/transform.py (100%) rename {adam_core => src/adam_core}/coordinates/types.py (100%) rename {adam_core => src/adam_core}/coordinates/variants.py (96%) rename {adam_core => src/adam_core}/dynamics/__init__.py (100%) rename {adam_core => src/adam_core}/dynamics/aberrations.py (100%) rename {adam_core => src/adam_core}/dynamics/barker.py (100%) rename {adam_core => src/adam_core}/dynamics/chi.py (100%) rename {adam_core => src/adam_core}/dynamics/ephemeris.py (100%) rename {adam_core => src/adam_core}/dynamics/impacts.py (100%) rename {adam_core => src/adam_core}/dynamics/kepler.py (100%) rename {adam_core => src/adam_core}/dynamics/lagrange.py (100%) rename {adam_core => src/adam_core}/dynamics/moid.py (100%) rename {adam_core => src/adam_core}/dynamics/propagation.py (100%) rename {adam_core => src/adam_core}/dynamics/stumpff.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/__init__.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/conftest.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/test_ephemeris.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/test_impacts.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/test_kepler.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/test_moid.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/test_propagation.py (100%) rename {adam_core => src/adam_core}/dynamics/tests/test_tisserand.py (100%) rename {adam_core => src/adam_core}/dynamics/tisserand.py (100%) rename {adam_core => src/adam_core}/observations/__init__.py (100%) rename {adam_core => src/adam_core}/observations/associations.py (100%) rename {adam_core => src/adam_core}/observations/detections.py (100%) rename {adam_core => src/adam_core}/observations/exposures.py (100%) rename {adam_core => src/adam_core}/observations/tests/__init__.py (100%) rename {adam_core => src/adam_core}/observations/tests/test_associations.py (100%) rename {adam_core => src/adam_core}/observations/tests/test_detections.py (100%) rename {adam_core => src/adam_core}/observations/tests/test_exposures.py (100%) rename {adam_core => src/adam_core}/observers/__init__.py (100%) rename {adam_core => src/adam_core}/observers/observers.py (100%) rename {adam_core => src/adam_core}/observers/state.py (100%) rename {adam_core => src/adam_core}/observers/tests/__init__.py (100%) rename {adam_core => src/adam_core}/observers/tests/test_benchmarks.py (100%) rename {adam_core => src/adam_core}/observers/tests/test_state.py (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/000_ssb.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/000_sun.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/500_ssb.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/500_sun.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/F51_ssb.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/F51_sun.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/I41_ssb.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/I41_sun.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/README.md (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/W84_ssb.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/W84_sun.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/X05_ssb.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/X05_sun.parquet (100%) rename {adam_core => src/adam_core}/observers/tests/testdata/get_states.py (100%) rename {adam_core => src/adam_core}/orbit_determination/__init__.py (100%) rename {adam_core => src/adam_core}/orbit_determination/differential_correction.py (100%) rename {adam_core => src/adam_core}/orbit_determination/evaluate.py (100%) rename {adam_core => src/adam_core}/orbit_determination/fitted_orbits.py (100%) rename {adam_core => src/adam_core}/orbit_determination/outliers.py (100%) rename {adam_core => src/adam_core}/orbit_determination/tests/__init__.py (100%) rename {adam_core => src/adam_core}/orbit_determination/tests/conftest.py (100%) rename {adam_core => src/adam_core}/orbit_determination/tests/data/pure_iod_orbit.parquet (100%) rename {adam_core => src/adam_core}/orbit_determination/tests/data/pure_iod_orbit_members.parquet (100%) rename {adam_core => src/adam_core}/orbit_determination/tests/data/pure_iod_orbit_observations.parquet (100%) rename {adam_core => src/adam_core}/orbit_determination/tests/test_differential_correction.py (94%) rename {adam_core => src/adam_core}/orbit_determination/tests/test_evaluate.py (98%) rename {adam_core => src/adam_core}/orbit_determination/tests/test_outliers.py (100%) rename {adam_core => src/adam_core}/orbits/__init__.py (100%) rename {adam_core => src/adam_core}/orbits/classification.py (100%) rename {adam_core => src/adam_core}/orbits/ephemeris.py (100%) rename {adam_core => src/adam_core}/orbits/orbits.py (100%) rename {adam_core => src/adam_core}/orbits/query/__init__.py (100%) rename {adam_core => src/adam_core}/orbits/query/horizons.py (100%) rename {adam_core => src/adam_core}/orbits/query/sbdb.py (100%) rename {adam_core => src/adam_core}/orbits/query/tests/__init__.py (100%) rename {adam_core => src/adam_core}/orbits/query/tests/test_sbdb.py (100%) rename {adam_core => src/adam_core}/orbits/query/tests/testdata/sbdb/2001VB.json (100%) rename {adam_core => src/adam_core}/orbits/query/tests/testdata/sbdb/54509.json (100%) rename {adam_core => src/adam_core}/orbits/query/tests/testdata/sbdb/Ceres.json (100%) rename {adam_core => src/adam_core}/orbits/query/tests/testdata/sbdb/README.md (100%) rename {adam_core => src/adam_core}/orbits/query/tests/testdata/sbdb/missing.json (100%) rename {adam_core => src/adam_core}/orbits/tests/__init__.py (100%) rename {adam_core => src/adam_core}/orbits/tests/test_benchmarks.py (100%) rename {adam_core => src/adam_core}/orbits/tests/test_classification.py (100%) rename {adam_core => src/adam_core}/orbits/tests/test_ephemeris.py (100%) rename {adam_core => src/adam_core}/orbits/tests/test_orbits.py (100%) rename {adam_core => src/adam_core}/orbits/tests/test_variants.py (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/__init__.py (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/amo.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/apo.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/ast.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/ate.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/cen.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/hya.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/ieo.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/imb.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/mba.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/mca.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/omb.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/tjn.csv (100%) rename {adam_core => src/adam_core}/orbits/tests/testdata/tno.csv (100%) rename {adam_core => src/adam_core}/orbits/variants.py (100%) rename {adam_core => src/adam_core}/propagator/__init__.py (100%) rename {adam_core => src/adam_core}/propagator/propagator.py (100%) rename {adam_core => src/adam_core}/propagator/tests/__init__.py (100%) rename {adam_core => src/adam_core}/propagator/tests/test_propagator.py (100%) rename {adam_core => src/adam_core}/propagator/tests/test_utils.py (100%) rename {adam_core => src/adam_core}/propagator/utils.py (100%) rename {adam_core => src/adam_core}/ray_cluster.py (100%) rename {adam_core => src/adam_core}/tests/test_imports.py (100%) rename {adam_core => src/adam_core}/tests/test_ray_cluster.py (100%) rename {adam_core => src/adam_core}/time/__init__.py (100%) rename {adam_core => src/adam_core}/time/tests/__init__.py (100%) rename {adam_core => src/adam_core}/time/tests/test_time.py (100%) rename {adam_core => src/adam_core}/time/time.py (100%) rename {adam_core => src/adam_core}/utils/__init__.py (100%) rename {adam_core => src/adam_core}/utils/helpers/__init__.py (100%) rename {adam_core => src/adam_core}/utils/helpers/data/README.md (100%) rename {adam_core => src/adam_core}/utils/helpers/data/__init__.py (100%) rename {adam_core => src/adam_core}/utils/helpers/data/elements_ssb_ec.csv (100%) rename {adam_core => src/adam_core}/utils/helpers/data/elements_ssb_eq.csv (100%) rename {adam_core => src/adam_core}/utils/helpers/data/elements_sun_ec.csv (100%) rename {adam_core => src/adam_core}/utils/helpers/data/elements_sun_eq.csv (100%) rename {adam_core => src/adam_core}/utils/helpers/data/ephemeris.csv (100%) rename {adam_core => src/adam_core}/utils/helpers/data/get_test_data.py (100%) rename {adam_core => src/adam_core}/utils/helpers/data/objects.csv (100%) rename {adam_core => src/adam_core}/utils/helpers/data/orbits.parquet (100%) rename {adam_core => src/adam_core}/utils/helpers/data/propagated_orbits.parquet (100%) rename {adam_core => src/adam_core}/utils/helpers/observations.py (97%) rename {adam_core => src/adam_core}/utils/helpers/orbits.py (100%) rename {adam_core => src/adam_core}/utils/helpers/tests/__init__.py (100%) rename {adam_core => src/adam_core}/utils/helpers/tests/test_observations.py (100%) rename {adam_core => src/adam_core}/utils/helpers/tests/test_orbits.py (100%) rename {adam_core => src/adam_core}/utils/mpc.py (100%) rename {adam_core => src/adam_core}/utils/spice.py (100%) rename {adam_core => src/adam_core}/utils/tests/__init__.py (100%) rename {adam_core => src/adam_core}/utils/tests/test_benchmarks.py (100%) rename {adam_core => src/adam_core}/utils/tests/test_mpc.py (100%) rename {adam_core => src/adam_core}/utils/tests/test_spice.py (100%) rename {adam_core => src/adam_core}/version.py (100%) diff --git a/.github/workflows/docker-build-lint-test.yml b/.github/workflows/docker-build-lint-test.yml deleted file mode 100644 index 914ec5c6..00000000 --- a/.github/workflows/docker-build-lint-test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: docker - Build Lint and Test - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build-lint-test: - runs-on: ubuntu-latest - env: - IMAGE_TAG: ${{ github.sha }} - steps: - - name: Checkout git repo - uses: actions/checkout@v3 - - uses: jpribyl/action-docker-layer-caching@v0.1.0 - # Ignore the failure of a step and avoid terminating the job. - continue-on-error: true - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - install: true - - name: Build and Install - run: docker build --load -t adam-core:$IMAGE_TAG . - - name: Lint - run: docker run -i adam-core:$IMAGE_TAG hatch run dev:lint - - name: Test - run: docker run -i adam-core:$IMAGE_TAG hatch run dev:test diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 8d053bad..9b137f37 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -30,16 +30,15 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y gfortran liblapack-dev - - name: Install Hatch + - name: Install Testing Dependencies run: | pip install pip --upgrade - pip install hatch + pip install ".[dev]" - name: Lint - run: hatch run dev:lint - - name: Test, with coverage report - run: hatch run dev:coverage + run: pdm run lint + - name: Test with coverage + run: pdm run coverage - name: Coverage report to coveralls uses: coverallsapp/github-action@v2.0.0 with: - github-token: ${{ secrets.COVERALLS_TOKEN }} path-to-lcov: coverage.xml diff --git a/pyproject.toml b/pyproject.toml index 7742c171..1ab2640c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,94 +1,67 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - [project] -name = "adam_core" +name = "adam-assist" +version = "0.1.0" +description = 'ADAM Core Propagator class using ASSIST' authors = [ - { name = "Kathleen Kiker", email = "kathleen@b612foundation.org" }, - { name = "Alec Koumjian", email = "alec@b612foundation.org" }, - { name = "Joachim Moeyens", email = "moeyensj@uw.edu" }, - { name = "Spencer Nelson", email = "spencer@b612foundation.org" }, - { name = "Nate Tellis", email = "nate@b612foundation.org" }, + { name = "Alec Koumjian", email = "akoumjian@gmail.com" }, + { name = "Kathleen Kiker" } ] -description = "Core libraries for the ADAM platform" readme = "README.md" -requires-python = ">=3.10" -classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", -] -dynamic = ["version"] - +keywords = [] +requires-python = ">=3.11,<4.0" dependencies = [ - "astropy", - "astroquery", - "healpy", - "jax", - "jaxlib", - "numpy<1.25", - "pyarrow>=13.0.0", - # "pyoorb@git+https://github.com/B612-Asteroid-Institute/oorb.git@fork", - "pandas", - "ray", - "requests", - "scipy", - "spiceypy", - "quivr@git+https://github.com/moeyensj/quivr@concatenate-empty-attributes", - "mpc-obscodes", - "naif-de440", - "naif-leapseconds", - "naif-eop-high-prec", - "naif-eop-predict", - "naif-eop-historical", - "naif-earth-itrf93", + "adam-core @ git+https://github.com/B612-Asteroid-Institute/adam_core.git@main", + "assist", + "naif-de440", + "numpy", + "ray", + "spiceypy>=6.0.0" ] -[project.urls] -"Homepage" = "https://github.com/b612-asteroid-institute/adam_core" +[build-system] +requires = ["pdm-backend"] +build-backend = "pdm.backend" +[tool.pdm.build] +includes = ["src/adam_core/"] -[tool.hatch.build.targets.sdist] -include = ["/adam_core"] +[tool.pdm.scripts] +check = {composite = ["lint", "typecheck", "test"]} +format = { composite = ["black ./src/adam_core", "isort ./src/adam_core"]} +lint = { composite = ["ruff check ./src/adam_core", "black --check ./src/adam_core", "isort --check-only ./src/adam_core"] } +fix = "ruff ./src/adam_core --fix" +typecheck = "mypy --strict ./src/adam_core" -[tool.hatch.metadata] -# Temporary while pyoorb is referenced via git direct ref -allow-direct-references = true +test = "pytest --benchmark-disable {args}" +doctest = "pytest --doctest-plus --doctest-only" +benchmark = "pytest --benchmark-only" +coverage = "pytest --cov --cov-report xml" -[tool.hatch.version] -path = "adam_core/__version__.py" +[project.urls] +"Documentation" = "https://github.com/unknown/adam-assist#readme" +"Issues" = "https://github.com/unknown/adam-assist/issues" +"Source" = "https://github.com/unknown/adam-assist" -[tool.hatch.envs.dev] -dependencies = [ - "black==22.10.0", - "isort", - "mypy", - "pytest", - "pytest-cov", - "adam-pyoorb@git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@master", - "pytest-benchmark", - "pytest-doctestplus", - "pytest-mock", - "pre-commit", - "ruff", - "ipython", -] -[tool.hatch.envs.dev.scripts] -check = ["lint", "typecheck", "test"] -fix = ["ruff ./adam_core --fix"] -lint = [ - "ruff check ./adam_core", - "black --check ./adam_core", - "isort --check-only ./adam_core", +[project.optional-dependencies] +dev = [ + "pdm", + "pytest", + "pytest-cov", + "pytest-benchmark", + "ruff", + "black", + "isort", + "mypy", + "pytest", + "pytest-cov", + "pytest-benchmark", + "pytest-doctestplus", + "pytest-mock", + "ruff", + "ipython", + "adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@main", ] -format = ["black ./adam_core", "isort ./adam_core"] -typecheck = ["mypy --strict ./adam_core"] -test = ["pytest --benchmark-disable ./adam_core {args}"] -doctest = ["pytest --doctest-plus ./adam_core --doctest-only"] -benchmark = ["pytest --benchmark-only ./adam_core {args}"] -coverage = ["pytest ./adam_core --cov --cov-report xml"] [tool.black] line-length = 88 @@ -96,33 +69,10 @@ line-length = 88 [tool.isort] profile = "black" -[tool.ruff] -line-length = 110 -target-version = "py311" -lint.ignore = [] -exclude = ["build"] - -[tool.hatch.envs.docs] -dependencies = [ - "sphinx", - "sphinx-autodoc-typehints", - "sphinx-copybutton", - "sphinx-toolbox", - "quivr-sphinx-autodoc", -] -[project.optional-dependencies] -docs = [ - "sphinx", - "sphinx-autodoc-typehints", - "sphinx-copybutton", - "sphinx-toolbox", - "quivr-sphinx-autodoc", +[tool.pytest.ini_options] +# In order for namespace packages to work during tests, +# we need to import from the installed modules instead of local source +addopts = [ + "--pyargs", "adam_core", ] - -[tool.hatch.envs.docs.scripts] -make-html = ["make -C docs html"] - -clean = ["make -C docs clean"] - -open-html = ["open docs/build/html/index.html"] diff --git a/adam_core/__init__.py b/src/adam_core/__init__.py similarity index 100% rename from adam_core/__init__.py rename to src/adam_core/__init__.py diff --git a/adam_core/__version__.py b/src/adam_core/__version__.py similarity index 100% rename from adam_core/__version__.py rename to src/adam_core/__version__.py diff --git a/adam_core/constants.py b/src/adam_core/constants.py similarity index 100% rename from adam_core/constants.py rename to src/adam_core/constants.py diff --git a/adam_core/coordinates/__init__.py b/src/adam_core/coordinates/__init__.py similarity index 100% rename from adam_core/coordinates/__init__.py rename to src/adam_core/coordinates/__init__.py diff --git a/adam_core/coordinates/cartesian.py b/src/adam_core/coordinates/cartesian.py similarity index 100% rename from adam_core/coordinates/cartesian.py rename to src/adam_core/coordinates/cartesian.py diff --git a/adam_core/coordinates/cometary.py b/src/adam_core/coordinates/cometary.py similarity index 100% rename from adam_core/coordinates/cometary.py rename to src/adam_core/coordinates/cometary.py diff --git a/adam_core/coordinates/conversions.py b/src/adam_core/coordinates/conversions.py similarity index 100% rename from adam_core/coordinates/conversions.py rename to src/adam_core/coordinates/conversions.py diff --git a/adam_core/coordinates/covariances.py b/src/adam_core/coordinates/covariances.py similarity index 100% rename from adam_core/coordinates/covariances.py rename to src/adam_core/coordinates/covariances.py diff --git a/adam_core/coordinates/jacobian.py b/src/adam_core/coordinates/jacobian.py similarity index 100% rename from adam_core/coordinates/jacobian.py rename to src/adam_core/coordinates/jacobian.py diff --git a/adam_core/coordinates/keplerian.py b/src/adam_core/coordinates/keplerian.py similarity index 100% rename from adam_core/coordinates/keplerian.py rename to src/adam_core/coordinates/keplerian.py diff --git a/adam_core/coordinates/origin.py b/src/adam_core/coordinates/origin.py similarity index 100% rename from adam_core/coordinates/origin.py rename to src/adam_core/coordinates/origin.py diff --git a/adam_core/coordinates/residuals.py b/src/adam_core/coordinates/residuals.py similarity index 100% rename from adam_core/coordinates/residuals.py rename to src/adam_core/coordinates/residuals.py diff --git a/adam_core/coordinates/spherical.py b/src/adam_core/coordinates/spherical.py similarity index 100% rename from adam_core/coordinates/spherical.py rename to src/adam_core/coordinates/spherical.py diff --git a/adam_core/coordinates/tests/__init__.py b/src/adam_core/coordinates/tests/__init__.py similarity index 100% rename from adam_core/coordinates/tests/__init__.py rename to src/adam_core/coordinates/tests/__init__.py diff --git a/adam_core/coordinates/tests/conftest.py b/src/adam_core/coordinates/tests/conftest.py similarity index 100% rename from adam_core/coordinates/tests/conftest.py rename to src/adam_core/coordinates/tests/conftest.py diff --git a/adam_core/coordinates/tests/test_benchmarks.py b/src/adam_core/coordinates/tests/test_benchmarks.py similarity index 100% rename from adam_core/coordinates/tests/test_benchmarks.py rename to src/adam_core/coordinates/tests/test_benchmarks.py diff --git a/adam_core/coordinates/tests/test_cartesian.py b/src/adam_core/coordinates/tests/test_cartesian.py similarity index 100% rename from adam_core/coordinates/tests/test_cartesian.py rename to src/adam_core/coordinates/tests/test_cartesian.py diff --git a/adam_core/coordinates/tests/test_cometary.py b/src/adam_core/coordinates/tests/test_cometary.py similarity index 100% rename from adam_core/coordinates/tests/test_cometary.py rename to src/adam_core/coordinates/tests/test_cometary.py diff --git a/adam_core/coordinates/tests/test_covariances.py b/src/adam_core/coordinates/tests/test_covariances.py similarity index 100% rename from adam_core/coordinates/tests/test_covariances.py rename to src/adam_core/coordinates/tests/test_covariances.py diff --git a/adam_core/coordinates/tests/test_keplerian.py b/src/adam_core/coordinates/tests/test_keplerian.py similarity index 100% rename from adam_core/coordinates/tests/test_keplerian.py rename to src/adam_core/coordinates/tests/test_keplerian.py diff --git a/adam_core/coordinates/tests/test_origin.py b/src/adam_core/coordinates/tests/test_origin.py similarity index 100% rename from adam_core/coordinates/tests/test_origin.py rename to src/adam_core/coordinates/tests/test_origin.py diff --git a/adam_core/coordinates/tests/test_residuals.py b/src/adam_core/coordinates/tests/test_residuals.py similarity index 100% rename from adam_core/coordinates/tests/test_residuals.py rename to src/adam_core/coordinates/tests/test_residuals.py diff --git a/adam_core/coordinates/tests/test_spherical.py b/src/adam_core/coordinates/tests/test_spherical.py similarity index 100% rename from adam_core/coordinates/tests/test_spherical.py rename to src/adam_core/coordinates/tests/test_spherical.py diff --git a/adam_core/coordinates/tests/test_transforms_cometary.py b/src/adam_core/coordinates/tests/test_transforms_cometary.py similarity index 100% rename from adam_core/coordinates/tests/test_transforms_cometary.py rename to src/adam_core/coordinates/tests/test_transforms_cometary.py diff --git a/adam_core/coordinates/tests/test_transforms_keplerian.py b/src/adam_core/coordinates/tests/test_transforms_keplerian.py similarity index 100% rename from adam_core/coordinates/tests/test_transforms_keplerian.py rename to src/adam_core/coordinates/tests/test_transforms_keplerian.py diff --git a/adam_core/coordinates/tests/test_transforms_rotation.py b/src/adam_core/coordinates/tests/test_transforms_rotation.py similarity index 100% rename from adam_core/coordinates/tests/test_transforms_rotation.py rename to src/adam_core/coordinates/tests/test_transforms_rotation.py diff --git a/adam_core/coordinates/tests/test_transforms_spherical.py b/src/adam_core/coordinates/tests/test_transforms_spherical.py similarity index 100% rename from adam_core/coordinates/tests/test_transforms_spherical.py rename to src/adam_core/coordinates/tests/test_transforms_spherical.py diff --git a/adam_core/coordinates/tests/test_transforms_spice.py b/src/adam_core/coordinates/tests/test_transforms_spice.py similarity index 100% rename from adam_core/coordinates/tests/test_transforms_spice.py rename to src/adam_core/coordinates/tests/test_transforms_spice.py diff --git a/adam_core/coordinates/tests/test_transforms_translation.py b/src/adam_core/coordinates/tests/test_transforms_translation.py similarity index 100% rename from adam_core/coordinates/tests/test_transforms_translation.py rename to src/adam_core/coordinates/tests/test_transforms_translation.py diff --git a/adam_core/coordinates/transform.py b/src/adam_core/coordinates/transform.py similarity index 100% rename from adam_core/coordinates/transform.py rename to src/adam_core/coordinates/transform.py diff --git a/adam_core/coordinates/types.py b/src/adam_core/coordinates/types.py similarity index 100% rename from adam_core/coordinates/types.py rename to src/adam_core/coordinates/types.py diff --git a/adam_core/coordinates/variants.py b/src/adam_core/coordinates/variants.py similarity index 96% rename from adam_core/coordinates/variants.py rename to src/adam_core/coordinates/variants.py index 49091f51..1461e744 100644 --- a/adam_core/coordinates/variants.py +++ b/src/adam_core/coordinates/variants.py @@ -27,20 +27,16 @@ class VariantCoordinatesTable(Generic[T], Protocol): """ @property - def index(self) -> pa.Int64Array: - ... + def index(self) -> pa.Int64Array: ... @property - def sample(self) -> T: - ... + def sample(self) -> T: ... @property - def weight(self) -> pa.lib.DoubleArray: - ... + def weight(self) -> pa.lib.DoubleArray: ... @property - def weight_cov(self) -> pa.lib.DoubleArray: - ... + def weight_cov(self) -> pa.lib.DoubleArray: ... def create_coordinate_variants( diff --git a/adam_core/dynamics/__init__.py b/src/adam_core/dynamics/__init__.py similarity index 100% rename from adam_core/dynamics/__init__.py rename to src/adam_core/dynamics/__init__.py diff --git a/adam_core/dynamics/aberrations.py b/src/adam_core/dynamics/aberrations.py similarity index 100% rename from adam_core/dynamics/aberrations.py rename to src/adam_core/dynamics/aberrations.py diff --git a/adam_core/dynamics/barker.py b/src/adam_core/dynamics/barker.py similarity index 100% rename from adam_core/dynamics/barker.py rename to src/adam_core/dynamics/barker.py diff --git a/adam_core/dynamics/chi.py b/src/adam_core/dynamics/chi.py similarity index 100% rename from adam_core/dynamics/chi.py rename to src/adam_core/dynamics/chi.py diff --git a/adam_core/dynamics/ephemeris.py b/src/adam_core/dynamics/ephemeris.py similarity index 100% rename from adam_core/dynamics/ephemeris.py rename to src/adam_core/dynamics/ephemeris.py diff --git a/adam_core/dynamics/impacts.py b/src/adam_core/dynamics/impacts.py similarity index 100% rename from adam_core/dynamics/impacts.py rename to src/adam_core/dynamics/impacts.py diff --git a/adam_core/dynamics/kepler.py b/src/adam_core/dynamics/kepler.py similarity index 100% rename from adam_core/dynamics/kepler.py rename to src/adam_core/dynamics/kepler.py diff --git a/adam_core/dynamics/lagrange.py b/src/adam_core/dynamics/lagrange.py similarity index 100% rename from adam_core/dynamics/lagrange.py rename to src/adam_core/dynamics/lagrange.py diff --git a/adam_core/dynamics/moid.py b/src/adam_core/dynamics/moid.py similarity index 100% rename from adam_core/dynamics/moid.py rename to src/adam_core/dynamics/moid.py diff --git a/adam_core/dynamics/propagation.py b/src/adam_core/dynamics/propagation.py similarity index 100% rename from adam_core/dynamics/propagation.py rename to src/adam_core/dynamics/propagation.py diff --git a/adam_core/dynamics/stumpff.py b/src/adam_core/dynamics/stumpff.py similarity index 100% rename from adam_core/dynamics/stumpff.py rename to src/adam_core/dynamics/stumpff.py diff --git a/adam_core/dynamics/tests/__init__.py b/src/adam_core/dynamics/tests/__init__.py similarity index 100% rename from adam_core/dynamics/tests/__init__.py rename to src/adam_core/dynamics/tests/__init__.py diff --git a/adam_core/dynamics/tests/conftest.py b/src/adam_core/dynamics/tests/conftest.py similarity index 100% rename from adam_core/dynamics/tests/conftest.py rename to src/adam_core/dynamics/tests/conftest.py diff --git a/adam_core/dynamics/tests/test_ephemeris.py b/src/adam_core/dynamics/tests/test_ephemeris.py similarity index 100% rename from adam_core/dynamics/tests/test_ephemeris.py rename to src/adam_core/dynamics/tests/test_ephemeris.py diff --git a/adam_core/dynamics/tests/test_impacts.py b/src/adam_core/dynamics/tests/test_impacts.py similarity index 100% rename from adam_core/dynamics/tests/test_impacts.py rename to src/adam_core/dynamics/tests/test_impacts.py diff --git a/adam_core/dynamics/tests/test_kepler.py b/src/adam_core/dynamics/tests/test_kepler.py similarity index 100% rename from adam_core/dynamics/tests/test_kepler.py rename to src/adam_core/dynamics/tests/test_kepler.py diff --git a/adam_core/dynamics/tests/test_moid.py b/src/adam_core/dynamics/tests/test_moid.py similarity index 100% rename from adam_core/dynamics/tests/test_moid.py rename to src/adam_core/dynamics/tests/test_moid.py diff --git a/adam_core/dynamics/tests/test_propagation.py b/src/adam_core/dynamics/tests/test_propagation.py similarity index 100% rename from adam_core/dynamics/tests/test_propagation.py rename to src/adam_core/dynamics/tests/test_propagation.py diff --git a/adam_core/dynamics/tests/test_tisserand.py b/src/adam_core/dynamics/tests/test_tisserand.py similarity index 100% rename from adam_core/dynamics/tests/test_tisserand.py rename to src/adam_core/dynamics/tests/test_tisserand.py diff --git a/adam_core/dynamics/tisserand.py b/src/adam_core/dynamics/tisserand.py similarity index 100% rename from adam_core/dynamics/tisserand.py rename to src/adam_core/dynamics/tisserand.py diff --git a/adam_core/observations/__init__.py b/src/adam_core/observations/__init__.py similarity index 100% rename from adam_core/observations/__init__.py rename to src/adam_core/observations/__init__.py diff --git a/adam_core/observations/associations.py b/src/adam_core/observations/associations.py similarity index 100% rename from adam_core/observations/associations.py rename to src/adam_core/observations/associations.py diff --git a/adam_core/observations/detections.py b/src/adam_core/observations/detections.py similarity index 100% rename from adam_core/observations/detections.py rename to src/adam_core/observations/detections.py diff --git a/adam_core/observations/exposures.py b/src/adam_core/observations/exposures.py similarity index 100% rename from adam_core/observations/exposures.py rename to src/adam_core/observations/exposures.py diff --git a/adam_core/observations/tests/__init__.py b/src/adam_core/observations/tests/__init__.py similarity index 100% rename from adam_core/observations/tests/__init__.py rename to src/adam_core/observations/tests/__init__.py diff --git a/adam_core/observations/tests/test_associations.py b/src/adam_core/observations/tests/test_associations.py similarity index 100% rename from adam_core/observations/tests/test_associations.py rename to src/adam_core/observations/tests/test_associations.py diff --git a/adam_core/observations/tests/test_detections.py b/src/adam_core/observations/tests/test_detections.py similarity index 100% rename from adam_core/observations/tests/test_detections.py rename to src/adam_core/observations/tests/test_detections.py diff --git a/adam_core/observations/tests/test_exposures.py b/src/adam_core/observations/tests/test_exposures.py similarity index 100% rename from adam_core/observations/tests/test_exposures.py rename to src/adam_core/observations/tests/test_exposures.py diff --git a/adam_core/observers/__init__.py b/src/adam_core/observers/__init__.py similarity index 100% rename from adam_core/observers/__init__.py rename to src/adam_core/observers/__init__.py diff --git a/adam_core/observers/observers.py b/src/adam_core/observers/observers.py similarity index 100% rename from adam_core/observers/observers.py rename to src/adam_core/observers/observers.py diff --git a/adam_core/observers/state.py b/src/adam_core/observers/state.py similarity index 100% rename from adam_core/observers/state.py rename to src/adam_core/observers/state.py diff --git a/adam_core/observers/tests/__init__.py b/src/adam_core/observers/tests/__init__.py similarity index 100% rename from adam_core/observers/tests/__init__.py rename to src/adam_core/observers/tests/__init__.py diff --git a/adam_core/observers/tests/test_benchmarks.py b/src/adam_core/observers/tests/test_benchmarks.py similarity index 100% rename from adam_core/observers/tests/test_benchmarks.py rename to src/adam_core/observers/tests/test_benchmarks.py diff --git a/adam_core/observers/tests/test_state.py b/src/adam_core/observers/tests/test_state.py similarity index 100% rename from adam_core/observers/tests/test_state.py rename to src/adam_core/observers/tests/test_state.py diff --git a/adam_core/observers/tests/testdata/000_ssb.parquet b/src/adam_core/observers/tests/testdata/000_ssb.parquet similarity index 100% rename from adam_core/observers/tests/testdata/000_ssb.parquet rename to src/adam_core/observers/tests/testdata/000_ssb.parquet diff --git a/adam_core/observers/tests/testdata/000_sun.parquet b/src/adam_core/observers/tests/testdata/000_sun.parquet similarity index 100% rename from adam_core/observers/tests/testdata/000_sun.parquet rename to src/adam_core/observers/tests/testdata/000_sun.parquet diff --git a/adam_core/observers/tests/testdata/500_ssb.parquet b/src/adam_core/observers/tests/testdata/500_ssb.parquet similarity index 100% rename from adam_core/observers/tests/testdata/500_ssb.parquet rename to src/adam_core/observers/tests/testdata/500_ssb.parquet diff --git a/adam_core/observers/tests/testdata/500_sun.parquet b/src/adam_core/observers/tests/testdata/500_sun.parquet similarity index 100% rename from adam_core/observers/tests/testdata/500_sun.parquet rename to src/adam_core/observers/tests/testdata/500_sun.parquet diff --git a/adam_core/observers/tests/testdata/F51_ssb.parquet b/src/adam_core/observers/tests/testdata/F51_ssb.parquet similarity index 100% rename from adam_core/observers/tests/testdata/F51_ssb.parquet rename to src/adam_core/observers/tests/testdata/F51_ssb.parquet diff --git a/adam_core/observers/tests/testdata/F51_sun.parquet b/src/adam_core/observers/tests/testdata/F51_sun.parquet similarity index 100% rename from adam_core/observers/tests/testdata/F51_sun.parquet rename to src/adam_core/observers/tests/testdata/F51_sun.parquet diff --git a/adam_core/observers/tests/testdata/I41_ssb.parquet b/src/adam_core/observers/tests/testdata/I41_ssb.parquet similarity index 100% rename from adam_core/observers/tests/testdata/I41_ssb.parquet rename to src/adam_core/observers/tests/testdata/I41_ssb.parquet diff --git a/adam_core/observers/tests/testdata/I41_sun.parquet b/src/adam_core/observers/tests/testdata/I41_sun.parquet similarity index 100% rename from adam_core/observers/tests/testdata/I41_sun.parquet rename to src/adam_core/observers/tests/testdata/I41_sun.parquet diff --git a/adam_core/observers/tests/testdata/README.md b/src/adam_core/observers/tests/testdata/README.md similarity index 100% rename from adam_core/observers/tests/testdata/README.md rename to src/adam_core/observers/tests/testdata/README.md diff --git a/adam_core/observers/tests/testdata/W84_ssb.parquet b/src/adam_core/observers/tests/testdata/W84_ssb.parquet similarity index 100% rename from adam_core/observers/tests/testdata/W84_ssb.parquet rename to src/adam_core/observers/tests/testdata/W84_ssb.parquet diff --git a/adam_core/observers/tests/testdata/W84_sun.parquet b/src/adam_core/observers/tests/testdata/W84_sun.parquet similarity index 100% rename from adam_core/observers/tests/testdata/W84_sun.parquet rename to src/adam_core/observers/tests/testdata/W84_sun.parquet diff --git a/adam_core/observers/tests/testdata/X05_ssb.parquet b/src/adam_core/observers/tests/testdata/X05_ssb.parquet similarity index 100% rename from adam_core/observers/tests/testdata/X05_ssb.parquet rename to src/adam_core/observers/tests/testdata/X05_ssb.parquet diff --git a/adam_core/observers/tests/testdata/X05_sun.parquet b/src/adam_core/observers/tests/testdata/X05_sun.parquet similarity index 100% rename from adam_core/observers/tests/testdata/X05_sun.parquet rename to src/adam_core/observers/tests/testdata/X05_sun.parquet diff --git a/adam_core/observers/tests/testdata/get_states.py b/src/adam_core/observers/tests/testdata/get_states.py similarity index 100% rename from adam_core/observers/tests/testdata/get_states.py rename to src/adam_core/observers/tests/testdata/get_states.py diff --git a/adam_core/orbit_determination/__init__.py b/src/adam_core/orbit_determination/__init__.py similarity index 100% rename from adam_core/orbit_determination/__init__.py rename to src/adam_core/orbit_determination/__init__.py diff --git a/adam_core/orbit_determination/differential_correction.py b/src/adam_core/orbit_determination/differential_correction.py similarity index 100% rename from adam_core/orbit_determination/differential_correction.py rename to src/adam_core/orbit_determination/differential_correction.py diff --git a/adam_core/orbit_determination/evaluate.py b/src/adam_core/orbit_determination/evaluate.py similarity index 100% rename from adam_core/orbit_determination/evaluate.py rename to src/adam_core/orbit_determination/evaluate.py diff --git a/adam_core/orbit_determination/fitted_orbits.py b/src/adam_core/orbit_determination/fitted_orbits.py similarity index 100% rename from adam_core/orbit_determination/fitted_orbits.py rename to src/adam_core/orbit_determination/fitted_orbits.py diff --git a/adam_core/orbit_determination/outliers.py b/src/adam_core/orbit_determination/outliers.py similarity index 100% rename from adam_core/orbit_determination/outliers.py rename to src/adam_core/orbit_determination/outliers.py diff --git a/adam_core/orbit_determination/tests/__init__.py b/src/adam_core/orbit_determination/tests/__init__.py similarity index 100% rename from adam_core/orbit_determination/tests/__init__.py rename to src/adam_core/orbit_determination/tests/__init__.py diff --git a/adam_core/orbit_determination/tests/conftest.py b/src/adam_core/orbit_determination/tests/conftest.py similarity index 100% rename from adam_core/orbit_determination/tests/conftest.py rename to src/adam_core/orbit_determination/tests/conftest.py diff --git a/adam_core/orbit_determination/tests/data/pure_iod_orbit.parquet b/src/adam_core/orbit_determination/tests/data/pure_iod_orbit.parquet similarity index 100% rename from adam_core/orbit_determination/tests/data/pure_iod_orbit.parquet rename to src/adam_core/orbit_determination/tests/data/pure_iod_orbit.parquet diff --git a/adam_core/orbit_determination/tests/data/pure_iod_orbit_members.parquet b/src/adam_core/orbit_determination/tests/data/pure_iod_orbit_members.parquet similarity index 100% rename from adam_core/orbit_determination/tests/data/pure_iod_orbit_members.parquet rename to src/adam_core/orbit_determination/tests/data/pure_iod_orbit_members.parquet diff --git a/adam_core/orbit_determination/tests/data/pure_iod_orbit_observations.parquet b/src/adam_core/orbit_determination/tests/data/pure_iod_orbit_observations.parquet similarity index 100% rename from adam_core/orbit_determination/tests/data/pure_iod_orbit_observations.parquet rename to src/adam_core/orbit_determination/tests/data/pure_iod_orbit_observations.parquet diff --git a/adam_core/orbit_determination/tests/test_differential_correction.py b/src/adam_core/orbit_determination/tests/test_differential_correction.py similarity index 94% rename from adam_core/orbit_determination/tests/test_differential_correction.py rename to src/adam_core/orbit_determination/tests/test_differential_correction.py index fd08e769..3281aa34 100644 --- a/adam_core/orbit_determination/tests/test_differential_correction.py +++ b/src/adam_core/orbit_determination/tests/test_differential_correction.py @@ -2,7 +2,8 @@ import pytest -from ...propagator.pyoorb import PYOORB +from adam_core.propagator.adam_pyoorb import PYOORB + from ..differential_correction import fit_least_squares diff --git a/adam_core/orbit_determination/tests/test_evaluate.py b/src/adam_core/orbit_determination/tests/test_evaluate.py similarity index 98% rename from adam_core/orbit_determination/tests/test_evaluate.py rename to src/adam_core/orbit_determination/tests/test_evaluate.py index 7c193ecd..91257024 100644 --- a/adam_core/orbit_determination/tests/test_evaluate.py +++ b/src/adam_core/orbit_determination/tests/test_evaluate.py @@ -5,7 +5,8 @@ import pytest import quivr as qv -from ...propagator.pyoorb import PYOORB +from adam_core.propagator.adam_pyoorb import PYOORB + from ..evaluate import evaluate_orbits diff --git a/adam_core/orbit_determination/tests/test_outliers.py b/src/adam_core/orbit_determination/tests/test_outliers.py similarity index 100% rename from adam_core/orbit_determination/tests/test_outliers.py rename to src/adam_core/orbit_determination/tests/test_outliers.py diff --git a/adam_core/orbits/__init__.py b/src/adam_core/orbits/__init__.py similarity index 100% rename from adam_core/orbits/__init__.py rename to src/adam_core/orbits/__init__.py diff --git a/adam_core/orbits/classification.py b/src/adam_core/orbits/classification.py similarity index 100% rename from adam_core/orbits/classification.py rename to src/adam_core/orbits/classification.py diff --git a/adam_core/orbits/ephemeris.py b/src/adam_core/orbits/ephemeris.py similarity index 100% rename from adam_core/orbits/ephemeris.py rename to src/adam_core/orbits/ephemeris.py diff --git a/adam_core/orbits/orbits.py b/src/adam_core/orbits/orbits.py similarity index 100% rename from adam_core/orbits/orbits.py rename to src/adam_core/orbits/orbits.py diff --git a/adam_core/orbits/query/__init__.py b/src/adam_core/orbits/query/__init__.py similarity index 100% rename from adam_core/orbits/query/__init__.py rename to src/adam_core/orbits/query/__init__.py diff --git a/adam_core/orbits/query/horizons.py b/src/adam_core/orbits/query/horizons.py similarity index 100% rename from adam_core/orbits/query/horizons.py rename to src/adam_core/orbits/query/horizons.py diff --git a/adam_core/orbits/query/sbdb.py b/src/adam_core/orbits/query/sbdb.py similarity index 100% rename from adam_core/orbits/query/sbdb.py rename to src/adam_core/orbits/query/sbdb.py diff --git a/adam_core/orbits/query/tests/__init__.py b/src/adam_core/orbits/query/tests/__init__.py similarity index 100% rename from adam_core/orbits/query/tests/__init__.py rename to src/adam_core/orbits/query/tests/__init__.py diff --git a/adam_core/orbits/query/tests/test_sbdb.py b/src/adam_core/orbits/query/tests/test_sbdb.py similarity index 100% rename from adam_core/orbits/query/tests/test_sbdb.py rename to src/adam_core/orbits/query/tests/test_sbdb.py diff --git a/adam_core/orbits/query/tests/testdata/sbdb/2001VB.json b/src/adam_core/orbits/query/tests/testdata/sbdb/2001VB.json similarity index 100% rename from adam_core/orbits/query/tests/testdata/sbdb/2001VB.json rename to src/adam_core/orbits/query/tests/testdata/sbdb/2001VB.json diff --git a/adam_core/orbits/query/tests/testdata/sbdb/54509.json b/src/adam_core/orbits/query/tests/testdata/sbdb/54509.json similarity index 100% rename from adam_core/orbits/query/tests/testdata/sbdb/54509.json rename to src/adam_core/orbits/query/tests/testdata/sbdb/54509.json diff --git a/adam_core/orbits/query/tests/testdata/sbdb/Ceres.json b/src/adam_core/orbits/query/tests/testdata/sbdb/Ceres.json similarity index 100% rename from adam_core/orbits/query/tests/testdata/sbdb/Ceres.json rename to src/adam_core/orbits/query/tests/testdata/sbdb/Ceres.json diff --git a/adam_core/orbits/query/tests/testdata/sbdb/README.md b/src/adam_core/orbits/query/tests/testdata/sbdb/README.md similarity index 100% rename from adam_core/orbits/query/tests/testdata/sbdb/README.md rename to src/adam_core/orbits/query/tests/testdata/sbdb/README.md diff --git a/adam_core/orbits/query/tests/testdata/sbdb/missing.json b/src/adam_core/orbits/query/tests/testdata/sbdb/missing.json similarity index 100% rename from adam_core/orbits/query/tests/testdata/sbdb/missing.json rename to src/adam_core/orbits/query/tests/testdata/sbdb/missing.json diff --git a/adam_core/orbits/tests/__init__.py b/src/adam_core/orbits/tests/__init__.py similarity index 100% rename from adam_core/orbits/tests/__init__.py rename to src/adam_core/orbits/tests/__init__.py diff --git a/adam_core/orbits/tests/test_benchmarks.py b/src/adam_core/orbits/tests/test_benchmarks.py similarity index 100% rename from adam_core/orbits/tests/test_benchmarks.py rename to src/adam_core/orbits/tests/test_benchmarks.py diff --git a/adam_core/orbits/tests/test_classification.py b/src/adam_core/orbits/tests/test_classification.py similarity index 100% rename from adam_core/orbits/tests/test_classification.py rename to src/adam_core/orbits/tests/test_classification.py diff --git a/adam_core/orbits/tests/test_ephemeris.py b/src/adam_core/orbits/tests/test_ephemeris.py similarity index 100% rename from adam_core/orbits/tests/test_ephemeris.py rename to src/adam_core/orbits/tests/test_ephemeris.py diff --git a/adam_core/orbits/tests/test_orbits.py b/src/adam_core/orbits/tests/test_orbits.py similarity index 100% rename from adam_core/orbits/tests/test_orbits.py rename to src/adam_core/orbits/tests/test_orbits.py diff --git a/adam_core/orbits/tests/test_variants.py b/src/adam_core/orbits/tests/test_variants.py similarity index 100% rename from adam_core/orbits/tests/test_variants.py rename to src/adam_core/orbits/tests/test_variants.py diff --git a/adam_core/orbits/tests/testdata/__init__.py b/src/adam_core/orbits/tests/testdata/__init__.py similarity index 100% rename from adam_core/orbits/tests/testdata/__init__.py rename to src/adam_core/orbits/tests/testdata/__init__.py diff --git a/adam_core/orbits/tests/testdata/amo.csv b/src/adam_core/orbits/tests/testdata/amo.csv similarity index 100% rename from adam_core/orbits/tests/testdata/amo.csv rename to src/adam_core/orbits/tests/testdata/amo.csv diff --git a/adam_core/orbits/tests/testdata/apo.csv b/src/adam_core/orbits/tests/testdata/apo.csv similarity index 100% rename from adam_core/orbits/tests/testdata/apo.csv rename to src/adam_core/orbits/tests/testdata/apo.csv diff --git a/adam_core/orbits/tests/testdata/ast.csv b/src/adam_core/orbits/tests/testdata/ast.csv similarity index 100% rename from adam_core/orbits/tests/testdata/ast.csv rename to src/adam_core/orbits/tests/testdata/ast.csv diff --git a/adam_core/orbits/tests/testdata/ate.csv b/src/adam_core/orbits/tests/testdata/ate.csv similarity index 100% rename from adam_core/orbits/tests/testdata/ate.csv rename to src/adam_core/orbits/tests/testdata/ate.csv diff --git a/adam_core/orbits/tests/testdata/cen.csv b/src/adam_core/orbits/tests/testdata/cen.csv similarity index 100% rename from adam_core/orbits/tests/testdata/cen.csv rename to src/adam_core/orbits/tests/testdata/cen.csv diff --git a/adam_core/orbits/tests/testdata/hya.csv b/src/adam_core/orbits/tests/testdata/hya.csv similarity index 100% rename from adam_core/orbits/tests/testdata/hya.csv rename to src/adam_core/orbits/tests/testdata/hya.csv diff --git a/adam_core/orbits/tests/testdata/ieo.csv b/src/adam_core/orbits/tests/testdata/ieo.csv similarity index 100% rename from adam_core/orbits/tests/testdata/ieo.csv rename to src/adam_core/orbits/tests/testdata/ieo.csv diff --git a/adam_core/orbits/tests/testdata/imb.csv b/src/adam_core/orbits/tests/testdata/imb.csv similarity index 100% rename from adam_core/orbits/tests/testdata/imb.csv rename to src/adam_core/orbits/tests/testdata/imb.csv diff --git a/adam_core/orbits/tests/testdata/mba.csv b/src/adam_core/orbits/tests/testdata/mba.csv similarity index 100% rename from adam_core/orbits/tests/testdata/mba.csv rename to src/adam_core/orbits/tests/testdata/mba.csv diff --git a/adam_core/orbits/tests/testdata/mca.csv b/src/adam_core/orbits/tests/testdata/mca.csv similarity index 100% rename from adam_core/orbits/tests/testdata/mca.csv rename to src/adam_core/orbits/tests/testdata/mca.csv diff --git a/adam_core/orbits/tests/testdata/omb.csv b/src/adam_core/orbits/tests/testdata/omb.csv similarity index 100% rename from adam_core/orbits/tests/testdata/omb.csv rename to src/adam_core/orbits/tests/testdata/omb.csv diff --git a/adam_core/orbits/tests/testdata/tjn.csv b/src/adam_core/orbits/tests/testdata/tjn.csv similarity index 100% rename from adam_core/orbits/tests/testdata/tjn.csv rename to src/adam_core/orbits/tests/testdata/tjn.csv diff --git a/adam_core/orbits/tests/testdata/tno.csv b/src/adam_core/orbits/tests/testdata/tno.csv similarity index 100% rename from adam_core/orbits/tests/testdata/tno.csv rename to src/adam_core/orbits/tests/testdata/tno.csv diff --git a/adam_core/orbits/variants.py b/src/adam_core/orbits/variants.py similarity index 100% rename from adam_core/orbits/variants.py rename to src/adam_core/orbits/variants.py diff --git a/adam_core/propagator/__init__.py b/src/adam_core/propagator/__init__.py similarity index 100% rename from adam_core/propagator/__init__.py rename to src/adam_core/propagator/__init__.py diff --git a/adam_core/propagator/propagator.py b/src/adam_core/propagator/propagator.py similarity index 100% rename from adam_core/propagator/propagator.py rename to src/adam_core/propagator/propagator.py diff --git a/adam_core/propagator/tests/__init__.py b/src/adam_core/propagator/tests/__init__.py similarity index 100% rename from adam_core/propagator/tests/__init__.py rename to src/adam_core/propagator/tests/__init__.py diff --git a/adam_core/propagator/tests/test_propagator.py b/src/adam_core/propagator/tests/test_propagator.py similarity index 100% rename from adam_core/propagator/tests/test_propagator.py rename to src/adam_core/propagator/tests/test_propagator.py diff --git a/adam_core/propagator/tests/test_utils.py b/src/adam_core/propagator/tests/test_utils.py similarity index 100% rename from adam_core/propagator/tests/test_utils.py rename to src/adam_core/propagator/tests/test_utils.py diff --git a/adam_core/propagator/utils.py b/src/adam_core/propagator/utils.py similarity index 100% rename from adam_core/propagator/utils.py rename to src/adam_core/propagator/utils.py diff --git a/adam_core/ray_cluster.py b/src/adam_core/ray_cluster.py similarity index 100% rename from adam_core/ray_cluster.py rename to src/adam_core/ray_cluster.py diff --git a/adam_core/tests/test_imports.py b/src/adam_core/tests/test_imports.py similarity index 100% rename from adam_core/tests/test_imports.py rename to src/adam_core/tests/test_imports.py diff --git a/adam_core/tests/test_ray_cluster.py b/src/adam_core/tests/test_ray_cluster.py similarity index 100% rename from adam_core/tests/test_ray_cluster.py rename to src/adam_core/tests/test_ray_cluster.py diff --git a/adam_core/time/__init__.py b/src/adam_core/time/__init__.py similarity index 100% rename from adam_core/time/__init__.py rename to src/adam_core/time/__init__.py diff --git a/adam_core/time/tests/__init__.py b/src/adam_core/time/tests/__init__.py similarity index 100% rename from adam_core/time/tests/__init__.py rename to src/adam_core/time/tests/__init__.py diff --git a/adam_core/time/tests/test_time.py b/src/adam_core/time/tests/test_time.py similarity index 100% rename from adam_core/time/tests/test_time.py rename to src/adam_core/time/tests/test_time.py diff --git a/adam_core/time/time.py b/src/adam_core/time/time.py similarity index 100% rename from adam_core/time/time.py rename to src/adam_core/time/time.py diff --git a/adam_core/utils/__init__.py b/src/adam_core/utils/__init__.py similarity index 100% rename from adam_core/utils/__init__.py rename to src/adam_core/utils/__init__.py diff --git a/adam_core/utils/helpers/__init__.py b/src/adam_core/utils/helpers/__init__.py similarity index 100% rename from adam_core/utils/helpers/__init__.py rename to src/adam_core/utils/helpers/__init__.py diff --git a/adam_core/utils/helpers/data/README.md b/src/adam_core/utils/helpers/data/README.md similarity index 100% rename from adam_core/utils/helpers/data/README.md rename to src/adam_core/utils/helpers/data/README.md diff --git a/adam_core/utils/helpers/data/__init__.py b/src/adam_core/utils/helpers/data/__init__.py similarity index 100% rename from adam_core/utils/helpers/data/__init__.py rename to src/adam_core/utils/helpers/data/__init__.py diff --git a/adam_core/utils/helpers/data/elements_ssb_ec.csv b/src/adam_core/utils/helpers/data/elements_ssb_ec.csv similarity index 100% rename from adam_core/utils/helpers/data/elements_ssb_ec.csv rename to src/adam_core/utils/helpers/data/elements_ssb_ec.csv diff --git a/adam_core/utils/helpers/data/elements_ssb_eq.csv b/src/adam_core/utils/helpers/data/elements_ssb_eq.csv similarity index 100% rename from adam_core/utils/helpers/data/elements_ssb_eq.csv rename to src/adam_core/utils/helpers/data/elements_ssb_eq.csv diff --git a/adam_core/utils/helpers/data/elements_sun_ec.csv b/src/adam_core/utils/helpers/data/elements_sun_ec.csv similarity index 100% rename from adam_core/utils/helpers/data/elements_sun_ec.csv rename to src/adam_core/utils/helpers/data/elements_sun_ec.csv diff --git a/adam_core/utils/helpers/data/elements_sun_eq.csv b/src/adam_core/utils/helpers/data/elements_sun_eq.csv similarity index 100% rename from adam_core/utils/helpers/data/elements_sun_eq.csv rename to src/adam_core/utils/helpers/data/elements_sun_eq.csv diff --git a/adam_core/utils/helpers/data/ephemeris.csv b/src/adam_core/utils/helpers/data/ephemeris.csv similarity index 100% rename from adam_core/utils/helpers/data/ephemeris.csv rename to src/adam_core/utils/helpers/data/ephemeris.csv diff --git a/adam_core/utils/helpers/data/get_test_data.py b/src/adam_core/utils/helpers/data/get_test_data.py similarity index 100% rename from adam_core/utils/helpers/data/get_test_data.py rename to src/adam_core/utils/helpers/data/get_test_data.py diff --git a/adam_core/utils/helpers/data/objects.csv b/src/adam_core/utils/helpers/data/objects.csv similarity index 100% rename from adam_core/utils/helpers/data/objects.csv rename to src/adam_core/utils/helpers/data/objects.csv diff --git a/adam_core/utils/helpers/data/orbits.parquet b/src/adam_core/utils/helpers/data/orbits.parquet similarity index 100% rename from adam_core/utils/helpers/data/orbits.parquet rename to src/adam_core/utils/helpers/data/orbits.parquet diff --git a/adam_core/utils/helpers/data/propagated_orbits.parquet b/src/adam_core/utils/helpers/data/propagated_orbits.parquet similarity index 100% rename from adam_core/utils/helpers/data/propagated_orbits.parquet rename to src/adam_core/utils/helpers/data/propagated_orbits.parquet diff --git a/adam_core/utils/helpers/observations.py b/src/adam_core/utils/helpers/observations.py similarity index 97% rename from adam_core/utils/helpers/observations.py rename to src/adam_core/utils/helpers/observations.py index d28fed25..18bd24e4 100644 --- a/adam_core/utils/helpers/observations.py +++ b/src/adam_core/utils/helpers/observations.py @@ -72,9 +72,9 @@ def make_observations() -> Tuple[Exposures, PointSourceDetections, Associations] + [f"{i:04d}" for i in range(len(exposures))], ) for observatory_code in exposures["observatory_code"].unique(): - exposures.loc[ - exposures["observatory_code"] == observatory_code, "duration" - ] = exposure_times[observatory_code] + exposures.loc[exposures["observatory_code"] == observatory_code, "duration"] = ( + exposure_times[observatory_code] + ) exposures["filter"] = "V" # Attached exposure IDs to the ephemerides diff --git a/adam_core/utils/helpers/orbits.py b/src/adam_core/utils/helpers/orbits.py similarity index 100% rename from adam_core/utils/helpers/orbits.py rename to src/adam_core/utils/helpers/orbits.py diff --git a/adam_core/utils/helpers/tests/__init__.py b/src/adam_core/utils/helpers/tests/__init__.py similarity index 100% rename from adam_core/utils/helpers/tests/__init__.py rename to src/adam_core/utils/helpers/tests/__init__.py diff --git a/adam_core/utils/helpers/tests/test_observations.py b/src/adam_core/utils/helpers/tests/test_observations.py similarity index 100% rename from adam_core/utils/helpers/tests/test_observations.py rename to src/adam_core/utils/helpers/tests/test_observations.py diff --git a/adam_core/utils/helpers/tests/test_orbits.py b/src/adam_core/utils/helpers/tests/test_orbits.py similarity index 100% rename from adam_core/utils/helpers/tests/test_orbits.py rename to src/adam_core/utils/helpers/tests/test_orbits.py diff --git a/adam_core/utils/mpc.py b/src/adam_core/utils/mpc.py similarity index 100% rename from adam_core/utils/mpc.py rename to src/adam_core/utils/mpc.py diff --git a/adam_core/utils/spice.py b/src/adam_core/utils/spice.py similarity index 100% rename from adam_core/utils/spice.py rename to src/adam_core/utils/spice.py diff --git a/adam_core/utils/tests/__init__.py b/src/adam_core/utils/tests/__init__.py similarity index 100% rename from adam_core/utils/tests/__init__.py rename to src/adam_core/utils/tests/__init__.py diff --git a/adam_core/utils/tests/test_benchmarks.py b/src/adam_core/utils/tests/test_benchmarks.py similarity index 100% rename from adam_core/utils/tests/test_benchmarks.py rename to src/adam_core/utils/tests/test_benchmarks.py diff --git a/adam_core/utils/tests/test_mpc.py b/src/adam_core/utils/tests/test_mpc.py similarity index 100% rename from adam_core/utils/tests/test_mpc.py rename to src/adam_core/utils/tests/test_mpc.py diff --git a/adam_core/utils/tests/test_spice.py b/src/adam_core/utils/tests/test_spice.py similarity index 100% rename from adam_core/utils/tests/test_spice.py rename to src/adam_core/utils/tests/test_spice.py diff --git a/adam_core/version.py b/src/adam_core/version.py similarity index 100% rename from adam_core/version.py rename to src/adam_core/version.py From 9aec05867c03d927592481c90a56a1b7f5dd6954 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Thu, 16 May 2024 13:48:05 -0400 Subject: [PATCH 03/15] fix wrong project details --- pyproject.toml | 56 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1ab2640c..abf0be2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,42 @@ [project] -name = "adam-assist" +name = "adam_core" version = "0.1.0" -description = 'ADAM Core Propagator class using ASSIST' authors = [ - { name = "Alec Koumjian", email = "akoumjian@gmail.com" }, - { name = "Kathleen Kiker" } + { name = "Kathleen Kiker", email = "kathleen@b612foundation.org" }, + { name = "Alec Koumjian", email = "alec@b612foundation.org" }, + { name = "Joachim Moeyens", email = "moeyensj@uw.edu" }, + { name = "Spencer Nelson", email = "spencer@b612foundation.org" }, + { name = "Nate Tellis", email = "nate@b612foundation.org" }, ] +description = "Core libraries for the ADAM platform" readme = "README.md" -keywords = [] -requires-python = ">=3.11,<4.0" +requires-python = ">=3.10" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] dependencies = [ - "adam-core @ git+https://github.com/B612-Asteroid-Institute/adam_core.git@main", - "assist", - "naif-de440", - "numpy", - "ray", - "spiceypy>=6.0.0" + "astropy", + "astroquery", + "healpy", + "jax", + "jaxlib", + "numpy<1.25", + "pyarrow>=13.0.0", + "pandas", + "ray", + "requests", + "scipy", + "spiceypy", + "quivr@git+https://github.com/moeyensj/quivr@concatenate-empty-attributes", + "mpc-obscodes", + "naif-de440", + "naif-leapseconds", + "naif-eop-high-prec", + "naif-eop-predict", + "naif-eop-historical", + "naif-earth-itrf93", ] [build-system] @@ -38,9 +59,9 @@ coverage = "pytest --cov --cov-report xml" [project.urls] -"Documentation" = "https://github.com/unknown/adam-assist#readme" -"Issues" = "https://github.com/unknown/adam-assist/issues" -"Source" = "https://github.com/unknown/adam-assist" +"Documentation" = "https://github.com/B612-Asteroid-Institute/adam_core#README.md" +"Issues" = "https://github.com/B612-Asteroid-Institute/adam_core/issues" +"Source" = "https://github.com/B612-Asteroid-Institute/adam_core" [project.optional-dependencies] @@ -69,6 +90,11 @@ line-length = 88 [tool.isort] profile = "black" +[tool.ruff] +line-length = 110 +target-version = "py311" +lint.ignore = [] +exclude = ["build"] [tool.pytest.ini_options] # In order for namespace packages to work during tests, From 41083961909ec8cd619a3d324b3be703c021d504 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Thu, 16 May 2024 14:05:17 -0400 Subject: [PATCH 04/15] lint --- src/adam_core/dynamics/moid.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/adam_core/dynamics/moid.py b/src/adam_core/dynamics/moid.py index 8b064d93..b6901f10 100644 --- a/src/adam_core/dynamics/moid.py +++ b/src/adam_core/dynamics/moid.py @@ -20,6 +20,7 @@ 3. After finding the point with the lowest distance, search for the overall minimum. """ + import numpy as np import numpy.typing as npt from scipy.optimize import minimize_scalar From 3857ca7e84b8c8452ca3a40e14f1ad8a2002f6a2 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Thu, 16 May 2024 15:12:29 -0400 Subject: [PATCH 05/15] try more restrictions on numpy --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index abf0be2e..16ab4cb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dependencies = [ "healpy", "jax", "jaxlib", - "numpy<1.25", + "numpy>=1.20,<1.25", "pyarrow>=13.0.0", "pandas", "ray", From 60d6bcebec29e0d6190956be95790c574d8804c1 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Mon, 20 May 2024 10:00:19 -0400 Subject: [PATCH 06/15] When using pyargs, you have to specify module to get coverage --- pyproject.toml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 16ab4cb8..37f218b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ typecheck = "mypy --strict ./src/adam_core" test = "pytest --benchmark-disable {args}" doctest = "pytest --doctest-plus --doctest-only" benchmark = "pytest --benchmark-only" -coverage = "pytest --cov --cov-report xml" +coverage = "pytest --cov=adam_core --cov-report=xml" [project.urls] @@ -66,22 +66,18 @@ coverage = "pytest --cov --cov-report xml" [project.optional-dependencies] dev = [ - "pdm", - "pytest", - "pytest-cov", - "pytest-benchmark", - "ruff", + "adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@main", "black", + "ipython", "isort", "mypy", - "pytest", - "pytest-cov", + "pdm", "pytest-benchmark", + "pytest-cov", "pytest-doctestplus", "pytest-mock", + "pytest", "ruff", - "ipython", - "adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@main", ] [tool.black] From d3d057929565b514e2a1f6e7377975864cc272f6 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Mon, 20 May 2024 12:31:26 -0400 Subject: [PATCH 07/15] Trying quivr release --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 37f218b0..7c8a4002 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "requests", "scipy", "spiceypy", - "quivr@git+https://github.com/moeyensj/quivr@concatenate-empty-attributes", + "quivr==0.7.3a1", "mpc-obscodes", "naif-de440", "naif-leapseconds", From ec87255d1c0c18352a7afc20fcc45b5c3394c366 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Mon, 20 May 2024 13:16:08 -0400 Subject: [PATCH 08/15] remove commented test --- src/adam_core/tests/test_imports.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/adam_core/tests/test_imports.py b/src/adam_core/tests/test_imports.py index 80754e68..589e24b1 100644 --- a/src/adam_core/tests/test_imports.py +++ b/src/adam_core/tests/test_imports.py @@ -25,9 +25,6 @@ def test_import_coordinates(): ) -# def test_import_propagator(): -# from adam_core.propagator import PYOORB, Propagator - def test_import_observations(): from adam_core.observations import Associations, Exposures, PointSourceDetections From 4c4d7d9b40cdb3bc8d5e49f6d230b0f6e0ebfa17 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Mon, 20 May 2024 16:34:51 -0400 Subject: [PATCH 09/15] fix formatting --- src/adam_core/tests/test_imports.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/adam_core/tests/test_imports.py b/src/adam_core/tests/test_imports.py index 589e24b1..4b143dd0 100644 --- a/src/adam_core/tests/test_imports.py +++ b/src/adam_core/tests/test_imports.py @@ -25,7 +25,6 @@ def test_import_coordinates(): ) - def test_import_observations(): from adam_core.observations import Associations, Exposures, PointSourceDetections From d0c28705ca15a707f96b71b983532a75725930bd Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Fri, 24 May 2024 09:13:00 -0400 Subject: [PATCH 10/15] fetch pyoorb data for tests --- .github/workflows/pip-build-lint-test-coverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 9b137f37..2911bc7d 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -15,6 +15,8 @@ jobs: defaults: run: shell: bash -l {0} + env: + OORB_DATA: /tmp/oorb/data steps: - name: Checkout git repo @@ -30,6 +32,7 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y gfortran liblapack-dev + wget -r -np -nH --cut-dirs=1 -P /tmp/oorb/data https://storage.googleapis.com/oorb-data/data/ - name: Install Testing Dependencies run: | pip install pip --upgrade From 9c96dac55a683f89c84d5d3f2b575e39e08c6f5e Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Fri, 24 May 2024 09:24:08 -0400 Subject: [PATCH 11/15] update workflow name --- .github/workflows/pip-build-lint-test-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 2911bc7d..00baabb5 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -1,4 +1,4 @@ -name: hatch - Build Lint Test and Coverage +name: Build Lint Test and Coverage on: push: From 5eab8654be4d0259cefda818c96c9a2e56702a22 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Fri, 24 May 2024 10:23:52 -0400 Subject: [PATCH 12/15] Go back to scm based tag versioning --- .../pip-build-lint-test-coverage.yml | 4 +- .gitignore | 3 + pyproject.toml | 60 ++++++++++++------- src/adam_core/__init__.py | 9 ++- 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 00baabb5..7b5fea16 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -32,7 +32,9 @@ jobs: run: | sudo apt-get update -y sudo apt-get install -y gfortran liblapack-dev - wget -r -np -nH --cut-dirs=1 -P /tmp/oorb/data https://storage.googleapis.com/oorb-data/data/ + wget -P /tmp/ https://storage.googleapis.com/oorb-data/oorb_data.tar.gz + mkdir -p /tmp/oorb/ + tar -xvf /tmp/oorb_data.tar.gz -C /tmp/oorb/ - name: Install Testing Dependencies run: | pip install pip --upgrade diff --git a/.gitignore b/.gitignore index 136aed20..04c786da 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,6 @@ dmypy.json # Convenience file for docker development .docker_bash_history.txt + +# Ignore lock files +pdm.lock diff --git a/pyproject.toml b/pyproject.toml index 7c8a4002..fbbd5566 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "adam_core" -version = "0.1.0" +version = "0.0.0" authors = [ { name = "Kathleen Kiker", email = "kathleen@b612foundation.org" }, { name = "Alec Koumjian", email = "alec@b612foundation.org" }, @@ -17,34 +17,38 @@ classifiers = [ "Operating System :: OS Independent", ] dependencies = [ - "astropy", - "astroquery", - "healpy", - "jax", - "jaxlib", - "numpy>=1.20,<1.25", - "pyarrow>=13.0.0", - "pandas", - "ray", - "requests", - "scipy", - "spiceypy", - "quivr==0.7.3a1", - "mpc-obscodes", - "naif-de440", - "naif-leapseconds", - "naif-eop-high-prec", - "naif-eop-predict", - "naif-eop-historical", - "naif-earth-itrf93", + "astropy", + "astroquery", + "healpy", + "jax", + "jaxlib", + "numpy>=1.20,<1.25", + "pyarrow>=13.0.0", + "pandas", + "ray", + "requests", + "scipy", + "spiceypy", + "quivr==0.7.3a1", + "mpc-obscodes", + "naif-de440", + "naif-leapseconds", + "naif-eop-high-prec", + "naif-eop-predict", + "naif-eop-historical", + "naif-earth-itrf93", ] [build-system] -requires = ["pdm-backend"] +requires = ["pdm-backend", "setuptools_scm"] build-backend = "pdm.backend" [tool.pdm.build] includes = ["src/adam_core/"] +[tool.setuptools_scm] +write_to = "src/adam_core/_version.py" + + [tool.pdm.scripts] check = {composite = ["lint", "typecheck", "test"]} format = { composite = ["black ./src/adam_core", "isort ./src/adam_core"]} @@ -65,6 +69,18 @@ coverage = "pytest --cov=adam_core --cov-report=xml" [project.optional-dependencies] +assist = [ + "adam-assist @ git+https://github.com/B612-Asteroid-Institute/adam-assist.git@main", +] +pyoorb = [ + "adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@main", +] +all = [ + "adam-assist @ git+https://github.com/B612-Asteroid-Institute/adam-assist.git@main", + "adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@main", +] + + dev = [ "adam-pyoorb @ git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@main", "black", diff --git a/src/adam_core/__init__.py b/src/adam_core/__init__.py index 6225cf0c..ab37d44b 100644 --- a/src/adam_core/__init__.py +++ b/src/adam_core/__init__.py @@ -1,5 +1,4 @@ -from .__version__ import __version__ - -__all__ = [ - "__version__", -] +try: + from ._version import version as __version__ +except ImportError: + __version__ = "0.0.0dev0" From 25616857b216b8ca22e1a0210500825043ba7049 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Fri, 24 May 2024 11:17:07 -0400 Subject: [PATCH 13/15] Add back dynamic versioning --- .gitignore | 1 + pyproject.toml | 11 +++++++---- src/adam_core/__init__.py | 2 +- src/adam_core/__version__.py | 1 - src/adam_core/version.py | 1 - 5 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 src/adam_core/__version__.py delete mode 100644 src/adam_core/version.py diff --git a/.gitignore b/.gitignore index 04c786da..683f4eaf 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,4 @@ dmypy.json # Ignore lock files pdm.lock +.pdm-build/* diff --git a/pyproject.toml b/pyproject.toml index fbbd5566..5c663d36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "adam_core" -version = "0.0.0" +dynamic = ["version"] authors = [ { name = "Kathleen Kiker", email = "kathleen@b612foundation.org" }, { name = "Alec Koumjian", email = "alec@b612foundation.org" }, @@ -40,13 +40,16 @@ dependencies = [ ] [build-system] -requires = ["pdm-backend", "setuptools_scm"] +requires = ["pdm-backend"] build-backend = "pdm.backend" [tool.pdm.build] includes = ["src/adam_core/"] -[tool.setuptools_scm] -write_to = "src/adam_core/_version.py" +[tool.pdm.version] +source = "scm" +write_to = "adam_core/_version.py" +write_template = "__version__ = '{}'" + [tool.pdm.scripts] diff --git a/src/adam_core/__init__.py b/src/adam_core/__init__.py index ab37d44b..1f502fff 100644 --- a/src/adam_core/__init__.py +++ b/src/adam_core/__init__.py @@ -1,4 +1,4 @@ try: - from ._version import version as __version__ + from ._version import __version__ except ImportError: __version__ = "0.0.0dev0" diff --git a/src/adam_core/__version__.py b/src/adam_core/__version__.py deleted file mode 100644 index 3dc1f76b..00000000 --- a/src/adam_core/__version__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.1.0" diff --git a/src/adam_core/version.py b/src/adam_core/version.py deleted file mode 100644 index 9f7a875c..00000000 --- a/src/adam_core/version.py +++ /dev/null @@ -1 +0,0 @@ -version = "0.1.0" From e2b070078f4b3eac96a4c8c474b611454533950a Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Fri, 24 May 2024 11:23:46 -0400 Subject: [PATCH 14/15] modify publish see what happens --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6175330d..1357646a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,12 +20,12 @@ jobs: uses: actions/setup-python@v3 with: python-version: "3.11" - - name: Install Hatch + - name: Install Development Dependencies run: | pip install pip --upgrade - pip install hatch + pip install ".[dev]" - name: Build Source Distribution and Wheel - run: hatch build + run: pdm build - name: Publish adam_core to Test PyPI if: ${{ inputs.test_pypi }} uses: pypa/gh-action-pypi-publish@release/v1 From bed1961a59e37fd87ffd61986594b90f71edf2b0 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Fri, 24 May 2024 13:25:13 -0400 Subject: [PATCH 15/15] update pyoorb class names --- README.md | 22 +++++++++++++------ .../tests/test_differential_correction.py | 4 ++-- .../tests/test_evaluate.py | 6 ++--- src/adam_core/propagator/__init__.py | 1 - 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 225411a0..e4a8fb1c 100644 --- a/README.md +++ b/README.md @@ -156,12 +156,13 @@ You will need to install either adam_core[pyoorb] or adam_core[assist], or anoth #### Propagation To propagate orbits with PYOORB (here we grab some orbits from Horizons first): + ```python import numpy as np from astropy import units as u from adam_core.orbits.query import query_horizons -from adam_core.propagator import PYOORB +from adam_core.propagator import PYOORBPropagator from adam_core.time import Timestamp # Get orbits to propagate @@ -170,7 +171,7 @@ object_ids = ["Duende", "Eros", "Ceres"] orbits = query_horizons(object_ids, initial_time) # Make sure PYOORB is ready -propagator = PYOORB() +propagator = PYOORBPropagator() # Define propagation times times = initial_time.from_mjd(initial_time.mjd() + np.arange(0, 100)) @@ -186,14 +187,21 @@ propagated_orbits = propagator.propagate_orbits( ``` #### Ephemeris Generation -The propagator class can also be used to generate ephemerides for a set of orbits and observers. +Ephemeris generation requires a propagator that implements the EphemerisMixin interface. This is currently only implemented by the PYOORB propagator. The ephemeris generator will automatically map the propagated covariance matrices to the sky-plane. + +You will need to install adam-pyoorb in order to use the ephemeris generator. + +```sh +pip install adam-core[pyoorb] +``` + ```python import numpy as np from astropy import units as u from adam_core.orbits.query import query_horizons -from adam_core.propagator import PYOORB +from adam_core.propagator import PYOORBPropagator from adam_core.observers import Observers from adam_core.time import Timestamp @@ -203,7 +211,7 @@ object_ids = ["Duende", "Eros", "Ceres"] orbits = query_horizons(object_ids, initial_time) # Make sure PYOORB is ready -propagator = PYOORB() +propagator = PYOORBPropagator() # Define a set of observers and observation times times = Timestamp.from_mjd(initial_time.mjd() + np.arange(0, 100)) @@ -278,7 +286,7 @@ import numpy as np from astropy import units as u from adam_core.orbits.query import query_sbdb -from adam_core.propagator import PYOORB +from adam_core.propagator import PYOORBPropagator from adam_core.observers import Observers from adam_core.dynamics import generate_ephemeris_2body from adam_core.time import Timestamp @@ -288,7 +296,7 @@ object_ids = ["Duende", "Eros", "Ceres"] orbits = query_sbdb(object_ids) # Make sure PYOORB is ready -propagator = PYOORB() +propagator = PYOORBPropagator() # Define a set of observers and observation times times = Timestamp.from_mjd(np.arange(59000, 60000), scale="tdb") diff --git a/src/adam_core/orbit_determination/tests/test_differential_correction.py b/src/adam_core/orbit_determination/tests/test_differential_correction.py index 3281aa34..4167ad22 100644 --- a/src/adam_core/orbit_determination/tests/test_differential_correction.py +++ b/src/adam_core/orbit_determination/tests/test_differential_correction.py @@ -2,7 +2,7 @@ import pytest -from adam_core.propagator.adam_pyoorb import PYOORB +from adam_core.propagator.adam_pyoorb import PYOORBPropagator from ..differential_correction import fit_least_squares @@ -15,7 +15,7 @@ def test_fit_least_squares_pure_iod_orbit(pure_iod_orbit): # process using least squares orbit, orbit_members, observations = pure_iod_orbit - propagator = PYOORB() + propagator = PYOORBPropagator() fitted_orbit, fitted_orbit_members = fit_least_squares( orbit, observations, propagator diff --git a/src/adam_core/orbit_determination/tests/test_evaluate.py b/src/adam_core/orbit_determination/tests/test_evaluate.py index 91257024..f6c335d7 100644 --- a/src/adam_core/orbit_determination/tests/test_evaluate.py +++ b/src/adam_core/orbit_determination/tests/test_evaluate.py @@ -5,7 +5,7 @@ import pytest import quivr as qv -from adam_core.propagator.adam_pyoorb import PYOORB +from adam_core.propagator.adam_pyoorb import PYOORBPropagator from ..evaluate import evaluate_orbits @@ -17,7 +17,7 @@ def test_evaluate_orbits(pure_iod_orbit): # Test that evaluate_orbit correctly calculates residuals and other # parameters for an input orbit orbit, orbit_members, observations = pure_iod_orbit - propagator = PYOORB() + propagator = PYOORBPropagator() # Concatenate the orbit three times to test we can handle multiple orbits orbits = qv.concatenate([orbit, orbit, orbit]) @@ -64,7 +64,7 @@ def test_evaluate_orbits_outliers(pure_iod_orbit): # Test that evaluate_orbit correctly calculates residuals and other # parameters for an input orbit with outliers defined orbit, orbit_members, observations = pure_iod_orbit - propagator = PYOORB() + propagator = PYOORBPropagator() # Lets remove the last two observations outliers = observations.id.tolist()[-2:] diff --git a/src/adam_core/propagator/__init__.py b/src/adam_core/propagator/__init__.py index bd1ab456..5eed8299 100644 --- a/src/adam_core/propagator/__init__.py +++ b/src/adam_core/propagator/__init__.py @@ -7,5 +7,4 @@ "EphemerisMixin", "OrbitType", "EphemerisType", - "PYOORB", ]