diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index d45c0656..f732f7cb 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -26,21 +26,11 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - cache: 'pip' # caching pip dependencies - - - name: Install openorb dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y gfortran liblapack-dev - 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/ + cache: 'pip' # caching pip dependencies - name: Install Testing Dependencies run: | pip install pip --upgrade pip install ".[dev]" - # Install pyoorb propagator from source - pip install git+https://github.com/B612-Asteroid-Institute/adam-pyoorb.git@main - name: Lint run: pdm run lint - name: Test with coverage diff --git a/pyproject.toml b/pyproject.toml index e546cceb..530c3192 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "healpy", "jax", "jaxlib", - "numpy>=1.20,<1.25", + "numpy>=2.0.0", "pyarrow>=13.0.0", "pandas", "ray", diff --git a/src/adam_core/coordinates/cartesian.py b/src/adam_core/coordinates/cartesian.py index 6f544154..4c4cf3a2 100644 --- a/src/adam_core/coordinates/cartesian.py +++ b/src/adam_core/coordinates/cartesian.py @@ -206,7 +206,7 @@ def rotate( Rotated Cartesian coordinates and their covariances. """ # Extract coordinate values into a masked array and mask NaNss - masked_coords = np.ma.masked_array(self.values, fill_value=np.NaN) + masked_coords = np.ma.masked_array(self.values, fill_value=np.nan) masked_coords.mask = np.isnan(masked_coords.data) # Rotate coordinates @@ -223,7 +223,7 @@ def rotate( rotation_matrix @ masked_covariances.filled() @ rotation_matrix.T ) # Reset the mask to the original mask - covariances_rotated[masked_covariances.mask] = np.NaN + covariances_rotated[masked_covariances.mask] = np.nan # Check if any covariance elements are near zero, if so set them to zero near_zero = len( @@ -284,7 +284,7 @@ def translate( raise ValueError(f"Expected vector to have shape (6,) or ({N}, 6).") # Extract coordinate values into a masked array and mask NaNss - masked_coords = np.ma.masked_array(self.values, fill_value=np.NaN) + masked_coords = np.ma.masked_array(self.values, fill_value=np.nan) masked_coords.mask = np.isnan(masked_coords.data) # Translate coordinates diff --git a/src/adam_core/coordinates/covariances.py b/src/adam_core/coordinates/covariances.py index c50cf785..11d7cade 100644 --- a/src/adam_core/coordinates/covariances.py +++ b/src/adam_core/coordinates/covariances.py @@ -11,7 +11,7 @@ logger = logging.getLogger(__name__) -COVARIANCE_FILL_VALUE = np.NaN +COVARIANCE_FILL_VALUE = np.nan def sigmas_to_covariances(sigmas: np.ndarray) -> np.ndarray: diff --git a/src/adam_core/coordinates/tests/test_covariances.py b/src/adam_core/coordinates/tests/test_covariances.py index 9760c869..1a9f5881 100644 --- a/src/adam_core/coordinates/tests/test_covariances.py +++ b/src/adam_core/coordinates/tests/test_covariances.py @@ -121,13 +121,13 @@ def test_CoordinateCovariances_to_from_matrix(): covariances = [None, np.ones((6, 6)).flatten()] cov = CoordinateCovariances.from_kwargs(values=covariances) cov_expected = np.ones((2, 6, 6)) - cov_expected[0, :, :] = np.NaN + cov_expected[0, :, :] = np.nan np.testing.assert_equal(cov.to_matrix(), cov_expected) # Test when covariances are only None covariances = [None, None] cov = CoordinateCovariances.from_kwargs(values=covariances) - cov_expected = np.full((2, 6, 6), np.NaN) + cov_expected = np.full((2, 6, 6), np.nan) np.testing.assert_equal(cov.to_matrix(), cov_expected) diff --git a/src/adam_core/coordinates/tests/test_residuals.py b/src/adam_core/coordinates/tests/test_residuals.py index 56aed914..92e32acf 100644 --- a/src/adam_core/coordinates/tests/test_residuals.py +++ b/src/adam_core/coordinates/tests/test_residuals.py @@ -143,8 +143,8 @@ def test_batch_coords_and_covariances_single_batch_missing_values(): # Single batch, one dimension has no values coords = np.array( [ - [1.0, np.NaN, 3.0], - [2.0, np.NaN, 4.0], + [1.0, np.nan, 3.0], + [2.0, np.nan, 4.0], ] ) covariances = np.array( @@ -178,8 +178,8 @@ def test_batch_coords_and_covariances_single_batch_missing_values(): # Single batch, two dimensions have no values coords = np.array( [ - [np.NaN, np.NaN, 3.0], - [np.NaN, np.NaN, 4.0], + [np.nan, np.nan, 3.0], + [np.nan, np.nan, 4.0], ] ) covariances = np.array( @@ -212,8 +212,8 @@ def test_batch_coords_and_covariances_multiple_batches(): # Multiple batches, different rows have different missing values coords = np.array( [ - [1.0, np.NaN, 3.0], - [np.NaN, 3.0, 4.0], + [1.0, np.nan, 3.0], + [np.nan, 3.0, 4.0], ] ) covariances = np.array( diff --git a/src/adam_core/coordinates/tests/test_spherical.py b/src/adam_core/coordinates/tests/test_spherical.py index ed1b90da..ca0bec87 100644 --- a/src/adam_core/coordinates/tests/test_spherical.py +++ b/src/adam_core/coordinates/tests/test_spherical.py @@ -11,10 +11,10 @@ def test_SphericalCoordinates_to_unit_sphere(): # that have NaN values for rho will be set to 1.0 and coordinates # that have NaN values for vrho will be set to 0.0. coords = SphericalCoordinates.from_kwargs( - rho=[1.0, np.NaN, 3.0], + rho=[1.0, np.nan, 3.0], lon=[30.0, 45.0, 60.0], lat=[-60, 0.0, 60.0], - vrho=[np.NaN, 0.002, -0.01], + vrho=[np.nan, 0.002, -0.01], vlon=[0.005, 0.006, 0.007], vlat=[-0.0005, 0.0006, -0.007], origin=Origin.from_kwargs(code=["SUN", "SUN", "SUN"]),