From 25eb958989643b7112948fde3d1a3665038845bd Mon Sep 17 00:00:00 2001 From: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:25:42 -0600 Subject: [PATCH 1/5] set NUMBA_DISABLE_JIT=1 for tests and coverage --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f54c48def..53549bad3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,10 @@ jobs: run: | conda list + - name: Disable numba for testing & coverage + env: + NUMBA_DISABLE_JIT: 1 + - name: Run Namespace Tests run: | python -m pytest test From 273711cb634f01a85f99a0162c794dc42ab4b3a9 Mon Sep 17 00:00:00 2001 From: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:37:32 -0600 Subject: [PATCH 2/5] update env --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53549bad3..7c0e84a5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,17 +62,18 @@ jobs: run: | conda list - - name: Disable numba for testing & coverage - env: - NUMBA_DISABLE_JIT: 1 - name: Run Namespace Tests run: | python -m pytest test + env: + NUMBA_DISABLE_JIT: 1 - name: Run Coverage Tests run: | python -m pytest test -v --cov=./uxarray --cov-report=xml + env: + NUMBA_DISABLE_JIT: 1 - name: Upload code coverage to Codecov if: github.repository == 'UXARRAY/uxarray' From e3dce0ac70d4c2f9c28331c4617c4539e1e5bb24 Mon Sep 17 00:00:00 2001 From: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:53:30 -0600 Subject: [PATCH 3/5] use numpy instead of math --- uxarray/grid/coordinates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uxarray/grid/coordinates.py b/uxarray/grid/coordinates.py index e39929f53..d0cf310aa 100644 --- a/uxarray/grid/coordinates.py +++ b/uxarray/grid/coordinates.py @@ -790,8 +790,8 @@ def _xyz_to_lonlat_rad_no_norm( Latitude in radians """ - lon = math.atan2(y, x) - lat = math.asin(z) + lon = np.atan2(y, x) + lat = np.asin(z) # set longitude range to [0, pi] lon = np.mod(lon, 2 * np.pi) From 074a0eab15314d95d881499bb5c0d454885edc08 Mon Sep 17 00:00:00 2001 From: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:15:52 -0600 Subject: [PATCH 4/5] use numpy instead of math --- uxarray/grid/coordinates.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/uxarray/grid/coordinates.py b/uxarray/grid/coordinates.py index d0cf310aa..cb3b2cadf 100644 --- a/uxarray/grid/coordinates.py +++ b/uxarray/grid/coordinates.py @@ -1,6 +1,5 @@ import xarray as xr import numpy as np -import math import warnings from uxarray.conventions import ugrid @@ -53,8 +52,8 @@ def _xyz_to_lonlat_rad_no_norm( Latitude in radians """ - lon = math.atan2(y, x) - lat = math.asin(z) + lon = np.atan2(y, x) + lat = np.asin(z) # set longitude range to [0, pi] lon = np.mod(lon, 2 * np.pi) @@ -102,8 +101,8 @@ def _xyz_to_lonlat_rad_scalar( y /= denom z /= denom - lon = math.atan2(y, x) - lat = math.asin(z) + lon = np.atan2(y, x) + lat = np.asin(z) # set longitude range to [0, pi] lon = np.mod(lon, 2 * np.pi) From 67cf1639930adb09f86f897717459534f5df7eb0 Mon Sep 17 00:00:00 2001 From: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:40:20 -0600 Subject: [PATCH 5/5] only disable numba for coverage --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c0e84a5b..a0d1edc75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,6 @@ jobs: - name: Run Namespace Tests run: | python -m pytest test - env: - NUMBA_DISABLE_JIT: 1 - name: Run Coverage Tests run: |