Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test matrix and add scheduled tests #210

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
28 changes: 21 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,46 @@ on:
pull_request:
branches:
- main
schedule:
- cron: 0 0 * * 0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.9]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: "3.8"
fail-fast: false

steps:
- name: Checkout Source
uses: actions/checkout@v2.3.1
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
requirements/requirements-core.txt
requirements/requirements-tests.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements-tests.txt
pip install -r requirements/requirements-core.txt
pip install -r requirements/requirements-core.txt -r requirements/requirements-tests.txt
pip install .

- name: Run tests
run: |
pytest --cov-report term --cov=s2fft --cov-config=.coveragerc
pytest -v --cov-report term --cov=s2fft --cov-config=.coveragerc
codecov --token 298dc7ee-bb9f-4221-b31f-3576cc6cb702
2 changes: 1 addition & 1 deletion requirements/requirements-core.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Packages required for core functionality
numpy>=1.20
numpy>=1.20,<2
colorlog
pyyaml
jax>=0.3.13
Expand Down
2 changes: 1 addition & 1 deletion s2fft/recursions/trapani.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ def compute_full_jax(dl: jnp.ndarray, L: int, el: int) -> jnp.ndarray:


def _arg_checks(dl: np.ndarray, L: int, el: int):
"""Check arguments of Trapani functions.
r"""Check arguments of Trapani functions.

Args:
dl (np.ndarray): Wigner-d plane of which to check shape.
Expand Down
2 changes: 1 addition & 1 deletion s2fft/sampling/so3_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _ngamma(N: int) -> int:


def elmn2ind(el: int, m: int, n: int, L: int, N: int) -> int:
"""Convert from Wigner space 3D indexing of :math:`(\ell,m, n)` to 1D index.
r"""Convert from Wigner space 3D indexing of :math:`(\ell,m, n)` to 1D index.

Args:
el (int): Harmonic degree :math:`\ell`.
Expand Down
4 changes: 2 additions & 2 deletions s2fft/utils/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def upsample_by_two_mwss(f: np.ndarray, L: int, spin: int = 0) -> np.ndarray:


def upsample_by_two_mwss_ext(f_ext: np.ndarray, L: int) -> np.ndarray:
"""Upsample an extended MWSS sampled signal on the sphere defined on domain
r"""Upsample an extended MWSS sampled signal on the sphere defined on domain
:math:`[0,2\pi]` by a factor of two.

Upsampling is performed by zero-padding in harmonic space.
Expand All @@ -153,7 +153,7 @@ def upsample_by_two_mwss_ext(f_ext: np.ndarray, L: int) -> np.ndarray:


def downsample_by_two_mwss(f_ext: np.ndarray, L: int) -> np.ndarray:
"""Downsample an MWSS sampled signal on the sphere.
r"""Downsample an MWSS sampled signal on the sphere.

Can be applied to either MWSS signal sampled on original domain :math:`[0,\pi]`
or extended domain :math:`[0,2\pi]`.
Expand Down
2 changes: 1 addition & 1 deletion s2fft/utils/resampling_jax.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def upsample_by_two_mwss(f: jnp.ndarray, L: int, spin: int = 0) -> jnp.ndarray:

@partial(jit, static_argnums=(1))
def upsample_by_two_mwss_ext(f_ext: jnp.ndarray, L: int) -> jnp.ndarray:
"""Upsample an extended MWSS sampled signal on the sphere defined on domain
r"""Upsample an extended MWSS sampled signal on the sphere defined on domain
:math:`[0,2\pi]` by a factor of two.

Upsampling is performed by zero-padding in harmonic space. JAX implementation of
Expand Down
2 changes: 1 addition & 1 deletion s2fft/utils/resampling_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def upsample_by_two_mwss(f: torch.tensor, L: int, spin: int = 0) -> torch.tensor


def upsample_by_two_mwss_ext(f_ext: torch.tensor, L: int) -> torch.tensor:
"""Upsample an extended MWSS sampled signal on the sphere defined on domain
r"""Upsample an extended MWSS sampled signal on the sphere defined on domain
:math:`[0,2\pi]` by a factor of two.

Upsampling is performed by zero-padding in harmonic space. Torch implementation of
Expand Down
Loading